This project generates Rijndael variants as described in "Diversity Within the Rijndael Design Principles for Resistance to Differential Power Analysis." This is for demonstration purposes only and does not address timing side channels.
It runs inside the SageMath environment:
W. Stein et al., Sage Mathematics Software (Version 6.2), The Sage Development Team, 2015, http://www.sagemath.org.
A single text block can be encrypted or decrypted with a new variant.
The code generalizes the steps of a round as follows:
Generalization | Testing | |
1. SubBytes | sub_bytes.sage | test_sub_bytes.sage |
2. ShiftRows | shift_rows.sage | test_shift_rows.sage |
3. MixColumns | mix_columns.sage | test_mix_columns.sage |
4. AddRoundKey | key.sage | test_key_expansion.sage |
Encrypt block | encrypt.sage | test_encryption.sage |
Documentation is included through pydoc in html files corresponding to each sage file.
In the same directory as the above files, verify that all tests pass.
sage: load("test_util.sage")
sage: test_all()
---Testing AES sub_bytes---
Matching against AES SubBytes passed...
Generate a SubBytes variant and measure its properties (outputs will vary).
sage: load("example.sage")
sage: example_sub_bytes()
SubBytes: [6, 67, 118, 87, 75, 205, 39, 111, 174, 142, 236,...
Free of fixed points: False
Maximal linear bias: 16
Maximal difference probability: 4
Please cite this code as the following publication:
Spain, M., Varia, M.: Diversity Within the Rijndael Design Principles for Resistance to Differential Power Analysis. In: International Conference on Cryptology and Network Security. Springer (2016)
Copyright 2016 Massachusetts Institute of Technology
Project: CryptoSynth
Author: Merrielle Spain
This software is distributed by open source pursuant to the GNU General Public License ("GPLv2") Version 2 authored by the Free Software Foundation (available at http://www.fsf.org).
The software/firmware is provided to you on an As-Is basis
This material is based upon work supported by the Department of the Navy under Air Force Contract No. FA8721-05-C-0002 and/or FA8702-15-D-0001. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Department of the Navy.