write in python and use the PyCryptodome library for any cryptographic primitives needed two methods   countRepetitions that takes a ciphertext as an argument and returns the total number of repetitions between all 16-byte blocks detectECBMode that takes the following chipertext as input b1f6508b1321e924066febfe8030a908e8086eb5ac423895b74ae91b9cea65e9d4249057b23b970e23f0b87b641b98cbc5fb7438a2844fd949a937f05f7670462266c3927177a2bf3c5873695ba9334c0d57e749e2132df586899c88827cad98efc7c9d74f001f57b31d3826e4448067ff43b2ab045a712372ce8f8a229e845289ecaa2e038eefc9ef4a710509f4ea14e695cf44977cbfbb1a9d806e43fe1af7 determines if any repetitions occur, and returns a Boolean value indicating if the ciphertext was encrypted using ECB mode

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question

write in python and use the PyCryptodome library for any cryptographic primitives needed

two methods 

 countRepetitions that takes a ciphertext as an argument and returns the total number of repetitions between all 16-byte blocks
detectECBMode that takes the following chipertext as input

b1f6508b1321e924066febfe8030a908e8086eb5ac423895b74ae91b9cea65e9d4249057b23b970e23f0b87b641b98cbc5fb7438a2844fd949a937f05f7670462266c3927177a2bf3c5873695ba9334c0d57e749e2132df586899c88827cad98efc7c9d74f001f57b31d3826e4448067ff43b2ab045a712372ce8f8a229e845289ecaa2e038eefc9ef4a710509f4ea14e695cf44977cbfbb1a9d806e43fe1af7

determines if any repetitions occur, and returns a Boolean value indicating if the ciphertext was encrypted using ECB mode

Your code must display the ECB encrypted ciphertext encoded in the hexadecimal format followed by the number of repetitions (in the following line). For example, if you encounter ten blocks with the same ciphertext, then there are nine repetitions of the 1st block so, the number of repetitions is 9.

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Public key encryption
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning