Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program three encryption methods using python to read in a file and encrypt and decrypt it CFB CBC CTR 256 bit key xor encryption as
Program three encryption methods using python to read in a file and encrypt and decrypt it
CFB
CBC
CTR
256 bit key
xor encryption as block cipher
sample output should be as follows:
----Original file------ b'hey whats your name 68 65 79 20 77 68 61 74 73 20 79 6F 75 72 20 6E 61 60 65 ----ENCRYPTED---- Encrypting in OFB mode with key 01 02 03 04 ECB: 69 67 ZA 24 76 6A 62 70 72 22 7A 6B 74 70 23 6A 60 6F 66 OFB: 69 67_7A 24 1F OD 18 54 94 48 18 1B 06 52 59 01 14 17 45 6E 61 6D ----DECRYPTED---- Decrypting in OFB mode with key 01 02 03 04, ECB: 68 65 79 20 77 68 61 74 73 20 79 6F 75 72 20 6E 61 6D 65 OFB: 68 65 79 20 77 68 61 74 73 20 79 6F 75 72 20 6E 61 6D 65 00 00 00 ----PLAINTEXT---- ECB: hey whats your name OFB: hey whats your name All done ----Original file------ b'hey whats your name 68 65 79 20 77 68 61 74 73 20 79 6F 75 72 20 6E 61 60 65 ----ENCRYPTED---- Encrypting in OFB mode with key 01 02 03 04 ECB: 69 67 ZA 24 76 6A 62 70 72 22 7A 6B 74 70 23 6A 60 6F 66 OFB: 69 67_7A 24 1F OD 18 54 94 48 18 1B 06 52 59 01 14 17 45 6E 61 6D ----DECRYPTED---- Decrypting in OFB mode with key 01 02 03 04, ECB: 68 65 79 20 77 68 61 74 73 20 79 6F 75 72 20 6E 61 6D 65 OFB: 68 65 79 20 77 68 61 74 73 20 79 6F 75 72 20 6E 61 6D 65 00 00 00 ----PLAINTEXT---- ECB: hey whats your name OFB: hey whats your name All done
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started