Treyfer
In cryptography, Treyfer is a block cipher/MAC designed in 1997 by Gideon Yuval.[src] Aimed at smart card applications, the algorithm is extremely simple and compact; it can be implemented in just 29 bytes of 8051 machine code.[src] Treyfer has a rather small key size and block size of 64 bits each.[src] All operations are byte-oriented, and there is a single 8×8-bit S-box.[src] The S-box is left undefined; the implementation can simply use whatever data is available in memory.[src] In each round, each byte has added to it the S-box value of the sum of a key byte and the previous data byte, then it is rotated left one bit.[src] The design attempts to compensate for the simplicity of this round transformation by using 32 rounds.[src] Due to the simplicity of its key schedule, using the same eight key bytes in each round, Treyfer was one of the first ciphers shown to be susceptible to a slide attack.[src] This cryptanalysis, which is independent of the number of rounds and the choice of S-box, requires 2 32 known plaintexts and 2 44 computation time.[src] After Alex Biryukov broke it, it gave way to the Parve cipher (same author)[src]
In cryptography, Treyfer is a block cipher/MAC designed in 1997 by Gideon Yuval.[src] Aimed at smart card applications, the algorithm is extremely simple and compact; it can be implemented in just 29 bytes of 8051 machine code.[src] Treyfer has a rather small key size and block size of 64 bits each.[src] All operations are byte-oriented, and there is a single 8×8-bit S-box.[src] The S-box is left undefined; the implementation can simply use whatever data is available in memory.[src] In each round, each byte has added to it the S-box value of the sum of a key byte and the previous data byte, then it is rotated left one bit.[src] The design attempts to compensate for the simplicity of this round transformation by using 32 rounds.[src] Due to the simplicity of its key schedule, using the same eight key bytes in each round, Treyfer was one of the first ciphers shown to be susceptible to a slide attack.[src] This cryptanalysis, which is independent of the number of rounds and the choice of S-box, requires 2 32 known plaintexts and 2 44 computation time.[src] After Alex Biryukov broke it, it gave way to the Parve cipher (same author) ==Implementation== A simple implementation of Treyfer can be done as follows include define NUMROUNDS 32 extern uint8_t const sbox[256]; void treyfer_encrypt(uint8_t * text[8], uint8_t const key[8]) { unsigned i; uint8_t t = *text[0]; for (i = 0; i > 7); /* Rotate left 1 bit */ *text[(i + 1) % 8] = t; } } void encrypt(uint8_t * text[8], uint8_t const key[8]) { unsigned int i = 0; unsigned int j = 0; uint8_t t = 0; t = text[0]; for (j = 0; j > 7); *text[(i + 1) % 8] = t; } } } void decrypt(uint8_t *text[8], uint8_t const key[8]) { int i = 0; int j = 0; uint8_t top = 0; uint8_t bottom = 0; for (j = 0; j = 0; i--) { top = *text[i] + key[i]; top = sbox[top]; bottom = *text[(i + 1) % 8]; bottom = (bottom >> 1) | (bottom ==See also== Tiny Encryption Algorithm ==References==[src]
20 sentences · 20 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Treyfer." encyclopegia.org, 2026, https://encyclopegia.org/wiki/treyfer. Accessed 02 December 2026.
Chicago
"Treyfer." encyclopegia.org. Accessed December 2, 2026. https://encyclopegia.org/wiki/treyfer.
APA
encyclopegia.org. (2026). Treyfer. Retrieved December 2, 2026, from https://encyclopegia.org/wiki/treyfer
Accessed December 2, 2026 · CC BY-SA 4.0 · citation page · JSON