Skip to content

tiran/militarygrade

Repository files navigation

Military grade bad crypto demos

ECB mode

ECB mode

CTR and GCM mode with IV reuse (nonce misuse)

The start value / IV for streaming modes like AES-CTR and AES-GCM must be a nonce (number only used once). When the combination of encryption key and IV is ever used twice, then the encryption can be reversed by simply applying XOR. The image shows encrypted_image1 XOR encrypted_image2. The output of encrypted_image1 XOR encrypted_image2 XOR original_image1 is original_image2.

CTR mode

Original images

AES encryption added and removed here

tux

Note

Some examples are double-plus bad because they also utilize PyCrypto. Friends don't let friends use PyCrypto. Please use https://github.com/pyca/cryptography

About

Military grade bad crypto

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages