block cipher principles

44
Block Cipher Principles [email protected]

Upload: teryl

Post on 09-Jan-2016

93 views

Category:

Documents


2 download

DESCRIPTION

[email protected]. 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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Block Cipher Principles

Block Cipher Principles

[email protected]

Page 2: 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.

Page 3: Block Cipher Principles

Stream cipher

เป็�นวิ�ธี�การเข้ ารหั�สที่��ละตั�วิ

EncryptionThis is a Message

EWRKLIH……..

Key

Page 4: Block Cipher Principles

Stream cipher

ข้ อดี�ข้อง stream cipher ควิามเร�วิในการเข้ ารหั�สและถอดีรหั�ส ควิามผิ�ดีพลาดีตั!�า

ข้ อเส�ยข้อง stream cipher เก�ดีการซ้ำ!$าก�นข้องตั�วิอ�กษร ง&ายตั&อการวิ�เคราะหั' ง&ายตั&อการเป็ล��ยนแป็ลงแก ไข้ข้ อม)ล เช่&นจำ!านวิน

เง�น

Page 5: Block Cipher Principles

Block cipher

เป็�นการเข้ ารหั�สแบบกล-&ม ที่!าการแบ&งข้ อม)ลออกเป็�น block แล วิน!าไป็เข้ ารหั�ส

Encryption

This is a Message

EWRKLIH……..

Key

This isa Mesage

Page 6: Block Cipher Principles

Block cipher

ข้ อดี�ข้อง Block cipher การกระจำายควิามซ้ำ!$าก�นข้องตั�วิอ�กษร ตั&อตั านการดี�ดีแป็ลงตั&อเตั�มข้ อม)ลใดี

ข้ อเส�ยข้อง Block cipher ใช่ เวิลาในการเข้ ารหั�สนานกวิ&า ม�การเก�ดีควิามผิ�ดีพลาดีตั&อเน.�อง

Page 7: Block Cipher Principles

Characteristics of good Cipher

ควิามป็ลอดีภั�ยข้องการเข้ ารหั�สแป็รผิ�นตัรงก�บควิามยากข้องการเข้ ารหั�ส

ไม&ควิรม�ข้ อจำ!าก�ดีข้องการเล.อกใช่ ก-ญแจำเข้ ารหั�ส

กระบวินการน!าวิ�ธี�การเข้ ารหั�สไป็ใช่ ตั องสะดีวิกและง&าย

ควิามผิ�ดีพลาดีที่��จำ-ดีใดีจำ-ดีหัน1�งตั องไม&ข้ยายไป็ส)&ส&วินอ.�นๆ

Cipher text ตั องม�ข้นาดีไม&ใหัญ&กวิ&าPlaintext

Page 8: Block Cipher Principles

Secret key Encryption

การเข้ ารหั�สที่��ใช่ ก-ญแจำเข้ ารหั�สและก-ญแจำถอดีรหั�สตั�วิเดี�ยวิก�น

EncryptionPlaintext Ciphertext

KeyA

DecryptionPlaintext

KeyB

KeyA=KeyB

Page 9: Block Cipher Principles

Secret key Encryption

DES(Data Encryption Standard) เข้ ารหั�สแบบ Block Cipher พ�ฒนาโดีย US Federa Standard Key size >58 Bit ควิามเร�วิในการเข้ าและถอดีรหั�ส

Page 10: Block Cipher Principles

Secret key Encryption

Triple DES พ�ฒนาตั&อจำาก DES ม�ควิามป็ลอดีภั�ยมากกวิ&า DES Key ข้นาดีมากกวิ&า DES

AES(Advanced Encryption Standard) ม�ควิามป็ลอดีภั�ยในการเข้ าและถอดีรหั�สมากกวิ&า

DES

Page 11: Block Cipher Principles

Secret key Encryption

ข้ อดี�ข้อง Secret key การเข้ ารหั�สและถอดีรหั�สที่!าไดี เร�วิ วิ�ธี�การพ�ฒนาการเข้ ารหั�สและถอดีรหั�สที่!าใหั ง&าย

ข้ อเส�ยข้อง Secret key การกระจำายก-ญแจำที่!าไดี ยาก ม�โอกาสที่��จำะถ)กข้โมยก-ญแจำในการข้�$นตัอนการส&งก-ญแจำ

Page 12: Block Cipher Principles

Public key Encryption

การเข้ ารหั�สที่��ใช่ ก-ญแจำเข้ ารหั�สและก-ญแจำถอดีรหั�สคนละตั�วิเดี�ยวิก�น

EncryptionPlaintext Ciphertext

KeyA

DecryptionPlaintext

KeyB

KeyA<>KeyB

