I need the code in python where I can encrypt and decrypt any
plaintext. For example, the plaintext "hello" from each of these
Block Cipher modes of Operation.
Electronic Code Block Mode (ECB)
Cipher block Mode (CBC)
Cipher Feedback Mode (CFB)
Output feedback Mode (OFB)
Counter Mode (CTR)
Here is an example, Affine cipher expressed in C.
Encryption:
char cipher(unsigned char block, char key) {
return (key+11*block) }
Decryption:
char invcipher(unsigned char block, char key) {
return (163*(block-key+256)) }