Answer the question
In order to leave comments, you need to log in
How to get a digital code - backpack encryption?
Hi, I'm learning about backpack encryption.
Stuck on getting a digital code when encrypting a message
ps I am writing a program in c #, it will be good if you tell me some code for this matter.
Answer the question
In order to leave comments, you need to log in
Take the line of your message, raise the case for it.
Then iterate over it character by character, and subtract 'A' from each character.
Check that the result is in the range [0-25].
That's all - you got the digital code of the letter. If the result is not in range, there is a non-alphabetic character in the encrypted message
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question