Nov-06-2023, 10:24 AM
(Nov-06-2023, 08:02 AM)armamos Wrote: I'm not sure, but the error you are getting is likely because you are trying to decrypt a message that is longer than the key. The ADFGVX cipher is a polyalphabetic substitution cipher, which means that it uses multiple alphabets to encrypt and decrypt messages. The key determines which alphabet is used for each character in the message.I've already fixed the code; now, the only issue is with the key. If it's one character shorter than the input text to be encrypted, decryption doesn't work. However, if it's shorter by more characters, it works
If the key is shorter than the message, then the cipher will start using the same alphabets again for the later characters in the message. This means that the decryption will not be accurate.