The Vigenere algorithm in C# explanation
问题 I came across this code: Byte Vigenere Cipher, error with decryption But trying to follow the rules I made a new question about it. The following algorithm is used and I'm trying to get a better understanding into it: Byte[] result= new Byte[plaintext.Length]; key = key.Trim().ToUpper(); int keyIndex = 0; int keylength = key.Length; for (int i = 0; i < plaintext.Length; i++) { keyIndex = keyIndex % keylength; int shift = (int)key[keyIndex] - 65; result[i] = (byte)(((int)plaintext[i] + shift)