Enigma: A cipher program

Sample Output:
***** ENIGMA *****
[1] Encrypt
[2] Decrypt
[3] Exit
Enter choice: 1
***** ENCRYPTION *****
Enter plain text to encrypt: i love you
Enter encryption key: love
Encrypted cipher text: t zjzp mjy
Save cipher text to file? (y/n): y
Enter file name: cipher1
cipher1.txt saved successfully!
***** ENIGMA *****
[1] Encrypt
[2] Decrypt
[3] Exit
Enter choice: 2
***** DECRYPTION *****
Enter cipher text to decrypt: t zjzp mjy
Enter decryption key: love
Decrypted plain text: i love you
***** ENIGMA *****
[1] Encrypt
[2] Decrypt
[3] Exit
Enter choice: 3
Program exits…

This is the sample output of what I am going to do but I can't seem to create a code for this. Can someone help me? Here is an additional information.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Each letter in the plain text is replaced by a letter some fixed number of positions down the alphabet based on the corresponding letter in the encryption key.
For example, we will encrypt the plaintext “i love you” using the encryption key “love”. We start with the first character of the plain text which is ‘i’. First, we’ll look at the corresponding character in the encryption key, which happens to be, in this case, also the first character: ‘l’. We then count the position of ‘l’ relative to the starting letter of the alphabet, which is ‘a’. Character ‘l’ is 11 places away from ‘a’.
Now we go back to our plain text character, ‘i’. We will now replace ‘i’ with the 11th letter relative to it to the right which is ‘t’. We have now converted a plain text character to its cipher equivalent. We then move to the next letter of the plain text (‘l’) and its corresponding letter in the encryption key (‘o’) and repeat the encryption process.
If we’ve reached the final letter in the encryption key and there are still unencrypted letters left in the plain text, we just roll back to the key’s first letter and continue the process. For instance, the fifth letter in “i love you” is ‘e’. Since our encryption key “love” only contains 4 characters, we’ll go back to the starting letter ‘l’ and use it as the encryption key for plain text character ‘e’.
Similarly, if we’ve reached the final letter of the alphabet (‘z’) but still haven’t finished encrypting the plain text character, we just continue the counting of positions at the start of the alphabet (‘a’). For instance, encryption key character ‘v’ is 21 places away from ‘a’. If we use this shift number to encrypt plain text character ‘o’, we’ll reach the end of the alphabet by the 11th shift. In this case, we’ll just continue the next shift count at ‘a’. Thus, the resulting cipher character is ‘j’.
What do you need help with?
Topic archived. No new replies allowed.