, , , . , Z=EnCrypt(X,Key) X=DeCrypt(Z,Key)
Key . (X) (Z) , , .
, . . , , , . .
.
IDEA | Xuejia Lia and James Massey | 64 | 128 |
CAST128 | 64 | 128 | |
BlowFish | Bruce Schneier | 64 | 128 448 |
*** | 64 | 256 | |
TwoFish | Bruce Schneier | 128 | 128 256 |
MARS | IBM | 128 | 128 1048 |
, , , . 1/2 , N 2N-1 . , . , , 1 1 , 128 1021 . , , , , .
, . , , . , . , , . , .
|
|
, Z=EnCrypt(X,Key) :
- EnCrypt .
- X Z, Key.
- Key X Z, .
, .
, , , , . , , 32- 0..4'294'967'295. , , " ", ( 32- 2 0..65535 4 0..255).
( ):
X'=X+V | ||
X'=X XOR V | ||
2N+1 | X'=(X*V) mod (2N+1) | |
2N | X'=(X*V) mod (2N) | |
X'=X SHL V | ||
X'=X SHR V | ||
X'=X ROL V | ||
X'=X ROR V | ||
S-box (. substitute) | X'=Table[X,V] |
V :
- (, X'=X+125)
- , (, X'=X+F(Key))
- , (, X2'=X2+F(X1))
, (. Feistel).
, V F "-" . (1999 ) . - , , ( ) .
. . , , () . , . X Key.
|
|
( ), , , Vi(Key) , . , . , , . (. caching) . (. key scheduling)
, . , .
, , . . Vi , . F . , , (. round) . K 8 32. , . , , , - , 4-8, . , ( , ) .
, ? , . , F , . , F-1.
.1.
, , . XOR, , , Vi. , . , ( XOR ) , , Vi , .
, . " EnCrypt DeCrypt". , , - , .2, , . 2. , 3. , . , , - ( ) .
|
|
.3.
. , (128 ) 64 . , 32 . 4- . 4. ( ) , "type-2" "type-3". 4 4.
.4.
, . ( whitening) . , " " . , , , 95% F Vi . .
TEA
, TEA (Tiny Encryption Algorithm).
:
64 .
128 .
32 .
F .
- "", .
PASCAL.
type TLong2=array[0.. 1] of longint;
TLong2x2=array[0.. 1] of TLong2;
const Delta=$9E3779B9;
var key:TLong2x2;
procedure EnCryptRouting(var data);
var y,z,sum:longint; a:byte;
begin
y:=TLong2(data)[0];z:=TLong2(data)[1];sum:=0;
for a:=0 to 31 do
begin
inc(sum,Delta);
inc(y,((z shl 4)+key[0,0]) xor (z+sum) xor ((z shr 5)+key[0,1]));
inc(z,((y shl 4)+key[1,0]) xor (y+sum) xor ((y shr 5)+key[1,1]));
end;
TLong2(data)[0]:=y;TLong2(data)[1]:=z
end;
1.
.1.
TEA . , 32- ASSEMBLER . , 32 ( " " - ).
|
|