I have this bit of code:
[deleted due to unwanted plagiarism]
This is a simplified version of the Enigma machine used during World War II. The decrypting part of this code does not work well and returns HFFDGRHC instead of HELLOBOY. Would anyone know how to fix this problem?
Assignment: Imitate a Enigma cipher: The twist of the ENIGMA machine was that there were actually 26 different rotating cyphers, and a new cypher was chosen for each letter based on the output of the previous letter. Hint: Add a sum of the previous letter and previous cipher key for encryption. Using this information, figure how to decrypt rather than encrypt.