- Can you help my? Please Q:
Item #1 Implement encryption/decryption functions that take a key (a s an integer in 0, 1,2, ... , 25) and a string. The function should only operate on the characters ‘a’, ‘b’, ... ‘z’ (both upper and lower case), and it should leave any other characters, unchanged.
Item #2 Implement a function that performs a brute force attack on a ciphertext, it should print a list of the keys and associated decryptions. It should also take an optional parameter that takes a substring and only prints out potential plaintexts tha t contain that decryption.
Item #3 Show the output of your encrypt function (Item #1) on the following (key, plaintext) pairs:a) k = 6, plaintext = "Get me a vanilla ice cream, make it a double." b) k = 15, plaintext = "I don't much care for Leonard Cohen."c)k= 16, plaintext = "I like root beer floats."
Item #4 Show the output of your decrypt function (Item #1) on the following (key, ciphertext) pairs:a)k = 12, ciphertext ='NDUZS FTQ BUZQ OAZQE' b) k = 3, ciphertext = " FDHVDU QHHGV WR ORVH ZHLJKW." c) k = 20, ciphertext = " UFGIHXM ULY NUMNYS."
Item #5 Show the output of your attack function (Item #2) on the following ciphertexts, if an optional keyword is specified, pass that to your attack function:a) ciphertext ='GRYY GURZ GB TB GB NZOEBFR PUNCRY.' keyword = 'chapel' b) ciphertext = 'WZIV KYV JYFK NYVE KYV TPDSRCJ TIRJY.' keyword = 'cymbal' c) ciphertext = 'BAEEQ KLWOSJL OSK S ESF OZG CFWO LGG EMUZ.' no keyword
- Thank you
↧
Encryption/decryption
↧