`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) cipher_decrypt = DES3.new(key, DES3.MODE_OFB, iv) #you can't reuse an object for encrypting or decrypting other data with the same key. cipher_decrypt.decrypt(encrypted_text) cipher_decrypt.decrypt(encrypted_text) #you cant do it twice