This repository contains a reference implementation of the proof-of-concept block cipher, ZUGZWANG (concrete instance/encryption). The cipher is basically a four-round Feistel construction, but has an innate backdoor. The key is revealed through the ciphertext when the plaintext matches a backdoor entry (which is known only to the cipher designer), otherwise the cipher is secure. See this paper on ePrint for its specification and other information.
- Python 3
- Pycryptodome
Case | 1 |
---|---|
Key | 10000000000000000000000000000000 |
Backdoor Entry | 10000000000000000000000000000000 |
Plaintext | 10000000000000000000000000000000 |
Ciphertext | 10000000000000001000000000000000 |
Recovered Key | 10000000000000000000000000000000 |
Case | 2 |
---|---|
Key | 10000000000000000000000000000000 |
Backdoor Entry | 10000000000000000000000000000000 |
Plaintext | 00000000000000000000000000000001 |
Ciphertext | 77882970d3ee73581cce9b1ae1e66cbd |
Case | 3 |
---|---|
Key | 10000000000000000000000000000000 |
Backdoor Entry | 10000000000000000000000000000000 |
Plaintext | f0000000000000000000000000000000 |
Ciphertext | d5c03bdfec4e0fcf853645f83c6d74ef |
Case | 4 |
---|---|
Key | 10000000000000000000000000000000 |
Backdoor Entry | 0000000000000000000000000000000f |
Plaintext | 0000000000000000000000000000000f |
Ciphertext | 100000000000000f0000000000000000 |
Recovered Key | 10000000000000000000000000000000 |
Case | 5 |
---|---|
Key | 10000000000000000000000000000000 |
Backdoor Entry | 10000000000000000000000000000000 |
Plaintext | 0000000000000000000000000000000f |
Ciphertext | 81cca7e35cf90690105da7090fbb253d |
Case | 6 |
---|---|
Key | f1000000000000000000000000000000 |
Backdoor Entry | 1000000000000000000000000000000f |
Plaintext | 0000000000000000000000000000000f |
Ciphertext | d69db61c7ef55b8d4e0b7e87b18ee158 |
Case | 7 |
---|---|
Key | 3cf28000471a74d22d81b6c98a3dbe33 |
Backdoor Entry | 1831bcaa5bee08e639864e4823183090 |
Plaintext | 1831bcaa5bee08e639864e4823183090 |
Ciphertext | 0574ce486402444235b00a63d1d3b6d5 |
Recovered Key | 3cf28000471a74d22d81b6c98a3dbe33 |
Case | 8 |
---|---|
Key | 3cf28000471a74d22d81b6c98a3dbe33 |
Backdoor Entry | 1831bcaa5bee08e639864e4823183090 |
Plaintext | 9eac455e039a58928e163658e1493a20 |
Ciphertext | 7a7700e9f5f4f974e9ba2834160cf284 |
Note | This test case is currently hardcoded |