请输入您要查询的百科知识:

 

词条 Treyfer
释义

  1. Implementation

  2. See also

  3. References

{{Notability|date=June 2015}}{{refimprove|date=July 2015}}{{Infobox block cipher
| name = Treyfer
| designers = Gideon Yuval
| publish date = 1997
| derived from =
| derived to =
| related to =
| key size = 64 bits
| block size = 64 bits
| structure =
| rounds = 32
| cryptanalysis = A slide attack using 232 known plaintexts and 244 work succeeds for any number of rounds
}}

In cryptography, Treyfer is a block cipher/MAC designed in 1997 by Gideon Yuval. Aimed at smart card applications, the algorithm is extremely simple and compact; it can be implemented in just 29 bytes of 8051 machine code{{citation needed|date=October 2016}}.

Treyfer has a rather small key size and block size of 64 bits each. All operations are byte-oriented, and there is a single 8×8-bit S-box. The S-box is left undefined; the implementation can simply use whatever data is available in memory. 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. The design attempts to compensate for the simplicity of this round transformation by using a large number of rounds: 32.

Due to the simplicity of its key schedule, using the same 8 key bytes in each round, Treyfer was one of the first ciphers shown to be susceptible to a slide attack. This cryptanalysis, which is independent of the number of rounds and the choice of S-box, requires 232 known plaintexts and 244 computation time.

Implementation

A simple implementation of Treyfer can be done as follows:

  1. include
  1. 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 < 8*NUMROUNDS; i++) {        t += key[i%8];        t = Sbox[t] + text[(i+1)%8];        text[(i+1) % 8] = t = (t << 1) | (t >> 7);        /* Rotate left 1 bit */    }

}

See also

  • Tiny Encryption Algorithm

References

  • {{cite paper

| author = David Wagner, Alex Biryukov
| title = Slide Attacks
| year = 1999
| url = http://www.cs.berkeley.edu/~daw/papers/slide-fse99-pre.ps
| format = PostScript
| accessdate = January 25, 2007 }}{{Cryptography navbox | block}}{{crypto-stub}}

1 : Broken block ciphers

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/14 7:36:50