Question: Requirements The # symbol denotes user input $ python 3 vigenere.py - e Enter the key: helloworld Enter the plaintext: #The quick brown fox jumps

Requirements The # symbol denotes user input
$ python 3
vigenere.py -e
Enter the key: "helloworld
Enter the plaintext: #The quick brown fox jumps over the lazy dog.
Ciphertext is: Alp bieqb muvay qct xlxsz sgpf pvv wdgc ozu.
$ python 3
vigenere.py -d
Enter the key: "helloworld
Enter the ciphertext: #Alp bieqb muvay qct xlxsz sgpf pvv wdgc ozu.
Plaintext is: The quick brown fox jumps over the lazy dog.
Grouping
$ python 3
vigenere.py -e -g 5
Enter the key: "helloworld
Enter the plaintext: #The quick brown fox jumps over the lazy dog.
Ciphertext is: ALPBI EQBMU VAYQC TXLXS ZSGPF PVVWD GCOZU
$ python 3
vigenere.py -d -g 5
Enter the key: thelloworld
Enter the ciphertext: #Alp bieqb muvay qct xlxsz sgpf pvv wdgc ozu.
Plaintext is: THEQU ICKBR OWNFO XJUMP SOVER THELA ZYDOG
$ python 3
vigenere.py -e -g 5
Enter the key: "helloworld
Enter the plaintext: #The quick brown fox.
Ciphertext is: ALPBI EQBMU VAYQC T
In the third example, since we didn't have enough characters to make a full group, our last group
just wont have the full amount.
Errors
$ python 3
vigenere.py -e-d
Error: Cannot have both encrypt and decrypt mode.
$ python3
vigenere.py -g 4
Error: Program mode was not specified. Use -e for encrypt and -d for decrypt.
$ python3
vigenere.py
Error: Program mode was not specified. Use -e for encrypt and - d for decrypt.
$ python3
vigenere.py -g-e
Error: You must supply an integer of at least zero with the grouping flag.
Handling user input
$ python 3
vigenere.py -e
Enter the key: Habcd1234
Error: Keys must be at least 1 character, and consist only of alphabetic characters.
Enter the key: Habcd
Enter the plaintext: HHello, World!
Ciphertext is: Hfnoo, Xqule!
$ python 3
vigenere.py -e
Enter the key: "
Error: Keys must be at least 1 character, and consist only of alphabetic characters.
Enter the key: Habcd
Enter the plaintext: #Hello, World!
Ciphertext is: Hfnoo, Xqule!
$ python 3
vigenere.py -e
Enter the key: Habcd
Enter the plaintext: #
Ciphertext is:
It is okay for the user to not enter a message. The key is required, though. You should keep asking
for the key until a valid one is provided by the user.
Your program will be required to both encrypt and decrypt ciphertext. The mode is specified by a
program argument flag, -e for encrypt mode, and -d for decrypt mode.
Your program should work for both upper and lowercase plaintext/ciphertext/keys, even if the key
and plaintext/ciphertext do not have the same case as eachother.
Your program should also have another option for grouping output characters together. This can be
specified by the -g-g-e-d
 Requirements The # symbol denotes user input $ python 3 vigenere.py

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!