Cryptography
Cryptography
Mr S. D Kanengoni
Masters in International
Computer Science
Session Agenda
Cryptography
Basics
Cryptology and Cryptanalysis
Motivation
Network
Symmetric
algorithms
Asymmetric
algorithms,
Authentication,
integrity and non-
repudiation,
Key handling,
multiple public key cryptography, secret sharing
Topic – Session 1
Cryptography
1. Cryptography basics
• History -
• Cipher and Deciphering
DES, RSA)
Cryptography
Study of methods, mathematic technics related to security
concept
Cryptosystem
Set of algorithm, key and secured protocol
Cryptanalysis
Study of existing cryptosystem
• Yesterday :
) centralized
) paper exchange
) no remote access
• Today :
) distributed, either on different sites or locally
) remote access
) subcontractors increase
More and more computer-dependant : I S become crucial. 98%
of the companies admit an addiction from moderate to severe.
Goals of security
5 main characteristics :
• Confidentiality : The information shouldn’t be available to
an unauthorized user nor a process
• Integrity : information should not be modified nor
destroyed by an unauthorized user
• authentication : determine whether someone or
something is, in fact, who or what it is declared to be
• Disponibility : information has to be available to
authorized users
• Provability : usage of logs
C R Y P T O L O G Y : C R Y P T O G R A P H Y + C RY P TA N A LYS I S
1 2 3
4 5
1 a b c d
e
2 f g h ij
k
3 l m n o
p
4 q r s t
u
5 v w x y
z
• Yesterday :
) for strategic purposes
(the enemy shouldn’t be able to read messages)
) by the church
) diplomacy
Plain Text
tryto
re
adthis
mess
a
tryto
re
adthis
Cipher
mess
a
Key
tryto
re
adthis
Cipher
mess
a
101101
tryto 010100
re 001111
101010
adthis
Cipher 101010
mess
a
k k’
101101
tryto 010100 tryto
re 001111 re
101010 adthis
adthis
Cipher 101010 Decipher mess
mess
a
a
ABCDEFGHIJKLMNOPQRSTUVWXYZ
DEFGHIJKLMNOPQRSTUVWXYZABC
Key (3)
Decryption
Cipher Text Plain Text
Cipher:
Message: Caesar Cipher Message:
Dwwdfn Dw Gdyq Algorithm Attack at Dawn
Key (3)
Message: Encrypted
Cipher: Message:
Bob, I love you. Monoalphabetic Nkn, s gktc wky.
Alice Cipher mgsbc
Key
Substitution ciphering:
Mono-alphabetic substitution
Original Message
S e n d e ...
m
a b
b c
c d
... ...
z a
Encrypted Message
T f o e f ...
n
C1(k=6) F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
C2(k=20) T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
Message: Encrypted
Cipher: Message:
Bob, I love you. Monoalphabetic Gnu, n etox dhz.
Alice Cipher tenvj
Key
Substitution ciphering:
Polyalphabetic substitution
Vigenere Ciphering
Based on the Caesar cryptosystem.
A key is used to cipher the clear text
h e l l o w o r l d
8 5 12 12 15 27 23 15 18 12 4
a b c d
1 2 3 4
h+a e+b l+c l+d o+a ' '+b w+c o+d r+a l+b d+c
9 7 15 16 16 29 26 19 19 14 7
Message:
Encrypted
Cipher: Message:
Bob, I love you.
??
Alice
WORD
Substitution ciphering:
The ‘perfect’ substitution ciphering
The length of the key should be equal to the length of the message to be
encrypted.
One-time pad
Difficult to distribute and store the key
H E L L
O W O
R L D
H E L L
O W O
R L D
Stream ciphering is done bit per bit without waiting the whole encryption of
the message.
Key generator
Example
XOR
One-time pad
h tt p :/ /e n . wi k i p e d i a . o rg / wi k i / Bl o c k _ ci p h er _ mo d e _o f _ o p er a t i o n
Block ciphering
Key
hel
lo
wor
ld!
df g
tyu
opt
wer
HEL LO RLD
B1 B2 Bn
...
K Cipher K Cipher K Cipher
C1 C2 Cn
HEL LO WOR
IV B1 B2 B3
...
K Cipher K Cipher K Cipher
C1 C2 C3
Definition
A one-way function(OWF) is a function f such that for each x in the domain of f,
it is easy to compute f(x)
but for essentially all y in the range of f, it is computationally infeasible to find any x such
that y = f(x).
Anti collusion property: x has a single representation f(x).
Example Easy
Hash function
Random sequences
x f(x)
Difficult
z = h(m)
Like MD5, m is split into n blocs, each of fixed length and the
following is applied :
message
valeur valeur
initiale MD5 MD5 MD5 haché
e
Modern h a s h functions
Applicati on to D S A
Digital Signature Algorithm is a signature standard combining
the use of a hash function (MD5 or S H A) and D S S , the latter
being an improvement of El Gamal’s signature scheme.
Encryption
Symmetric Algorithms
Algorithms in which the key for encryption and
decryption are the same are Symmetric
A hash function is any function that can be used to map data of arbitrary size
to data of fixed size.
Properties
∀ m ∈ M , H (m) = n
For each m, n is unique.
From n is not possible to find m.
H easy to compute
n is called DIGEST
Property:
k k
101101
tryto 010100 tryto
re 001111 re
101010 adthis
adthis
E(M, K)=M’ 101010 D(M’, K)=M mess
mes
a
sa
Lucifer - 64 64 bits
DES (1974) 56 bits payload – 8 bits parity
3DES 64 128 – 192
IDEA 64 128
RC2/5/6 64 1-1024
64 usually
Rjindael 128 128,192,256
-AES (1997)
trytore
adthis
messa
000011
DES 001010
101010
Ciphering 101001
101010
101010
DES 101010
101101
Deciphering 010010
010101
010101
DES 010101
010101
Ciphering 010001
010100
trytore
adthis
messa
000011
001010
DES 101010
Deciphering 101001
101010
101010
101010
DES 101101
Ciphering 010010
010101
010101
010101
DES 010101
Deciphering 010001
010100
k1 k2
101101
tryto 010100 tryto
re 001111 re
101010 adthis
adthis
Cipher 101010 Decipher mess
mes
a
sa
Confidentiality
David’s
Bob’s Bob’s Public Key
Message Trudeau
Cipher Encrypted David
+ Public key (Middle-man)
Message
Trudeau’s David’s
Trudeau’s Trudeau’s
New Message Message
Encrypted Cipher + public key Encrypted Cipher + public key
Message Message
Asymmetric Encryption
Session-Key Encryption
Used to improve efficiency
Symmetric key is used for encrypting data
Asymmetric key is used for encrypting the symmetric key
Send to Recipient
Encrypted
Cipher Key
(RSA)
Session Key
Alice’s
Private Key
Bob’s Cipher
Public Key
(DES) Alice and Bob
Bob’s Session Key
Generate Same
Private Key Session Key!
Alice’s Cipher
Public Key
(DES)
Asymmetric Encryption
Key Agreement con’t.
Diffie-Hellman is the first key agreement algorithm
Invented by Whitfield Diffie & Martin Hellman
Provided ability for messages to be exchanged securely
without having to have shared some secret information
previously
Inception of public key cryptography which allowed keys to
be exchanged in the open
No exchange of secret keys
Man-in-the middle attack avoided
Asymmetric Encryption
Key Diffie-Hellman Mathematical Analysis
Bob & Alice
agree on non-secret
Bob prime p and value a Alice
• Diffie Hellman
• DSA
• McEliece
• Merkle-Hellman
• Chor-Rivest
• Goldwasser-Micali
• Blum-Goldwasser
???
Symmetric key
Alice Bob
SessionKey
SessionKey
Man in the Middle
Alice Bob
SessionKey
{ ,
}
public, private
Encrypt ( )
SessionKey
Bob Public Key
Alice Bob
SessionKey
{ ,
}
public, private
Decrypt [ Encrypt ( )]
SK
BPrivateK
BPublicK
Alice Bob
SessionKey { , }
public, private
Decrypt ( aMessage )
SessionKey
Encrypt ( aMessage )
SessionKey
Alice Bob
SessionKey
SessionKey
Message
Message Digest Digest
Algorithm
Secret Key
Password Authentication
Basics
Password is secret character string only known to user and
server
Message Digests commonly used for password authentication
Stored hash of the password is a lesser risk
Hacker can not reverse the hash except by brute force attack
Problems with password based authentication
Attacker learns password by social engineering
Attacker cracks password by brute-force and/or guesswork
Eavesdrops password if it is communicated unprotected over the network
Replays an encrypted password back to the authentication server
Authentication
Digital Signatures
A digital signature is a data item which accompanies or is
logically associated with a digitally encoded message.
It has two goals
A guarantee of the source of the data
Proof that the data has not been tampered with
Sender’s Sender’s
Private Key Public Key
Same?
Digital
Message Signature Signature Signature Message
Digest Algorithm Sent to Algorithm Digest
Receiver
Sender Receiver
Use of cryptography for digital signature
S:MxK1
C
Contract
S(m, k1)=c
........... Signature
............ 1.Hash 10101010101001101101 2.Cipher 10111011101001101101
......................
.......................
Contract
3 ...........
101110 3
............ 111010
...................... 011011
.......................
01
Private key
Contract
........... Signature
............ 1.Hash 10101010101001101101 2.Cipher 10111011101001101101
......................
.......................
Contract
3 ...........
101110 3
............ 111010
...................... 011011
.......................
01
Contract
........... Signature
............ 1.Hash 10101010101001101101 2.Cipher 10111011101001101101
......................
.......................
Contract
3 ...........
101110 3
............ 111010
...................... 011011
.......................
01
Contract
...........
101110
............ 111010
...................... 011011
.......................
01
Contract
...........
............ Signature
......................
.......................
Contract
...........
101110
............ 111010
...................... 011011
.......................
01
Contract
...........
............ Signature
......................
.......................
Contract
...........
101110
............ 111010
...................... 011011
.......................
01
Contract
...........
............ Signature
......................
.......................
Public Key
Private Key
Identity
Information
Signature Certificate
Sender’s
Algorithm
Public Key
Certificate
Authority’s
Private Key
Certificate
Information Part
IP Hashed
Name
Registration Authority
Alice sends a request to a
Registration Authority for a
certificate creation.
Alice
The RA generates a
public,private key pair
The RA sends the private key
Registration Authority
to Alice
Alice
Name
Email
Public Key
Issuer
Certificate Authority Asymmetric Algorithm
Hash function
Alice
Owner Name
Owner Email
Owner Public Key
Issuer info
Certificate Authority Asymmetric Algorithm
Hash function
CA Signature
Registration Authority
The CA signs with its private key
the certificate information part.
Owner Name
Owner Email
Directory Owner Public Key
Issuer info
Certificate Authority Asymmetric Algorithm
Hash function
CA Signature
Registration Authority
Alice
Information Part
Certificate
Public Key Owner Name
Revocation Owner Email
Directory
List Owner Public Key
Certificate Authority Issuer info
Asymmetric Algorithm
Hash function
CA Signature
Registration Authority
Sub CA1
Certification
Sub CA2
SubSubCA1
Certification
SubSubCA1
CA1
signed by
certificate
CA2
signed by certificate
Auto signature
IP
signed by
Signature
CA2 Certificate
IP
signed by
Signature
Alice Certificate
IP
signed by
Signature
CA1 Certificate
IP
signed by
Signature
CA2 Certificate
IP
signed by
3. For each certificate, check Signature
T h e validity
T h e issuer signature
IP
signed by
Signature
Facts
Probability of two irises producing exactly the same
code: 1 in 10 to the 78th power
Independent variables (degrees of freedom) extracted:
266
IrisCode record size: 512 bytes
Operating systems compatibility: DOS and Windows
(NT/95)
Average identification speed (database of 100,000
IrisCode records): one to two seconds
G. Brassard.
Cryptologie contemporaine.
Logique, mathématiques, informatique. Masson, 1993.
D. Kahn.
La guerre des codes secrets.
InterEditions, 1980.
R.L. Rivest.
Cryptography.
In Handbook of Theoretical
Computer Science, volume
A, chapter 13. Elsevier, 1990.
W. Stallings.
Cryptography and Network Security.
Prentice-Hall, 4th. edition, 2006.
J. Stern.
La science du secret.
Odile Jacob, 1998.
I P Security
IP Security Protocol
(AH, ESP)
IP Internet Protocol
T C P security
A→B r = a random
message
B →A c = {r } S K B
A→B
"Hi, are you Bob?" B → A
m
= "Alice, I’m Bob"
c = {h(m)} S K B
Identification
A→B "Hi"
B →A "Hi, I’m Bob. Here’s
my PK" P K B A → B "Prove it."
B →A m = "Alice, I’m Bob"
c = {h(m)} S K B
Anybody can usurp Bob’s identity for Alice by giving his own P K
(MIM).
Transmit a certificate
A→B "Hi"
B →A "Hi, I’m Bob. Here’s my
certificate" cert B A → B "Prove it."
B →A m = "Alice, I’m Bob"
c = {h(m)} S K B
A→B "Hi"
B →A "Hi, I’m Bob. Here’s my certificate" cert B
A→B "Prove it".
B →A m = "Alice, I’m Bob"
c = {h(m)} S K B
A→B "Ok Bob, here’s our secret :"
s = {secret} P K B
B → mj = {message from Bob} s e c re t
A
Attack
Melchior, the man in the middle can be active during the 5 first
steps. At step 6, he can scramble Bob’s message and Alice
receives an un-readable message :
B →M m j = {message from
Bob} s e c re t
M→A m j changed
A
Melchior can scramble everything, but Alice will be warned of
Melchior’s existence.
Communication
5.RSA Algorithm
6.Key Management
W. Fumy.
Key management techniques.
In State of the art in applied cryptography, number 1528 in L N C S , pages 209–223. Springer Verlag, 1997.
R S A Laboratories.
P K C S #1 v2.0, R S A cryptography standard.
Technical report, R S A Data Security, 1998.
References