Page 13: Block Cipher Principles

Public key Encryption

RSA พ�ฒนาโดีย Rivest,Shamir,Adleman Key>1028 Bit ก-ญแจำเข้ ารหั�สและถอดีรหั�สคนละตั�วิ

Page 14: Block Cipher Principles

Public key Encryption

ข้ อดี�ข้อง Public key การกระจำายก-ญแจำที่!าไดี ง&าย การข้โมยก-ญแจำในการข้�$นตัอนการส&งก-ญแจำไม&ม�ผิลตั&อการถอดีรหั�ส

ข้ อเส�ยข้อง Public key การเข้ ารหั�สและถอดีรหั�สที่!าไดี ช่ า ไม&เหัมาะในการเข้ ารหั�สที่��ม�ข้ อม)ลที่��ม�ข้นาดีใหัญ&

Page 15: Block Cipher Principles

DES(Data Encryption Standard)

Page 16: Block Cipher Principles

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

Page 17: Block Cipher Principles

DES เบ.$องตั น S-DES Key Generation ป็ระกอบดี วิย

P10 Shift P8

Page 18: Block Cipher Principles

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

Page 19: Block Cipher Principles

DES เบ.$องตั น Shift ที่!าการเล.�อนบ�ที่ไป็ที่างซ้ำ าย

LeftShift 1 LeftShift 1

5 bit 5 bit

5 bit 5 bit

10000 01100 LeftShift 00001 11000

Page 20: Block Cipher Principles

DES เบ.$องตั น P8(Permutation) ที่!าหัน าที่�� สล�บและเป็ล��ยนตั!าแหัน&งบ�ที่

และลดีข้นาดีข้อง บ�ที่ ลงเหัล.อ 8 บ�ที่P8

6 3 7 4 8 5 10 9

00100 00011 P8 01000011

Page 21: Block Cipher Principles

• The Function fK

fK(L,R)=(LF(R,SK),R)

Page 22: Block Cipher Principles

E/P(Expansion/permutation) ที่!าหัน าที่�� ข้ยายบ�ที่และสล�บตั!าแหัน&งบ�ที่ใหัม&

E/P

4 1 2 3 2 3 4 1

1001E/P 11000011

Page 23: Block Cipher Principles

S-box ลดีข้นาดีบ�ที่ x x x x P0 P1 P2 P3 0111 P0=0,P1=1,P2=1,P3=1

Page 24: Block Cipher Principles

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

Page 25: Block Cipher Principles

P4(Permutation) ที่!าหัน าที่�� สล�บและเป็ล��ยนตั!าแหัน&งบ�ที่

P4

2 4 3 1

1001P4 0101

Page 26: Block Cipher Principles

The switch Function ที่!าหัน าที่��สล�บ 4Bit บน ก�บ 4 Bit ล&าง

10010110 switch 01101001

Page 27: Block Cipher Principles

IP(Initial Permutation) เป็�นการเอาข้ อม)ลมาสล�บบ�ที่ก&อน IP(x)

IP

2 6 3 1 4 8 5 7

00110011 IP 00101101

Page 28: Block Cipher Principles

IP-1 (Inverse Permutation) สล�บบ�ที่ข้ อม)ลกล�บ IP-1(IP(X))=X

IP-1

4 1 3 5 7 2 8 6

01100110IP-100101101

Page 29: Block Cipher Principles

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

Page 30: Block Cipher Principles

The Data Encryption Standard

DES Encryption

Page 31: Block Cipher Principles

DES Encryption

Page 32: Block Cipher Principles

Single Round of DES Algorithm

Page 33: Block Cipher Principles

Permutation Tables for DES

Page 34: Block Cipher Principles
Page 35: Block Cipher Principles
Page 36: Block Cipher Principles

Calculation of F(R, K)

Page 37: Block Cipher Principles

โดียการสล�บ และแป็ลงข้ อม)ล 6 บ�ที่เหัล.อ 4 บ�ที่

S

1 2 3 4 5 6

Bit 1,6 เล.อก RowBit 2,3,4,5 เล.อก Column

Page 38: Block Cipher Principles
Page 39: Block Cipher Principles
Page 40: Block Cipher Principles

ข้ อม)ล 110010 เข้ า S1 10 = Row 2 1001=Column 9 เป็5ดีตัาราง S1

110010 S1 1100 (12)

Page 41: Block Cipher Principles
Page 42: Block Cipher Principles

แป็ลง key 64 Bit เป็�นข้นาดี 56 Bit

Page 43: Block Cipher Principles

แป็ลง key 56 Bit เป็�นข้นาดี 48 Bit

Page 44: Block Cipher Principles

brute-force attack ค นหัา key