Download - Block Cipher Principles
Block Cipher Principles
Stream Ciphers and Block Ciphers stream cipher
A symmetric encryption algorithm in which ciphertext output is produced bit-by-bit or byte-by-byte from a stream of plaintext input.
block cipher A symmetric encryption algorithm in which
a block of plaintext bits (typically 64 or 128) is transformed as a whole into a ciphertext block of the same length.
Stream cipher
เป็�นวิ�ธี�การเข้ ารหั�สที่��ละตั�วิ
EncryptionThis is a Message
EWRKLIH……..
Key
Stream cipher
ข้ อดี�ข้อง stream cipher ควิามเร�วิในการเข้ ารหั�สและถอดีรหั�ส ควิามผิ�ดีพลาดีตั!�า
ข้ อเส�ยข้อง stream cipher เก�ดีการซ้ำ!$าก�นข้องตั�วิอ�กษร ง&ายตั&อการวิ�เคราะหั' ง&ายตั&อการเป็ล��ยนแป็ลงแก ไข้ข้ อม)ล เช่&นจำ!านวิน
เง�น
Block cipher
เป็�นการเข้ ารหั�สแบบกล-&ม ที่!าการแบ&งข้ อม)ลออกเป็�น block แล วิน!าไป็เข้ ารหั�ส
Encryption
This is a Message
EWRKLIH……..
Key
This isa Mesage
Block cipher
ข้ อดี�ข้อง Block cipher การกระจำายควิามซ้ำ!$าก�นข้องตั�วิอ�กษร ตั&อตั านการดี�ดีแป็ลงตั&อเตั�มข้ อม)ลใดี
ข้ อเส�ยข้อง Block cipher ใช่ เวิลาในการเข้ ารหั�สนานกวิ&า ม�การเก�ดีควิามผิ�ดีพลาดีตั&อเน.�อง
Characteristics of good Cipher
ควิามป็ลอดีภั�ยข้องการเข้ ารหั�สแป็รผิ�นตัรงก�บควิามยากข้องการเข้ ารหั�ส
ไม&ควิรม�ข้ อจำ!าก�ดีข้องการเล.อกใช่ ก-ญแจำเข้ ารหั�ส
กระบวินการน!าวิ�ธี�การเข้ ารหั�สไป็ใช่ ตั องสะดีวิกและง&าย
ควิามผิ�ดีพลาดีที่��จำ-ดีใดีจำ-ดีหัน1�งตั องไม&ข้ยายไป็ส)&ส&วินอ.�นๆ
Cipher text ตั องม�ข้นาดีไม&ใหัญ&กวิ&าPlaintext
Secret key Encryption
การเข้ ารหั�สที่��ใช่ ก-ญแจำเข้ ารหั�สและก-ญแจำถอดีรหั�สตั�วิเดี�ยวิก�น
EncryptionPlaintext Ciphertext
KeyA
DecryptionPlaintext
KeyB
KeyA=KeyB
Secret key Encryption
DES(Data Encryption Standard) เข้ ารหั�สแบบ Block Cipher พ�ฒนาโดีย US Federa Standard Key size >58 Bit ควิามเร�วิในการเข้ าและถอดีรหั�ส
Secret key Encryption
Triple DES พ�ฒนาตั&อจำาก DES ม�ควิามป็ลอดีภั�ยมากกวิ&า DES Key ข้นาดีมากกวิ&า DES
AES(Advanced Encryption Standard) ม�ควิามป็ลอดีภั�ยในการเข้ าและถอดีรหั�สมากกวิ&า
DES
Secret key Encryption
ข้ อดี�ข้อง Secret key การเข้ ารหั�สและถอดีรหั�สที่!าไดี เร�วิ วิ�ธี�การพ�ฒนาการเข้ ารหั�สและถอดีรหั�สที่!าใหั ง&าย
ข้ อเส�ยข้อง Secret key การกระจำายก-ญแจำที่!าไดี ยาก ม�โอกาสที่��จำะถ)กข้โมยก-ญแจำในการข้�$นตัอนการส&งก-ญแจำ
Public key Encryption
การเข้ ารหั�สที่��ใช่ ก-ญแจำเข้ ารหั�สและก-ญแจำถอดีรหั�สคนละตั�วิเดี�ยวิก�น
EncryptionPlaintext Ciphertext
KeyA
DecryptionPlaintext
KeyB
KeyA<>KeyB
Public key Encryption
RSA พ�ฒนาโดีย Rivest,Shamir,Adleman Key>1028 Bit ก-ญแจำเข้ ารหั�สและถอดีรหั�สคนละตั�วิ
Public key Encryption
ข้ อดี�ข้อง Public key การกระจำายก-ญแจำที่!าไดี ง&าย การข้โมยก-ญแจำในการข้�$นตัอนการส&งก-ญแจำไม&ม�ผิลตั&อการถอดีรหั�ส
ข้ อเส�ยข้อง Public key การเข้ ารหั�สและถอดีรหั�สที่!าไดี ช่ า ไม&เหัมาะในการเข้ ารหั�สที่��ม�ข้ อม)ลที่��ม�ข้นาดีใหัญ&
DES(Data Encryption Standard)
DES เบ.$องตั น
P10
ShiftIP
fK
SW
fk
IP-1
IP-1
fk
SW
fK
IP
P8
Shift
P8
8 bit plaintext 8 bit plaintext
8 bit ciphertext 8 bit ciphertext
10 bit key
DES เบ.$องตั น S-DES Key Generation ป็ระกอบดี วิย
P10 Shift P8
DES เบ.$องตั น P10(Permutation)
ที่!าหัน าที่�� สล�บและเป็ล��ยนตั!าแหัน&งบ�ที่ P10(k1,k2,k3,k4,k5,k6,k7,k8,k9,k10)=(k3,k5,k2,k7,k4,k10,k1,k9,k
8,k6)
P10
3 5 2 7 4 10 1 9 8 6
1101101001 P10 0111111000
DES เบ.$องตั น Shift ที่!าการเล.�อนบ�ที่ไป็ที่างซ้ำ าย
LeftShift 1 LeftShift 1
5 bit 5 bit
5 bit 5 bit
10000 01100 LeftShift 00001 11000
DES เบ.$องตั น P8(Permutation) ที่!าหัน าที่�� สล�บและเป็ล��ยนตั!าแหัน&งบ�ที่
และลดีข้นาดีข้อง บ�ที่ ลงเหัล.อ 8 บ�ที่P8
6 3 7 4 8 5 10 9
00100 00011 P8 01000011
• The Function fK
fK(L,R)=(LF(R,SK),R)
E/P(Expansion/permutation) ที่!าหัน าที่�� ข้ยายบ�ที่และสล�บตั!าแหัน&งบ�ที่ใหัม&
E/P
4 1 2 3 2 3 4 1
1001E/P 11000011
S-box ลดีข้นาดีบ�ที่ x x x x P0 P1 P2 P3 0111 P0=0,P1=1,P2=1,P3=1
S-box
0 1 2 3
0 1 0 3 21 3 2 1 02 0 2 1 33 3 1 3 2
P0,3
P1,2 0 1 2 3
0 0 1 2 31 2 0 1 32 3 0 1 03 2 1 0 3
P0,3
P1,2
S0= S1=
0100 S0 11
P4(Permutation) ที่!าหัน าที่�� สล�บและเป็ล��ยนตั!าแหัน&งบ�ที่
P4
2 4 3 1
1001P4 0101
The switch Function ที่!าหัน าที่��สล�บ 4Bit บน ก�บ 4 Bit ล&าง
10010110 switch 01101001
IP(Initial Permutation) เป็�นการเอาข้ อม)ลมาสล�บบ�ที่ก&อน IP(x)
IP
2 6 3 1 4 8 5 7
00110011 IP 00101101
IP-1 (Inverse Permutation) สล�บบ�ที่ข้ อม)ลกล�บ IP-1(IP(X))=X
IP-1
4 1 3 5 7 2 8 6
01100110IP-100101101
General n-bit-n-bit Block Substitution (shown with n = 4)
Plaintext Ciphertext0000 11100001 01000010 11010011 00010100 00100101 11110110 10110111 10001000 00111001 10101010 01101011 11001100 01011101 10011110 00001111 0111
The Data Encryption Standard
DES Encryption
DES Encryption
Single Round of DES Algorithm
Permutation Tables for DES
Calculation of F(R, K)
โดียการสล�บ และแป็ลงข้ อม)ล 6 บ�ที่เหัล.อ 4 บ�ที่
S
1 2 3 4 5 6
Bit 1,6 เล.อก RowBit 2,3,4,5 เล.อก Column
ข้ อม)ล 110010 เข้ า S1 10 = Row 2 1001=Column 9 เป็5ดีตัาราง S1
110010 S1 1100 (12)
แป็ลง key 64 Bit เป็�นข้นาดี 56 Bit
แป็ลง key 56 Bit เป็�นข้นาดี 48 Bit
brute-force attack ค นหัา key