SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
IT346 Information System Security
Week 4: Cryptography (Continue)
อ.พงษ์ ศักดิ์

Faculty of Information Technology

ไผ่แดง

Page
Cryptography
ก
Cryptography
F F
F graph
Fก
F ก
F F
Cryptography F ก ˂ ก F
ก F 3
ก
‣ Symmetric Key Cryptography

F
F
‣ Asymmetric Key Cryptography
F
F
‣ Hash Function ก
F

Faculty of Information Technology

ก F crypto
Cryptography

Secret Key Cryptography ก
Public Key Cryptography ก
F

Page
Symmetric Key Cryptography
F
ก

Cryptography
ก
Plaintext

(Block Cipher)
ก F

‣

1

Symmetric Key
F F ˈ
ก

ก

F

• DES: 1 Data Block = 64 bits
• 3DES: 1 Data Block = 64 bits
• AES: 1 Data Block = 128 bits

(Stream Cipher)
ก F

‣
• RC4
Faculty of Information Technology

Page
Stream Ciphers
ก
‣

F

ˈ ก

Key

bit
ก

bit

F ก

(Stream)

F

ˈ

‣ Keystream

ก

keystream
‣ Pseudorandom
F
กก

ก F
ก
กก

Faculty of Information Technology

F

F

F

ก

ก F Keystream

Stream Cipher ˈ pseudorandom
F F

F F

ˈ F F

F

F

Page
Stream Ciphers
F bit
bit
F

Keystream

ก

ก ( F ก XOR) ก

random keystream
plaintext ( F
ก
plaintext)
F ก F Keystream
F Key
ก encrypt F

F

plaintext

Ci = Pi XOR StreamKeyi

Faculty of Information Technology

Page
Stream Ciphers
F Secret Key
Stream Cipher ก
F Pseudorandom Keystream

F Seed

˂

Key
K

Key
K

KeyStream Generator
(Pseudorandom byte
generator)

Fก

KeyStream Generator
(Pseudorandom byte
generator)

Plaintext
Byte
Stream
P

+
ENCRYPTION

Faculty of Information Technology

Ciphertext
Byte
Stream
C

+

Plaintext
Byte
Stream
P

DECRYPTION

Page
One-Time-Pad (OTP)
Stream Cipher F
Vernam Cipher)
ˈ
ก
break F (unbreakable cipher)

ก One-Time-Pad (
F
F F

กF

‣ Keystream

OTP ˈ random number F
F
F F F
ก Secret Key F Pseudorandom number generator
‣ Secret Key
OTP
Keystream F
F F F
F ก plaintext
Fก
F
OTP
F ก
F ˈ
F F
F
ก

Faculty of Information Technology

Page
Stream Cipher Properties
F

ก

F Stream Cipher

Fก ก Encryption
F
ˈ
F
ก
กF
ก
ก
‣ Keystream
F
F random F ก
random ก F
F
F
‣ Secret Key
F
˂ ก Brute-force Attack
ก
F ก F 128 bits
‣

F

F F ก F Block Cipher
F ก
Stream Cipher
F
F
F ก Block Cipher F Key
Fก
Faculty of Information Technology

ก

F

F

Page
RC4
ก
Ron Rivest
RC4 ˈ Stream Cipher
Security (Security Company)
F Key
F (variable key size) ก
(Byte-oriented Stream Cipher)
ก
random permutation
RC4 ˈ
F
F
F ก กก ก
F
F SSL/TLS
wireless WEP

Faculty of Information Technology

Fก RSA
F

Page
RC4 Keystream Generation
RC4 F keystream ก secret internal state
F
F กF
‣

F

FS

ˈ F
‣ Pointer i

ก

F: ก F Permutation (
F
256 bytes
j: Pointer
8 bits
ก

ก

F

2

F

Faculty of Information Technology

F

S

F กF

F Key ( ก
F 40 256 bits) ก ก
F
F FS
F Key Scheduling Algorithm (KSA)
‣
F FS F ก
ก
F key stream
random generation algorithm (PRGA)
‣

2

F)

256

Keystream Generation

F

F

Fก

F pseudo-

Page
Key Scheduling Algorithm (KSA)
KSA F ก ก
ก

‣

F
F

Fก F
F
ก 00000001, ... )

