CryptoGear encryption algorithm
the size of plain-text and cipher-text will be always the same, and doesn’t need to be a multiple of the block size.
- GUI application (in Delphi) for file encryption/decryption
- Command-Line application (in C++) for file encryption/decryption
- C++ implementation
- Delphi implementation
You can imagine CryptoGear mechanism like a rotating bycicle gear:
- The circular gear is the keystream,
- The chain that slides though the gear is the data to be crypted.
Each gear cog and chain ring rapresents a byte.
So we have a circular gear with 256 teeth (keystream size is 256 bytes),
and a chain of data of any possible length.
- When initializing cipher, a unique keystream is generated, based on provided key and initialization vector.
- Each time a gear cog passes on the data, data gets changed.
- In CBC mode, the corresponding byte of the keystream gets changed as well each time it encrypts a byte.
This way, on each round the gear (keystream) will be different from the previous one, and will crypt the block in a different way (even if block data is identical to the one of previous round).
In addition to this, in CBC mode each block is xored with the previous block.