Académique Documents
Professionnel Documents
Culture Documents
Cryptography
Block Ciphers
Secret key
Background
The Data Encryption Standard (DES) is a block cipher that uses shared secret encryption. It was selected by the National Bureau of Standards as an official Federal Information Processing Standard (FIPS) for the United States in 1976 Has subsequently enjoyed widespread use internationally. The algorithm was initially controversial because of classified design elements DES consequently came under intense academic analysis which motivated the modern understanding of block ciphers and their cryptanalysis.
Shortfalls
DES is now considered to be insecure for many applications. Chiefly due to the 56-bit key size being too small. The basic method of attack is brute force trying every possible key in turn. The length of the key determines the number of possible keys. DES has a small key size 56-bits and this approach is feasible for breaking it Questions were raised about the adequacy of DES key size even before it was adopted as a standard, and it was the small key size, rather than theoretical cryptanalysis, which dictated a need for a replacement algorithm
It is a block Cipher
plain Text 64 bit blocks N Blocks Cipher Encryption Algorithm 16 cycles Cipher Text 64 bit blocks N Blocks
56 bits used
Encryption Algorithm
32bit
32bit
Data is processed as 32 bit half-blocks Takes 16 rounds to complete In each round, a new subkey from the key scheduler is utilized Data is swapped after each round except the last Initial and final permutations are Inverses of each other
XOR
Structure
Main {
Initial
Permutation ( ) Left , Right Breaking ( ) Main algorithm 16 cycles ( ) Left Right re-combination( ) Final Permutation ( )
cnv ( ) cnv4( )
Structure
Main
B=P1(A); [l,r]=LR(B);
Script file
A=round(rand(1,64))
32 elements
32 elements
[l,r]= mnalgo(l,r);
16 cycles
C=LRbk(l,r); D=P2(C)
a original array
58
64
58
b shifting / swapping
for i= 1:8,
L swap l r
L=xor(L,R);
end
cnt %counter display
1.64
left 1.32
right 33..64
Feistel function
Expansion 48 bit data XOR The S-Boxes Non Linear Transformation 4-bit output Enables Swap 6-bit input
4 5 6 7 8 9;
8 9 10 11 12 13; 12 13 14 15 16 17; 16 17 18 19 20 21; 20 21 22 23 24 25;
Expansion Table
24 25 26 27 28 29;
26 29 30 31 32 1;]; l=1; %extra variable %rows %columns for j= 1:6, for i= 1:8,
32
32
Expanded array
XOR
48
S-Box Compression
function
[b]= S(a) % where a is a 48 element binary array
t=[14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7;
0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8; 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0; 15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 14]; %S-box Table
S-Box Compression
6bit 6bit 6bit temp cnv( ) cnv4( ) Binary to decimal 1001 9 Decimal to Binary 4bit 32 bit 6bit 48 bit
011011 01
1101
Outer bits
01
10 11
1110 1011 0010 1100 0100 0111 1101 0001 0101 0000 1111 1010 0011 1001 1000 0110
0100 0010 0001 1011 1010 1101 0111 1000 1111 1001 1100 0101 0110 0011 0000 1110 1011 1000 1100 0111 0001 1110 0010 1101 0110 1111 0000 1001 1010 0100 0101 0011
Input: 011011
Output: 1001
l i 6 bit
ref (rw,col)
end
P-Box permutation
%P-Box permutation
P=[16 7 20 21 29 12 28 17 1 15 23 26 5 18 31 10; 2 8 24 14 32 27 3 9 19 13 30 6 22 11 4 25]; % P-box table l=1; % extra counter %rows %columns % extra counter increment for j= 1:16, l=l+1; end end for i= 1:2,
32 bit Array
58
50
42
34
26
18
10
if ip(i,j) = = x;
iprev(1,c) =l;
c=c+1;
else
;
end
l=l+1; end end end
iprev
%iprev
for j= 1:64, %coloumns % extra counter increment
end
1 1
c=0000 0010
0011
int2str( ) 0011 bin2dec ( ) 3
Encryption
Cipher Encryption Algorithm 16 cycles
56 bits used
Thank You
Questions are Welcome