A python module for adding custom ciphers to
In GSMK's software, as a way of future proofing our ciphers, we XOR the result of two ciphers togehter:
Tandem(x) = AES(x) ^ Twofish(x)
Where AES and Twofish are each initialized with a different key.
Now I wanted to use the PyCrypto library as a basis for implementing some of our algorithms.
Tandem cipher is not something supported by
PyCrypto, i would need to add my own
cipher, with a interface compatible with
The problem i found is that in order to use the more complex ciphering modes found in pyCrypto
you need to provide PyCrypto with a cipher which already supports several of the more basic ciphering
The advanced modes implemented in
Crypto/Cipher/blockalgo.py are these:
These are building upon the simple modes implemented by
MODE_PGP ( no longer supported by PyCrypto )
So i wrote a base class which adds the simple modes to a cipher providing only the
The module can be found at: https://github.com/nlitsme/pyCryptoAdapter.
Now testing involves comparing the results of the wrapper objects against the original AES with
This is done in