SourceForge.net Logo A l ge b rai c   To y   C iph e r Support This Project


v 0.5.0
https://sourceforge.net/projects/atcipher



The Algebraic Toy Cipher was developed to be used in the research of algebraic cryptanalysis of block ciphers. It was developed to be used with Macaulay2.

This toy cipher works presently with only one block of plaintext, and that is one of the reasons for calling it a "toy cipher".

Our toy is scalable in the number of bits of the plaintext, and so in the number of bits of the key, and in the number of rounds. The number of bits must be a multiple of the number of bits of the s-box, that is dependent of the field chosed to be the s-box field. Based on this s-box field and in the number of s-boxes you must choose the mixing layer field.

The s-box is an invertion over the s-box field. The field chosen must be in the style GF(2)/P, being P a polynomial field.

The mixing layer is a linear transformation over the mixing layer field. The field chosen must be in the style GF(2)/P, being P a polynomial field.

To show the key idea of the toy cipher we will present an example of the ATC for a 9 bit block cipher  with 3 s-boxes with 3 bits, being the s-box an invertion over any 3 bits field GF(2)/P, and the mixing layer an invertion over  any 9 bits GF(2)/P. The fields and the mixing layer linear operation must be chosen by the user.

Consider the key format:



Example: K = {{3},{4},{1}} = {{x+1},{x^2},{1}}

The sub-key Generation works just shifting bits as demonstrated below (but that it is not a regular shift):




Consider that every group k1,k2,k3 is a different sub-key.



For the encryption case the cipher copies the state "d" to the state "a" N-1 Rounds.
For the decryption case the cipher copies the state "a" to the state "d" N-1 Rounds.

The script presents examples of use of the cipher when it is loaded on Macaulay2.