Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. A grayscale image with depth d is a two-dimensional array whose entries are in {0,...,d-1}. For example, the following image T has depth 4.
3. A grayscale image with depth d is a two-dimensional array whose entries are in {0,...,d-1}. For example, the following image T has depth 4. 2 T = 0 0 2 1 0 0 2 3 3 3 2 1 plaintext 0 cyphertext 3 1 1 3 2 C= 3 3 0 1 3 3 0 2 2 2 0 1 0 When the plaintext image T is encrypted with a substitution cypher whose key is displayed in the center table, the result is the cyphertext image C, displayed on the right. The images A.png (depth 32), B.png (depth 64), C.png (depth 128), D.png (depth 256) contain grayscale images that have been encrypted with a simple substitution cypher; the keys are unknown. A.png (32 colors, scaled) B.png (64 colors, scaled) C.png (128 colors, scaled) D.png (256 colors, scaled) (a) Find a formula for the size of the keyspace for a substitution cypher on an image with depth d. If a computer can check 1 million keys per second, how many years would it take to decrypt A.png and D.png? (b) Write some efficient code that breaks this cryptosystem, and use your code to decrypt the given images without knowledge of the key. The python template file im_sub_cypher.py contains some routines used to encrypt, decrypt, and save image files. To use the tem- plate, you will need the common python packages numpy and the Python Image Library. Note: you will probably need to test and debug your code on images that you encrypt and for which you know the encryption key. Hint: when designing your algorithm, exploit that nearby pixels are likely to have similar brightness levels. (c) Describe in English how your algorithm works. (d) Provide your source code. (e) Give the 4 plaintext images that your algorithm produces when running on the given files A.png (depth 32), B.png (depth 64), C.png (depth 128), and D.png (depth 256)
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