You are on page 1of 44

(1)

2016.09

.
.
.
.
. (DES AES)
. (RSA ECC)
.
.
.
2
.

3
(Code)

4

: (Bar Code)

:
( A123456789)

1. A 1, 0
B 1, 1
2. 1 2

3.
4.
6
(Error Correcting
Code)

: [ReedSolomon (RS)
codes] DVD
CD

7
(Password)
:

8
(Bar Code)
(RFID)
RFID: Radio Frequency Identification

Coding

9
vs (From Wikipedia)

(Cryptography)
Cryptography is the practice and study of hiding
information. Modern cryptography intersects the
disciplines of mathematics, computer science,
and engineering.
(Coding Theory)
The aim of channel coding theory is to find codes
which transmit quickly, contain many valid code
words and can correct or at least detect errors.

10

11

12
Enigma

13
Outlook Express

14

15

16

(cryptosystem)
(algorithm)
(key)
(plaintext)
(ciphertext)
(security)

17

Encrypt

Plaintext Symmetric key Ciphertext

Decrypt

DES (Data Encryption Standard)


AES (Advanced Encryption Standard)
18



Private Key Public Key

1976 (Diffie & Hellman)



19

Public Key Cryptosystem

Public key

Plaintext Encrypt

Decrypt Ciphertext

Private key

PKC: RSA (Rivest Shamir Adleman 1977)


PKC: ECC ( Elliptic Curve Cryptosystem)

20
Digital Signature

Public key

Signature Verify

Sign Message

Private key

* (confidentiality) * (Authentication)
* (Integrity) * (Non-Repudiation)
21
.

22
Introduction
Encoding is the process of transforming
information from one format into another
The opposite operation is called decoding
Example

A 0, B 1, C 2, , Y 24, Z 25
The above conversion is used throughout this chapter

23
Introduction
Encryption is the process of obscuring
information to make it unreadable without
special knowledge
A cipher is an algorithm* for performing
encryption, and the reverse, decryption
An algorithm is a series of well-defined steps
that can be followed as a procedure

24
Introduction
The original information is plaintext
The encrypted form is ciphertext
The ciphertext contains all the information of
the plaintext, but is not in a format readable
by a human or computer without the proper
mechanism to decrypt it
The ciphertext should resemble random
gibberish to those not intended to read it

25
Introduction
Cryptology / Cryptography is
the study of message secrecy,
about communication in the
presence of adversaries [Ron Rivest]
Cryptanalysis is the study of
methods for obtaining the meaning
of ciphertext, without access to the
secret knowledge which is normally
required to do so
26
Introduction
Cryptologists / Cryptographers design
ciphers with two goals
For authorized users, the method to encrypt
(scramble) and decrypt (unscramble) messages
is easy and inexpensive
For unauthorized users, the task to determine
the corresponding plaintext from a ciphertext is
difficult and expensive

27
Introduction
A cipher is a means of transforming plaintext into
ciphertext (under the control of a secret key)
Encryption: c = ek (m)
m is the plaintext
e is the cipher / encryption function
k is the secret key
c is the ciphertext
Decryption: m = dk (c)
e is public, the secrecy of m given c depends totally
on the secrecy of k
28
Introduction
Symmetric cryptosystems
or secret key cryptosystems
Each party needs access to the secret key
Known to both sides, but needs to be kept secret
Asymmetric cryptosystems
or public key cryptosystems
Uses two different types of keys
One is publicly available and used for encryption
The other is private and used for decryption
29
Introduction
The number of keys must be large to prevent
exhaustive search
Usually in cryptography the parties are denoted by
Alice
Bob
Carol
Someone listening is denoted by
Eve (Eavesdropper)

30
Introduction
Worst case assumptions assume attacker has
Full knowledge of the cipher algorithm e

A number of plaintext / ciphertext pairs associated


to the target key k
The cipher designer must play the role of the
cryptanalyst
In practice ciphers are used which are believed to
be strong
It means that the best attempts of experienced
cryptanalysts can not break them
31
Introduction
Fix a positive N Z which we call the modulus
For a, b Z, we write a b (mod N) if N | (b a)
We say that a and b are congruent modulo N
We just write a = b if it is clear we are working
modulo N
mod N is a postfix operator which returns the
smallest non-negative value modulo N
Like the C or Java operator %
18 mod 7 = 18 % 7 = 4
18 mod 7 = (18) % 7 = 3
32
Introduction
When does a x b (mod N) have a solution?
If gcd(a, N) = 1 [a and N are relatively prime or coprime],
there is exactly one solution
Find the value c such that a c 1 (mod N)
Then compute x b c (mod N)
If g = gcd(a, N) 1 and g | b, there are g solutions
Divide the equation by g to produce a x b (mod N ),
where a = a / g, b = b / g and N = N / g
If x is a solution to the above equation then x = x + i N for
0 i < g is a solution to the original one
Otherwise there are no solutions
33
Introduction
Denote (N), Euler function, the number of integers
in {0, 1, 2, , N 1} which are relatively prime to N
n
If N has the prime factorization
n
N i , then
p ei

