L2 (IntroCrypto)
L2 (IntroCrypto)
MIS 1201
(Introduction to Cryptography)
Kasun De Zoysa
1
Objectives - Cryptography
2
What You Should Know
• Basic concepts and terms within
cryptography
– Public and private key algorithms in terms of
their applications and uses
– Cryptography algorithm construction, key
distribution, key management, and methods of
attack
– Applications, construction, and use of digital
signatures
– Principles of authenticity of electronic
transactions and non-repudiation
3
Basic Concept
Cipher Algorithm
Cipher Algorithm
Encrypted Data
4
Definitions
• Cryptography
– Art or science of secret writing
– Protects sensitive information from disclosure
– Storing and transmitting information in a form that allows it to be revealed
only to those intended
– Cryptosystem accomplishes this
– Identifies the corruption or unauthorized change of information
– Designed to make compromise too expensive or too time-consuming
• Cryptanalysis
– art/science relating to converting ciphertext to plaintext without the
(secret) key
• Cryptology
– Includes both cryptography and cryptanalysis
5
Definitions , continued
• Encipher
– act of scrambling
• Decipher
– descrambling with secret key
• Key
– secret sequence governing en/deciphering
6
Cryptography Basic
• Why Encrypt?
– Protect stored information
– Protect information in transmission
• Cryptography originally used for secrecy
• Encryption - process by which plaintext
is converted to ciphertext using a key
• Decryption - process by which ciphertext
is converted to plaintext (with the
appropriate key)
• plaintext (cleartext)- intelligible data
7
Cryptography Basics
• Kerckhoffs' principle (19th century) a cryptosystem should be
secure even if everything about the system, except the key,
is public knowledge.
(Opposite of “security through obscurity”)
• Symmetric Key Encryption Scheme
– Each of the parties involved has to know the secret key
9
The goal of a cryptosystem
• The goal of a cryptosystem is to provide
10
Cryptography History
Historic examples...
Earliest cryptography: an Egyptian scribe
using non-standard hieroglyphics
Julius Caesar (“Caesar Cipher”)
Each plaintext letter is replaced by a letter
some fixed number of positions further
down the alphabet (e.g. Belgica (3
positions) ehojlfd)
The Kama Sutra recommends cryptography
as 44th and 45th art
(of 64) men and women should know
11
Cryptography History
– ENIGMA Used by the Germans in WW2 –
and the subsequent
code-breaking activities at Bletchley park
(still a popular subject of books and movies)
– 1976: Public Key Cryptography concept
(Whitfield Diffie & Martin Hellman)
– 1977: first (published) practical PKC
cryptosystem invented
(RSA - Rivest, Shamir, Adleman)
– October 2000 Rijndael is chosen as AES
(Advanced Encryption Standard)
12
The Caesar Cipher
Ci = E(Pi)= Pi+3
13
Kamasutra
One of the earliest descriptions of encryption by
substitution appears in the Kama-sutra, a text written in
the 4th century AD by the Brahmin scholar Vatsyayana,
but based on manuscripts dating back to the 4th
century BC.
How it work
The kamasutra generate list of 26 alphabet with no
duplicate. Then divide by 2 row. Find for each letter of
message text in table and choose the opposite of the
letter
14
kamasutra
for example:
Key = G H A J R I O B E S Q C L F V Z T Y K M X W N U D P
divide by 2 rows
G H A J R I OB E S Q C L
F V Z TY KMX WN U D P
Cipher : IZOZNQJYZ
15
Monoalphabetic Substitutions
Letter Frequency
ABCDEFGHIJKLMNOPQRSTUVWXYZ
16
Polyalalphabetic Substitutions
17
Transposition / Permutation
Columnar Transposition
c1 c2 c3 c4 c5
c6 c7 c8 c9 c10
c11 c12 etc.
c1 c2 c3 c4 c5
c6 c7 c8 c9 c10
c11 c12 etc.
18
One Time Pad / Vernam Cipher
• Invented in 1917 by Gilbert Vernam and Joseph Mauborgne.
Usually implemented as a stream cipher using the XOR
function.
• Key is used once and discarded by both sender and receiver.
Length of the Key character stream is equal to the message
length.
• Not practical for large amounts of data (MB / GB).
• Pad is theoretically unbreakable by exhaustive brute force.
• Implementation uses a Key that consists of a set of random
• non-repeating characters.
• Each Key letter and Plaintext are added modulo 26 to each
other and then converted back into a letter.
19
One - Time Pad
20
One Time Pad / Vernam Cipher
Plain Text :V E R NA M C I P H E R
Numeric Equivalent : 21 4 17 13 0 12 2 8 15 7 4 17
+Random Number : 76 48 16 82 44 3 58 11 60 5 48 88
= Sum : 97 52 33 95 44 15 60 19 75 12 52 105
=Mod 26 : 19 0 7 17 18 15 8 19 23 12 0 1
Cipher text : t a h r s p I t x m a b
+ Random Stream : 0 1 0 1 1 0 1 0 1 1 1 0 1 0 1
Cipher text :111110010111000
21
Random Numbers
•Books
•CD
23
Stream Cipher
Key (Optional)
ISSOPMI WEHTUA..
Y
Plain text Cipher text
Cipher
Advantage
•Speed of transformation
Cipher text(F)
•Low error propagation Plain text (A)
Disadvantage
•Low diffusion
•Susceptibility to malicious insertion and modifications
24
Block Cipher
XN
OI BA
TP QC
YR Key (Optional) KD
CN EM
ES MC
Y
Disadvantage Plain text Cipher text
Cipher
•Slowness of encryption
•Error propagation
Cipher text(FRWSU)
Advantage
Plain text
•Diffusion (AKEDF)
•Immunity to insertion
25
Block vs Stream Ciphers
•Block ciphers process messages in blocks, each of which
is then en/decrypted
•Like a substitution on blocks of characters
•64-bits or more
26
Secrecy Requirements
• If ciphertext and plaintext are known, it should
be computationally infeasible to determine the
deciphering algorithm
• It should be computationally infeasible to
systematically determine plaintext from
intercepted ciphertext (Even if you decrypt
ciphertext once, it should require the same
amount of work to do it again.)
• Note: “systematically” allows for a lucky
guess
• Note: “Computationally infeasible” means
great effort, doesn’t account for advances in
computing, mathematics
27
Characteristic
Characteristic of
of “Good”
“Good” Cipher
Cipher
Shannon Characteristics - 1949
•The set of keys and the encryption algorithm should be free from comp
28
Kerckhoff’s
Kerckhoff’s Principle
Principle
Reasons:
•Algorithms are difficult to change
•Cannot design an algorithm for every pair of users
•Expert review
•No security through obscurity!
29
Confusion
Confusion and
and Diffusion
Diffusion
30
Confusion
Confusion
Confusion
The interceptor should not be able to
predict what changing one character in
the plaintext will do to the ciphertext
Plaintext
Ciphertext
31
Diffusion
Diffusion
Diffusion
The characteristics of distributing the
information from single plaintext letter
over the entire ciphertext
Plaintext
KASUN
ANHYJ
Ciphertext
32
Brute
Brute Force
Force Search
Search
•Always possible to simply try every key
•Most basic attack, proportional to key size
•Assume either know/recognize plaintext
33
Unconditional/Computational
Unconditional/Computational Security
Security
Unconditional security
no matter how much computer power is
available, the cipher cannot be broken since the
ciphertext provides insufficient information to
uniquely determine the corresponding plaintext
Computational security
given limited computing resources (e.g. time
needed for calculations is greater than age of
universe), the cipher cannot be broken
34
e-mail: [email protected]
35