I am working on a cryptography application which is to be used in my country. I tried looking up to see if there are any algorithms that support the Cyrillic alphabet, but I found none. Do you know of any? Can mainstream algorithms (Like AES) work with Cyrillic letters?
Can AES work with Cyrillic letters?
So you only have to encode your Cyrillic letters to any bit or byte encoding. Unicode - which designates code points to a huge range of characters - specifies the most likely candicate: UTF-8 encoding.
UTF-8 is identical to ASCII for any code points up to 127. After that it uses more bytes depending on the value of the code point; higher code points require more bytes.
So you follow these steps for encryption:
- character encode your Cyrillic text in UTF-8, results in the plaintext
- encrypt the plaintext, results in the ciphertext
- possibly encode the ciphertext using base 64, resulting in encoded ciphertext
and for decryption:
- possibly decode the encoded ciphertext using base 64, resulting in the (binary) ciphertext
- decrypt the ciphertext, results in the plaintext
- character decode the plaintext, results in your Cyrillic text
- for modern ciphers, plaintext and ciphertext are binary despite their name;
- character encoding (e.g. UTF-8) converts strings of characters to bytes;
- encoding (e.g. base 64) converts bytes to printable characters;
- for larger text you may want to look into streaming, all of the above can be accomplished using streams as well;
- if you want to send something you also need an authentication tag (MAC or HMAC) over the ciphertext.
Modern cryptographic algorithms are specified in terms of bytes or even bits, not characters. Whether the data you encrypt happens to represent latin or cyrillic letters or pictures or audio data or anything else does not matter at all to an encryption algorithm; all it ever sees is a bunch of bytes.
What this means in practice is: You have to fix some encoding (UTF-8 is very common nowadays) to translate your characters to a string of bytes which can then be processed by any cryptographic implementation as usual.