This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| `pip install pycrypto` | |
| from Crypto.Cipher import DES3 | |
| from Crypto import Random | |
| key = 'Sixteen byte key' | |
| iv = Random.new().read(DES3.block_size) #DES3.block_size==8 | |
| cipher_encrypt = DES3.new(key, DES3.MODE_OFB, iv) | |
| plaintext = 'sona si latine loqueri ' #padded with spaces so than len(plaintext) is multiple of 8 | |
| encrypted_text = cipher_encrypt.encrypt(plaintext) |