Question: Lab Assignment Consider the shift cipher, which shifts each letter in the alphabet by a certain amount. The key is simply a number between 1

Lab Assignment Consider the shift cipher, which shifts each letter in the alphabet by a certain amount. The key is simply a number between 1 and 25, specifying the amount to shift by. For example, the letter 'a' shifted by 1 becomes 'b'. The letter 'z' wraps back to the beginning of the alphabet, so 'z' shifted by 1 becomes 'a'. Encryption Encrypt the following message with the specified key: Key: 7 traditionally plaintext is all lower case and ciphertext is all uppercase and punctuation is avoided Decryption Decrypt the following messages with the specified key: Key: 23 KLOB OEXO JABOK AXB ZOVMOLPVPOBJP LMBOXQB LK PBNRBKZBP LC WBOLP XKA LKBP KLQ IBQQBOP Code Assignment: Brute Force Attack Using the following method to decrypt a single letter with a given key, write a program which prompts for and receives a ciphertext string, then displays all 25 possible decryptions. Shift cipher decryption. Call for each letter of ciphertext. * C - the ciphertext letter (upper case) k - the key, the number of letters to shift by return the plaintext letter (lower case) char decrypt(char c, int k) { int p = (c-k - 'A') % 26; if(p
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
