fork download
  1. from Crypto.Cipher import DES3
  2. des = DES3.new('01234567', DES3.MODE_ECB)
  3. text = 'abcdefgh'
  4. cipher_text = des.encrypt(text)
  5. print (cipher_text)
  6. des.decrypt(cipher_text)
  7.  
Runtime error #stdin #stdout #stderr 0.12s 23936KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 2, in <module>
  File "/usr/lib/python3/dist-packages/Crypto/Cipher/DES3.py", line 113, in new
    return DES3Cipher(key, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/Crypto/Cipher/DES3.py", line 76, in __init__
    blockalgo.BlockAlgo.__init__(self, _DES3, key, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/Crypto/Cipher/blockalgo.py", line 141, in __init__
    self._cipher = factory.new(key, *args, **kwargs)
ValueError: Invalid key size (must be either 16 or 24 bytes long)