F

FS

ก F
ก
กก

Fก
F

F

FS

ก F
ก F byte
F
( F S[0] ก 00000000, S[1]
ก F F Identity Permutation

for i from 0 to 255
S[i] := i
endfor

‣

S

ก 256
F Key

F

ก Permute (

F) F

for i from 0 to 255
j := (j + S[i] + key[i mod keylength]) mod 256
swap S[i] and S[j]
endfor
Faculty of Information Technology

Page
Pseudo-Random Generation Algorithm (PRGA)
PRGA F ก
‣

F
byte
Keystream

Faculty of Information Technology

F Keystream
ก
F ก

PRGA
ก
F ก encryption

F keystream ก
Fก
Byte

1

Page
Pseudo-Random Generation Algorithm (PRGA)
PRGA ˈ

ก
F

‣
‣

F
•
•
•
•

F pointer i
ก

i
(
j
(
F S[i]
S[j]
F
F Keystream
(S[i] + S[j]) mod 256

Faculty of Information Technology

j F
PRGA

F 0
ก
F

)1
F ก F
) F ก F S[i] F
Fก F

F

F S[i] ก
F ก F
FS

F S[j]

F

i := 0 , j := 0
while GeneratingOutput:
i := (i + 1) mod 256
j := (j + S[i]) mod 256
swap S[i] and S[j]
K := S[(S[i] + S[j]) mod 256]
output K
endwhile
Page
Pseudo-Random Generation Algorithm (PRGA)
F

Faculty of Information Technology

ก

PRGA

Page
Attack on Cryptography
ก
F F
plaintext
F F
Cryptanalysis ก
Key F ˈ ก break ก encrypt
F F ˈ 3
‣ Ciphertext-only attack ciphertext encrypt

ก
‣ Known-plaintext attack
ก
ก
‣ Chosen-plaintext attack
ก
attacker
F F ciphertext

Faculty of Information Technology

ก key
F plaintext
ciphertext plaintext
F key F
ciphertext plaintext
ก plaintext
˂
Fก plaintext
F ˈ
F key F

ก ˈ
key F
ก key
ก key
F
F

Page

15
Asymmetric Key Cryptography
(Public Key Cryptography)

Faculty of Information Technology

Page
Asymmetric Key Cryptography
F
key

symmetric key cryptography
ก ก encrypt
decrypt
F

‣

ก
F F

ˆ

‣
‣
‣

ˆ

F
F

F F

F

F

F

F

ก

key กF
F F
F F ก ก F
F
Fก กF
ก ก ก Key
ก ก ก
ก Key
F ˈ
ก
F
F
ก F
F F key
ก F F
ก F
F
ก F
ก
F ciphertext ก F
F
ก
Symmetric Key Encryption F
non-repudiation

Public Key Encryption F key
Asymmetric Encryption
F ก ก encrypt
decrypt F
Faculty of Information Technology

Page

17
Asymmetric Key Cryptography
cryptosystem
key 2
F กF
‣ Public Key

FF
‣ Private Key
F ˁ

asymmetric key cryptography
ˈ key

F

ˈ key ก

F F

ก Encryption

ก

F ˈ
F F

F

ˁ
ˁ

ˈ

F

‣ F F F

public key
F
ก
ˈ
F
ก F กF
F
ก encrypt F
F public key
F
F private key
Fก
‣ F decrypt F
‣
ก
encrypt F
F
F
public key ˈ
F
F
F
private key
decrypt F
Faculty of Information Technology

Page

18
Asymmetric Key Cryptography

Faculty of Information Technology

Page
Asymmetric Encryption
Public-Key Cryptosystem
‣

encrypt F
plaintext ก
ก

E(P, PKreceiver) = C

F ciphertext

decrypt F

P = Plaintext
C = Ciphertext
PK = Public Key
SK = Private Key

E(C, SKreceiver) = P

public key
private key
decryption F F F
‣ ก
ʽ
public key ˈ
private key
Fก F F
Public Key

‣ F

Plaintext
Faculty of Information Technology

Encryption

Ciphertext

F

F

ก encryption

F
Private Key
Decryption

Plaintext
Page

20
Public Key Cryptography
Public Key Cryptography
function
‣ One-Way Function

ˆ กF
ก F F

F

F

ก F one-way

ˈ

F
ก ก F
‣ ก
(Multiplication)
•
•

F
F
F
ก ก

F F 12x12
F F
F F 144
F กF ก
144 = 12x12 = 144x1 = 24x6,

F
ก

ก

F

F

(Factorization)

F F 12x12 = 144
กก
ก

ก Logarithms
‣ Exponential
• F
F F 3ก 6
กก
•
F F
F F 729
F ก F ก กก
(x=?, y=?)
Faculty of Information Technology

F

FF

36 =729
ก
logx 729 = y
Page

21
ก

F

RSA Algorithm
Diffie-Hellman Algorithm (
Elliptic Curve Cryptography
Digital Signature Algorithm

Faculty of Information Technology

F
ก

F Key Exchange)

Page

22
RSA
F

RSA
ก

Faculty of Information Technology

F (Ron Rivest)
(Len Adleman) MIT

F (Adi Shamir)
RSA
ก

3

Page

23
ก

ก F

ก
‣

RSA

(prime number) p
ก ก
F Fก

ก

ก
Fก

n = pq
m = (p-1)(q-1)
ก F e 1<e<m
e
m
ˈ
‣

ก

F e

q

F

F

ก

F ก

F ก F ก

F

F

ก (gcd)
ก
ก

F gcd(e, m) ˈ 1

eก m ˈ 1
F

d
ed mod m = 1
Public Key = F (e, n)
Private Key = F (d, n)
Faculty of Information Technology

Page

24
ก
RSA Encryption
F ก F F
Key (e, n)
F
‣ Ciphertext

F
M

F

F Public

C = Me mod n

RSA Decryption
ciphertext C
‣ Message

M<n ก

F Private Key (d, n)

F

M = Cd mod n

F
‣ p = 5, q = 7, n = 35, m = 24
‣ e = 5, d = 29
Faculty of Information Technology

Page

25
F ก

F

n = 35, e = 5
Plaintext

M

Me

Ciphertext = Me mod n

L

12

248832

17

O

15

759375

15

V

22

5153632

22

E

5

3125

10

Faculty of Information Technology

Page

26
F ก
n = 35, d = 29
Cd

Ciphertext

M= Cd mod n

Plaintext

17

48196857210675091509141182522307000

12

L

15

12783403948858939111232757568359400

15

O

22

8.5164331908653770195619449972111e+38

22

V

10

100000000000000000000000000000

5

E

Faculty of Information Technology

Page

27

Mais conteúdo relacionado

Destaque

Information system security wk5-1-pki
Information system security wk5-1-pkiInformation system security wk5-1-pki
Information system security wk5-1-pkiBee Lalita
 
Information system security wk5-2-authentication
Information system security wk5-2-authenticationInformation system security wk5-2-authentication
Information system security wk5-2-authenticationBee Lalita
 
Information system security wk7-2-ids-ips_2
Information system security wk7-2-ids-ips_2Information system security wk7-2-ids-ips_2
Information system security wk7-2-ids-ips_2Bee Lalita
 
Causesof wwi
Causesof wwiCausesof wwi
Causesof wwitar358
 
Information system security wk6-1
Information system security wk6-1Information system security wk6-1
Information system security wk6-1Bee Lalita
 
Information system security wk6-2
Information system security wk6-2Information system security wk6-2
Information system security wk6-2Bee Lalita
 
Information system security wk4-2
Information system security wk4-2Information system security wk4-2
Information system security wk4-2Bee Lalita
 
Information system security wk1-1
Information system security wk1-1Information system security wk1-1
Information system security wk1-1Bee Lalita
 
Information system security wk5-1-pki
Information system security wk5-1-pkiInformation system security wk5-1-pki
Information system security wk5-1-pkiBee Lalita
 
Information system security wk7-1-ids-ips
Information system security wk7-1-ids-ipsInformation system security wk7-1-ids-ips
Information system security wk7-1-ids-ipsBee Lalita
 
12 symmetric key cryptography
12   symmetric key cryptography12   symmetric key cryptography
12 symmetric key cryptographydrewz lin
 
CISSP Prep: Ch 4. Security Engineering (Part 1)
CISSP Prep: Ch 4. Security Engineering (Part 1)CISSP Prep: Ch 4. Security Engineering (Part 1)
CISSP Prep: Ch 4. Security Engineering (Part 1)Sam Bowne
 

Destaque (13)

Information system security wk5-1-pki
Information system security wk5-1-pkiInformation system security wk5-1-pki
Information system security wk5-1-pki
 
Information system security wk5-2-authentication
Information system security wk5-2-authenticationInformation system security wk5-2-authentication
Information system security wk5-2-authentication
 
Information system security wk7-2-ids-ips_2
Information system security wk7-2-ids-ips_2Information system security wk7-2-ids-ips_2
Information system security wk7-2-ids-ips_2
 
Causesof wwi
Causesof wwiCausesof wwi
Causesof wwi
 
Information system security wk6-1
Information system security wk6-1Information system security wk6-1
Information system security wk6-1
 
Information system security wk6-2
Information system security wk6-2Information system security wk6-2
Information system security wk6-2
 
Information system security wk4-2
Information system security wk4-2Information system security wk4-2
Information system security wk4-2
 
Information system security wk1-1
Information system security wk1-1Information system security wk1-1
Information system security wk1-1
 
Information system security wk5-1-pki
Information system security wk5-1-pkiInformation system security wk5-1-pki
Information system security wk5-1-pki
 
Information system security wk7-1-ids-ips
Information system security wk7-1-ids-ipsInformation system security wk7-1-ids-ips
Information system security wk7-1-ids-ips
 
12 symmetric key cryptography
12   symmetric key cryptography12   symmetric key cryptography
12 symmetric key cryptography
 
CISSP Prep: Ch 4. Security Engineering (Part 1)
CISSP Prep: Ch 4. Security Engineering (Part 1)CISSP Prep: Ch 4. Security Engineering (Part 1)
CISSP Prep: Ch 4. Security Engineering (Part 1)
 
Cryptography
CryptographyCryptography
Cryptography
 

Último

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Information system security wk4-cryptography-2

  • 1. IT346 Information System Security Week 4: Cryptography (Continue) อ.พงษ์ ศักดิ์ Faculty of Information Technology ไผ่แดง Page
  • 2. Cryptography ก Cryptography F F F graph Fก F ก F F Cryptography F ก ˂ ก F ก F 3 ก ‣ Symmetric Key Cryptography F F ‣ Asymmetric Key Cryptography F F ‣ Hash Function ก F Faculty of Information Technology ก F crypto Cryptography Secret Key Cryptography ก Public Key Cryptography ก F Page
  • 3. Symmetric Key Cryptography F ก Cryptography ก Plaintext (Block Cipher) ก F ‣ 1 Symmetric Key F F ˈ ก ก F • DES: 1 Data Block = 64 bits • 3DES: 1 Data Block = 64 bits • AES: 1 Data Block = 128 bits (Stream Cipher) ก F ‣ • RC4 Faculty of Information Technology Page
  • 4. Stream Ciphers ก ‣ F ˈ ก Key bit ก bit F ก (Stream) F ˈ ‣ Keystream ก keystream ‣ Pseudorandom F กก ก F ก กก Faculty of Information Technology F F F ก ก F Keystream Stream Cipher ˈ pseudorandom F F F F ˈ F F F F Page
  • 5. Stream Ciphers F bit bit F Keystream ก ก ( F ก XOR) ก random keystream plaintext ( F ก plaintext) F ก F Keystream F Key ก encrypt F F plaintext Ci = Pi XOR StreamKeyi Faculty of Information Technology Page
  • 6. Stream Ciphers F Secret Key Stream Cipher ก F Pseudorandom Keystream F Seed ˂ Key K Key K KeyStream Generator (Pseudorandom byte generator) Fก KeyStream Generator (Pseudorandom byte generator) Plaintext Byte Stream P + ENCRYPTION Faculty of Information Technology Ciphertext Byte Stream C + Plaintext Byte Stream P DECRYPTION Page
  • 7. One-Time-Pad (OTP) Stream Cipher F Vernam Cipher) ˈ ก break F (unbreakable cipher) ก One-Time-Pad ( F F F กF ‣ Keystream OTP ˈ random number F F F F F ก Secret Key F Pseudorandom number generator ‣ Secret Key OTP Keystream F F F F F ก plaintext Fก F OTP F ก F ˈ F F F ก Faculty of Information Technology Page
  • 8. Stream Cipher Properties F ก F Stream Cipher Fก ก Encryption F ˈ F ก กF ก ก ‣ Keystream F F random F ก random ก F F F ‣ Secret Key F ˂ ก Brute-force Attack ก F ก F 128 bits ‣ F F F ก F Block Cipher F ก Stream Cipher F F F ก Block Cipher F Key Fก Faculty of Information Technology ก F F Page
  • 9. RC4 ก Ron Rivest RC4 ˈ Stream Cipher Security (Security Company) F Key F (variable key size) ก (Byte-oriented Stream Cipher) ก random permutation RC4 ˈ F F F ก กก ก F F SSL/TLS wireless WEP Faculty of Information Technology Fก RSA F Page
  • 10. RC4 Keystream Generation RC4 F keystream ก secret internal state F F กF ‣ F FS ˈ F ‣ Pointer i ก F: ก F Permutation ( F 256 bytes j: Pointer 8 bits ก ก F 2 F Faculty of Information Technology F S F กF F Key ( ก F 40 256 bits) ก ก F F FS F Key Scheduling Algorithm (KSA) ‣ F FS F ก ก F key stream random generation algorithm (PRGA) ‣ 2 F) 256 Keystream Generation F F Fก F pseudo- Page
  • 11. Key Scheduling Algorithm (KSA) KSA F ก ก ก ‣ F F Fก F F ก 00000001, ... ) F FS ก F ก กก Fก F F FS ก F ก F byte F ( F S[0] ก 00000000, S[1] ก F F Identity Permutation for i from 0 to 255 S[i] := i endfor ‣ S ก 256 F Key F ก Permute ( F) F for i from 0 to 255 j := (j + S[i] + key[i mod keylength]) mod 256 swap S[i] and S[j] endfor Faculty of Information Technology Page
  • 12. Pseudo-Random Generation Algorithm (PRGA) PRGA F ก ‣ F byte Keystream Faculty of Information Technology F Keystream ก F ก PRGA ก F ก encryption F keystream ก Fก Byte 1 Page
  • 13. Pseudo-Random Generation Algorithm (PRGA) PRGA ˈ ก F ‣ ‣ F • • • • F pointer i ก i ( j ( F S[i] S[j] F F Keystream (S[i] + S[j]) mod 256 Faculty of Information Technology j F PRGA F 0 ก F )1 F ก F ) F ก F S[i] F Fก F F F S[i] ก F ก F FS F S[j] F i := 0 , j := 0 while GeneratingOutput: i := (i + 1) mod 256 j := (j + S[i]) mod 256 swap S[i] and S[j] K := S[(S[i] + S[j]) mod 256] output K endwhile Page
  • 14. Pseudo-Random Generation Algorithm (PRGA) F Faculty of Information Technology ก PRGA Page
  • 15. Attack on Cryptography ก F F plaintext F F Cryptanalysis ก Key F ˈ ก break ก encrypt F F ˈ 3 ‣ Ciphertext-only attack ciphertext encrypt ก ‣ Known-plaintext attack ก ก ‣ Chosen-plaintext attack ก attacker F F ciphertext Faculty of Information Technology ก key F plaintext ciphertext plaintext F key F ciphertext plaintext ก plaintext ˂ Fก plaintext F ˈ F key F ก ˈ key F ก key ก key F F Page 15
  • 16. Asymmetric Key Cryptography (Public Key Cryptography) Faculty of Information Technology Page
  • 17. Asymmetric Key Cryptography F key symmetric key cryptography ก ก encrypt decrypt F ‣ ก F F ˆ ‣ ‣ ‣ ˆ F F F F F F F F ก key กF F F F F ก ก F F Fก กF ก ก ก Key ก ก ก ก Key F ˈ ก F F ก F F F key ก F F ก F F ก F ก F ciphertext ก F F ก Symmetric Key Encryption F non-repudiation Public Key Encryption F key Asymmetric Encryption F ก ก encrypt decrypt F Faculty of Information Technology Page 17
  • 18. Asymmetric Key Cryptography cryptosystem key 2 F กF ‣ Public Key FF ‣ Private Key F ˁ asymmetric key cryptography ˈ key F ˈ key ก F F ก Encryption ก F ˈ F F F ˁ ˁ ˈ F ‣ F F F public key F ก ˈ F ก F กF F ก encrypt F F public key F F private key Fก ‣ F decrypt F ‣ ก encrypt F F F public key ˈ F F F private key decrypt F Faculty of Information Technology Page 18
  • 19. Asymmetric Key Cryptography Faculty of Information Technology Page
  • 20. Asymmetric Encryption Public-Key Cryptosystem ‣ encrypt F plaintext ก ก E(P, PKreceiver) = C F ciphertext decrypt F P = Plaintext C = Ciphertext PK = Public Key SK = Private Key E(C, SKreceiver) = P public key private key decryption F F F ‣ ก ʽ public key ˈ private key Fก F F Public Key ‣ F Plaintext Faculty of Information Technology Encryption Ciphertext F F ก encryption F Private Key Decryption Plaintext Page 20
  • 21. Public Key Cryptography Public Key Cryptography function ‣ One-Way Function ˆ กF ก F F F F ก F one-way ˈ F ก ก F ‣ ก (Multiplication) • • F F F ก ก F F 12x12 F F F F 144 F กF ก 144 = 12x12 = 144x1 = 24x6, F ก ก F F (Factorization) F F 12x12 = 144 กก ก ก Logarithms ‣ Exponential • F F F 3ก 6 กก • F F F F 729 F ก F ก กก (x=?, y=?) Faculty of Information Technology F FF 36 =729 ก logx 729 = y Page 21
  • 22. ก F RSA Algorithm Diffie-Hellman Algorithm ( Elliptic Curve Cryptography Digital Signature Algorithm Faculty of Information Technology F ก F Key Exchange) Page 22
  • 23. RSA F RSA ก Faculty of Information Technology F (Ron Rivest) (Len Adleman) MIT F (Adi Shamir) RSA ก 3 Page 23
  • 24. ก ก F ก ‣ RSA (prime number) p ก ก F Fก ก ก Fก n = pq m = (p-1)(q-1) ก F e 1<e<m e m ˈ ‣ ก F e q F F ก F ก F ก F ก F F ก (gcd) ก ก F gcd(e, m) ˈ 1 eก m ˈ 1 F d ed mod m = 1 Public Key = F (e, n) Private Key = F (d, n) Faculty of Information Technology Page 24
  • 25. ก RSA Encryption F ก F F Key (e, n) F ‣ Ciphertext F M F F Public C = Me mod n RSA Decryption ciphertext C ‣ Message M<n ก F Private Key (d, n) F M = Cd mod n F ‣ p = 5, q = 7, n = 35, m = 24 ‣ e = 5, d = 29 Faculty of Information Technology Page 25
  • 26. F ก F n = 35, e = 5 Plaintext M Me Ciphertext = Me mod n L 12 248832 17 O 15 759375 15 V 22 5153632 22 E 5 3125 10 Faculty of Information Technology Page 26
  • 27. F ก n = 35, d = 29 Cd Ciphertext M= Cd mod n Plaintext 17 48196857210675091509141182522307000 12 L 15 12783403948858939111232757568359400 15 O 22 8.5164331908653770195619449972111e+38 22 V 10 100000000000000000000000000000 5 E Faculty of Information Technology Page 27