How to encrypt and decrypt a char? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

How to encrypt and decrypt a char?

hello, i want to ask, in case if i have to encrypt a letter but it just encrypted a few char. ex : my name is d . and we have to replace the 'm' char with '?' so it turn to be: ?y na?e is d , can someone explain to me in java code? thank youu

22nd Jan 2017, 10:39 AM
Diyah
Diyah - avatar
1 Answer
+ 3
There are many ways of encryption: addition, subtraction, multiplication, division, compression ratio, the replacement... but the most effective and convenient continue operations, such as xor encryption. It is convenient to use: to encrypt a number (or symbol) need to use the xor operation on the number, and decrypt to use xor with this number again. 'a' xor 23 = 'v' v' xor 23 = 'a'
9th Feb 2017, 6:35 PM
SUPER_S
SUPER_S - avatar