Introduction
Requirement
Write a Python program that generates passwords in three different ways.
a)Generate a random 6 character password. The first 3 characters must be capital letters (A – Z) and the second 3 characters must be numeric characters (0 – 9).
b)Enter a secret word and then specify an amount of ‘right shift’ of the characters to encrypt your word. This simple method to encrypt data is attributed to Julius Caesar, the Roman Emperor. (If you are interested, you may like to read the following… ). This method takes each character in a message and replaces it with one which is a certain distance (offset) along the alphabet from it (moving right). For example: 1 2 3 4 5 6 7 8 9 . . . . . A B C D E F G H I J K L M . . . +3 A B C D E F G H I J . . . If the offset is 3 then A becomes D, B becomes E, C becomes F etc. In this case the word DIG encrypts to GLJ. In order to decrypt the word/string, simply offset by the same amount moving in the opposite direction (i.e. moving left). Instead of restricting the cipher to the alphabetic characters only, we will use all of the printable ASCII characters. That is, all the characters from ASCII 32 (Space) to ASCII 126 (~).
You will need to use the following two functions - ord(c) Given c, a string of length one ord(c), returns an integer representing the value of the string. For example: ord(‘a’) returns the integer 97. chr(i) Returns a string of one character whose ASCII code is the integer i. For example: chr(97) returns the string ‘a’.
c)Enter a secret sentence and create a password by taking the last letter of each word.
Write a menu driven program called yourId_encryptor.py that will allow the user to enter commands and process these commands until the quit command is entered.