A
A
Alex2020-12-14 00:12:35
Encryption
Alex, 2020-12-14 00:12:35

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
5fd6839853e60231465588.png
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

1 answer(s)
A
Armenian Radio, 2020-12-14
@etrid

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 question

Ask a Question

731 491 924 answers to any question