5. อัลกอริทึมมาตรฐานสาหรับการเข้ารหัส
อัลกอริทึม DES (Data Encryption Standard)
‣ Key size 56 bits
อัลกอริทึม 3-DES (Triple-DES)
‣ Key size 112 bits
อัลกอริทึม IDEA (International Data Encryption Algorithm)
‣ Key size 128 bits
อัลกอริทึม AES (Advanced Encryption Standard)
‣ Key size 128, 192, 256 bits
Faculty of Information Technology
Page
5
6. DES Algorithm
DES ย่อมาจาก Data Encryption Standard เป็ นการเข้ารหัส แบบบล็ อค
(Block cipher) ที่พฒนามาจากอัลกอริทึม Lucifer ของ IBM โดย
ั
Lucifer ได้รบการพัฒนาเพิ่มความสามารถและเปลี่ยนชื่อเป็ น DES แล้ว
ั
ได้รบการนาเสนอต่อ US NIST (US National Institute of Standards
ั
and Technology) ให้กลายเป็ นมาตรฐานการเข้ารหัส
DES เป็ นอัลกอริทึมแบบบล็ อก (Block Cipher) ใช้ Key ขนาดความยาว
56 bits ดาเนิ นการบนบล็ อคข้อมูล (Data Block) ขนาด 64 bits
Faculty of Information Technology
Page
6
7. DES Overview
64-bit Plaintext
…
64-bit Key
Initial Permutation
PC1
64 bit
Round 0
64 bit
Round 1
…
K1
48 bit
K2
48 bit
56 bit
PC2
PC2
Left Circular Shift
56 bit
64 bit
Round 15
56-bit Key
56-bit Key
Left Circular Shift
56-bit Key
K16
48 bit
PC2
56 bit
Left Circular Shift
64 bit
32-bit Swap
64 bit
Inverse Initial Permutation
…
64-bit Ciphertext
Faculty of Information Technology
Page
7
8. DES Overview
ขันตอนการทางานของ DES Algorithm บน Data Block โดยสังเขป
้
1) Data Block ขนาด 64 bits จะถูกสลับตาแหน่ ง (สลับบิต)เรียกขันตอนนี้ ว่า
้
Initial Permutation (IP)
2) Data Block ถูกดาเนิ นการอีก 16 รอบ แต่ละรอบมีการแทนที่บิต
(substitution) และการสลับบิต (permutation) โดยใช้ key ขนาด 48 bits
3) Data Block ถูกสลับครึ่งแรกของบล็อคกับครึ่งหลังของบล็ อค
4) Data Block ถูกสลับบิตแบบกลับทิศทางกับขันตอนแรก เรียกว่า Inverse
้
Initial Permutation
ขันตอนการทางานของ DES Algorithm บน Key Block โดยสังเขป
้
a) Key Block ขนาด 64 bits จะถูกสลับบิตเรียกขันตอนนี้ ว่า Permutation
้
Choice 1 (PC1) โดยเลือก 56 bits ออกมาจาก 64 bits แล้วแบ่งครึ่งเป็ น
ครึ่งละ 28 bits
b) Key Block ถูกดาเนิ นการอีก 16 รอบ แต่ละรอบมีการวนบิตไปทางซ้ายแบบ
เป็ นวงกลม (Left Circular Shift) และการสลับบิต (permutation) เพื่อสร้าง
key ขนาด 48 bits สาหรับการดาเนิ นการบน Data Block ขัน 2)
้
Faculty of Information Technology
Page
8
9. รอบการทางานบน Data Block
การดาเนิ นงานบน Data Block แต่ละรอบใน 16 รอบ เป็ นดังนี้
64-bit
Round 0
L0 (32 bits)
R0 (32 bits)
f
K1
XOR
Round 1
L1=R0
R1=(L0 XOR f(R0,K1))
f
K2
XOR
L2=R3
Faculty of Information Technology
R2=(L1 XOR f(R1,K2))
Page
9