How to encrypt the english language? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to encrypt the english language?

If we have a "Hello" String Then it should be printed as "svool" How we can do it in java language?

12th Feb 2021, 5:10 PM
Younes Damouna
Younes Damouna - avatar
3 Answers
+ 4
Younes Damouna assuming the input is "hello", then ascii value for character 'h' is 104 and if you subtract 97('ascii value of 'a') from it you get 7 and now if you subtract 7 from 122(ascii value of 'z') , you get 115 (ascii value of 's'). If the above doesn't makes sense let me know.
12th Feb 2021, 5:38 PM
Abhay
Abhay - avatar
+ 2
Younes Damouna i did that only but i will try again. For 'h' --------------- 'z'-h'-'a' ,//now replace them with their ascii value. 122-104-97=115 (ascii value of 's') For 'e' --------------- 'z'-'e'-'a' 122-101-97=118(ascii value of 'v') If you are wondering about conversions from ascii to letter and vice versa , google the methods use to do so.
12th Feb 2021, 6:26 PM
Abhay
Abhay - avatar
+ 1
Thank you I will try to solve it
12th Feb 2021, 6:29 PM
Younes Damouna
Younes Damouna - avatar