Question: Task 2 : Limits of confidentiality - In this task, you will explore some of the limits of block ciphers in their use within a
Task : Limits of confidentiality In this task, you will explore some of the limits of block ciphers in their use within a secure system. Based on the PKCS# padding and CBC encryption code from Task write two "oracle" functions that emulate a web server that wants to use cryptography to protect access to a site administration page. First, at the start of your program generate a random AES key and IV which will be used in both functions, keeping it constant for the execution of your program do not generate a new key or IV for every encryption and decryption The first function, called submit should take an arbitrary string provided by the user, and prepend the string:
userid ; userdata
and append the string:
;sessionid
For example, if the user provides the string
You're the man now, dog Use this exact string
submit would create the string:
userid ; userdata You're the man now, dog;sessionid
In addition, submit should: URL encode any ; and characters that appear in the user provided string; pad the final string using PKCS# and encrypt the padded string using the AESCBC you implemented in Task Submit should return the resulting ciphertext.
The second function, called verify should: decrypt the string you may use a AESCBC decrypt library or implement your own CBC decrypt; parse the string for the pattern ;admintrue;" and, return true or false based on whether that string exists. If you've written submit correctly, it should be impossible for a user to provide input to submit that will result in verify returning true.
Now the fun part: use your knowledge of the way CBC mode works to modify the ciphertext returned by submit to get verify to return true. Hint: Flipping one bit in ciphertext block will result in a scrambled plaintext block but will flip the same bit in plaintext block
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
