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
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.
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)