What I need to do, is take any letter and convert it into another letter based on a key using the caesar cipher.
The code for encryption is: (x + key)mod26
So say for the letter A, A = 0 and my key is 56, so it would be (56)mod26 which is 4, so A = 0, B = 1, C = 2, D = 4, so A becomes D.
How do I write this algorithem? I have the chars as:
char PlainAlpha[]={"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
char CaesarAlpha[]={"XYZABCDEFGHIJKLMNOPQRSTUVW"};
Where plain is what is entered and caesar is the encryption.
thanks for any help.
The code for encryption is: (x + key)mod26
So say for the letter A, A = 0 and my key is 56, so it would be (56)mod26 which is 4, so A = 0, B = 1, C = 2, D = 4, so A becomes D.
How do I write this algorithem? I have the chars as:
char PlainAlpha[]={"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
char CaesarAlpha[]={"XYZABCDEFGHIJKLMNOPQRSTUVW"};
Where plain is what is entered and caesar is the encryption.
thanks for any help.