Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
, 2000
CRYPTOGRAPHY
The word cryptography in Greek means “secret writing.” The term today
refers to the science and art of transforming messages to make them
secure and immune to attacks.
Cryptography components
2
CIPHER
3
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
A cipher is an algorithm for performing encryption
or decryption — a series of well-defined steps that
can be followed as a procedure.
4
CIPHER
CLASSICAL MODERN
6
Substitution Encryption Method
- Caesar Cipher
A cipher using the substitution method substitutes one symbol
with another.
For example, we can replace character A with D and T with Z,
0 with 3 and 2 with 7.
The first cipher text was used by Julius Caesar and is still
called Caesar Cipher.
The cipher is shift key characters down.
7
8
Transposition cipher
9
10
Plaintext: attackxatxdawn
Permute rows
and columns
⇒
Cipher text: xtawxnattxadakc
Key: matrix size and permutations (3,5,1,4,2) and
(1,3,2)
000 h=001 i=010 k=011 l=100 r=101 s=110 t=111
h e i l h i t l e r
Plaintext:
001 000 010 100 001 010 111 100 000 101
Key: 111 101 110 101 111 100 000 101 110 000
Ciphertext:
110 101 100 001 110 110 111 001 110 101
s r l h s s t h s r
000 h=001 i=010 k=011 l=100 r=101 s=110 t=111
s r l h s s t h s r
Cipher text: 110 101 100 001 110 110 111 001 110 101
Key: 111 101 110 101 111 100 000 101 110 000
Plaintext:
001 000 010 100 001 010 111 100 000 101
h e i l h i t l e r
Modern cipher:--
14
Key BASED
CIPHER
WHAT IS A KEY ?????
15
Symmetric-key cryptography
16
In symmetric-key cryptography, the same key is used in both
directions.
17
DES Numerology
18
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Data Encryption Standard (DES)
19
Iteration block
16 iteration blocks are conceptually the same. Each block use
different key derived from the original key.
The whole DES cipher block is a substitution block that
changes a 64-bit plaintext to a 64-bit cipher text.
20
Feistel cipher refers to a type of block cipher
design, not a specific cipher
Split plaintext block into left and right halves:
Plaintext = (L0,R0)
For each round i=1,2,...,n, compute
Li= Ri−1
Ri= Li−1 ⊕ F(Ri−1,Ki)
where F is round function and Ki is sub key
Cipher text = (Ln,Rn)
L R key
32 28 28
25
In DES 6×4-bit S-Box (S5) is used :
Middle 4 bits of input
S5 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
000 001 010 011 100 101 110 111 000 001 010 011 100 101 110 111
0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1
00
010 100 100 001 111 010 011 110 000 101 011 111 101 000 110 001
1 1 0 1 0 0 1 0 0 0 1 1 0 1 1 0
Oute 01
110 011 010 100 100 111 101 001 101 000 111 010 011 001 000 110
r
bits 0 0 0 1 1 1 0 1 1 1 1 0 0 0 0 1
10
100 010 001 011 010 101 111 000 111 001 100 101 110 011 000 110
1 1 1 0 0 1 0 1 0 1 0 1 1 0 0 0
11
011 000 100 111 001 110 010 101 110 111 000 001 010 100 101 011
Given a 6-bit input, the 4-bit output is found by selecting the row using the outer
two bits(the first and last bits), and the column using the inner four bits. For
example, an input "011011" has outer bits "01" and inner bits "1101"; the
corresponding output would be "1001".
26
Key Distribution - Diffie-Hellman Protocol
A symmetric key between two parties is useful if it is used only once; it must be
created for one session and destroyed when the session is over.
Diffie-Hellman protocol: the two parties use the session key to exchange data without having
to remember or store it for future use.
Before establishing a symmetric key, the two parties need to choose two numbers N and G.
The first number, N, is a large prime number with restriction that (N-1)/2 must also be prime.
The second number G is also prime. The two numbers are not confidential.
27
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Man-in-the-middle attack
He can intercept both the authentication message and the data message, store
them, and resend them later to Bob.
Bob has no way to know if this is a replay of a previous message. There nothing
in this procedure to guarantee the freshness of the message.
For example, suppose Alice’s message instruct Bob to pay John for some job he
has done. John can resend the message, thereby illegally getting paid twice for
the same job.
32
(Rivest, Shamir and Adleman) RSA
In the method, the private key here is a pair of numbers (N, d);
the public key is also a pair of numbers (N, e).
33
34
Comparison of symmetric and asymmetric
-key cryptography
Symmetric-key cryptography:
(1) Advantages: Efficiency, less time to encrypt a message
(2) Disadvantages: each pair of users must have a unique key,
N users need N(N-1)/2 keys; The key distribution can be difficult.
Asymmetric-key cryptography:
(1) Advantages: Easy key distribution, the public key can be
used for any users;
Each user only needs a pair of keys.
(2) Disadvantages: algorithm is complex the public key
for a user must be verified.
35
Applications of cryptography include ATM
cards, computer passwords, and electronic
commerce.
authentication, digital signatures,
interactive
. proofs
to ensure secrecy in communications, such
37
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000