i 1
( N ) pi ei 1
( pi 1)
i 1
Given the factorization of N, it is easy to compute (N)
The most important cases for the value of (N) in
cryptography:
If p is prime then (p) = p 1
If p q are both prime, then (p q) = (p 1)(q 1)
34
Caesar Cipher
Gius Jlius Caesar (100 BC 44 BC)
A Roman military and political leader and one
of the most influential men in world history
He played a critical role in the transformation
of the Roman Republic into the Roman Empire
Caesar Cipher
Example (Recall: A 0, B 1, C 2, , Y 24, Z 25)
Plaintext: SPY (18 15 24)
Ciphertext: VSB (21 18 1)
Encryption: c = p + 3 mod 26
Decryption: p = c 3 mod 26
35
Shift Cipher
Shift Cipher
Each letter we identify with a number
A = 0, B = 1, C = 2, , Z = 25
The key k is a number in the range 0 ~ 25
Encryption is adding k to each letter modulo 26
Julius Caesar used k = 3
HELLO becomes KHOOR
We break a Shift cipher by using the statistics of
the underlying language
36
Shift Cipher
English Letter Frequencies

The most common bigrams are, in decreasing order


TH, HE, IN, ER, AN, RE, ED, ON, ES, ST, EN, AT, TO, NT, HA
The most common trigrams are, in decreasing order
THE, ING, AND, HER, ERE, ENT, THA, NTH, WAS, ETH, FOR
Useful cryptanalysis rarely mentioned in books:
Conditional probability e.g., the letter with the highest frequency
right after the letter H?
37
Shift Cipher
Take the following example cipher text
BPMZM WVKM EIA IV COTG LCKSTQVO
EQBP NMIBPMZA ITT ABCJJG IVL JZWEV
IVL BPM WBPMZ JQZLA AIQL QV AW UIVG EWZLA
OMB WCB WIN BWEV
OMB WCB, OMB WCB , OMB WCB WIN BWEV
IVL PM EMVB EQBP I YCIKS IVL I EILLTM IVL I YCIKS
QV I NTCZZG WN MQL MZLWEV
BPIB XWWZ TQBBTM COTG LCKS TQVO
EMVB EIVLMZQVO NIZ IVL VMIZ
JCB IB MDMZG XTIKM BPMG AIQL BW PQA NIKM
VWE OMB WCB, OMB WCB, OMB WCB WN PMZM
IVL PM EMVB EQBP I YCIKS IVL I EILLTM IVL I YCIKS
IVL I DMZG CVPIXXG BMIZ
We need to compare the frequency distribution of this text with
standard English
38
Shift Cipher
Underlying Plain Text

Cipher Text

The shift of E seems to be either 4, 8,17,18 or 23


The shift of A seems to be either 1, 8,12,21 or 22
39
Shift Cipher
Hence the key is probably equal to 8
We can now decrypt the cipher text to reveal
There once was an ugly duckling
With feathers all stubby and brown
And the other birds said in so many words
Get out of town
Get out, get out, get out of town
And he went with a quack and a waddle and a quack
In a flurry of eiderdown
That poor little ugly duckling
Went wandering far and near
But at every place they said to his face
Now get out, get out, get out of here
And he went with a quack and a waddle and a quack
And a very unhappy tear

40
Affine Cipher
Affine Ciphers
c = mp + s mod 26

m is the multiplication factor

Shift cipher is a special case of m = 1

gcd(m, 26) = 1 to make sure decryption


successful
p = (c s) m 1 mod 26

26 (26) = 26 12 = 312 possibilities


41
Affine Cipher
Polyalphabetic Ciphers
Plaintext: p1 p2 p3

Ciphertext: c1 c2 c3
Example of three combined affine ciphers
c3k-2 = m1 p3k-2 + s1 mod 26
c3k-1 = m2 p3k-1 + s2 mod 26
c3k = m3 p3k + s3 mod 26
42
Substitution Cipher
The problem with the Shift cipher is that the number of
keys is too small
Only 26 possible keys
To increasing the number of keys, a substitution cipher
was invented
Encryption involves replacing each letter by its permuted
version
Decryption involves use of the inverse permutation
Example: ABCDEFGHIJKLMNOPQRSTUVWXYZ
TMKGOYDSIPELUAVCRJWXZNHBQF
Hence HELLO encrypts to SOLLV
43
Substitution Cipher
Number of keys is 26! 4.03 1026 288
This is far too large a number to brute force
search using modern computers
Still we can break these ciphers using statistics of
underlying plaintext language

44

You might also like