Title: Conventional Cryptography
1Conventional Cryptography
- Classical Encryption Techniques
2Topics
- Introduction to Cryptography
- Encryption / Decryption
- Basic Terminologies
- Cryptography Types
- Classical Cryptographic Techniques
- Stenography
- Mono-alphabetic Poly-alphabetic
- Caesar Cipher
- Transposition Cipher
- OTPs
- Rotor Machines
3Encryption / Decryption
- The process of disguising a message (plaintext)
into an unintelligible form (ciphertext) by an
encryption algorithm and a secret variable,
called a key - The process of transforming ciphertext back into
plaintext using the encryption algorithm and a key
4Cryptography
- Cryptography is the study of secret (crypto-)
writing (-graphy) concerned with developing
algorithms which may be used to - Conceal the context of some message from all
except the sender and recipient (privacy or
secrecy), and/or - Verify the correctness of a message to the
recipient (authentication or integrity) - Basis of many technological solutions to computer
and communications security problems. - Cryptography may be part of a security solution,
but it is never the whole solution. At best, it
transforms a more general security problem into a
key management problem.
5Crypto Systems Classification
- Two requirements for secure use of symmetric
encryption - a strong encryption algorithm
- a secret key known only to sender / receiver
- Y EK(X)
- X DK(Y)
- Assume encryption algorithm is known
- Implies a secure channel to distribute key
- The way in which the plaintext is processed
- Block cipher
- Stream cipher
6History of Cryptography
- Ancient Cipher
- Have a history of some 4000 years
- Ancient Egyptians encoded some hieroglyphic
writings on monuments - Ancient Hebrews enciphered certain words in the
scriptures using the ATBASH cipher - Greek writings show the first discussions of the
use of secret writings.
7Hieroglyphic Writings
8Basic Terminologies
- cryptology
- the field encompassing both cryptography and
cryptanalysis - cryptography
- the art or science encompassing the principles
and methods of transforming an intelligible
message into one that is unintelligible, and then
retransforming that message back to its original
form. - cryptanalysis (codebreaking)
- the study of principles and methods of
transforming an unintelligible message back into
an intelligible message without knowledge of the
key. - plaintext
- the original intelligible message
- ciphertext
- the transformed message
9Basic Terminologies (Contd.)
- cipher
- Mathematical algorithm for transforming an
intelligible message into unintelligible by
transposition and/or substitution methods - key
- Critical information used by the cipher, known
only to the sender receiver - encipher (encrypt)
- the process of converting plaintext to ciphertext
using a cipher and a key - decipher (decrypt)
- the process of converting ciphertext back into
plaintext using a cipher and a key - code
- an algorithm for transforming an intelligible
message into an unintelligible one using a
code-book
10Symbols Used
P plaintext C ciphertext E encryption
function D decryption function E(P) C
encrypting plaintext yields ciphertext D(C) P
decrypting ciphertext yields plaintext D(E(P))
P decrypting encrypted plaintext yields plaintext
K Key
11Cryptographic Concept
- Encryption C EK(P)
- Decryption P EK-1(C)
- EK is chosen from a family of transformations
known as a cryptographic system. - The parameter that selects the individual
transformation is called the key K, selected from
a keyspace K.
12The Key !
- All modern algorithms use a key to control
encryption and decryption - The key used for decryption can be different from
the encryption key, but for most algorithms they
are the same.
13Key Management Problems
- Key management is the hardest part of
cryptography - Two classes of keys
- Short-term session keys (sometimes called
ephemeral keys) - Generated automatically and invisibly
- Used for one message or session and discarded
- Long-term keys
- Generated explicitly by the user
- Long-term keys are used for two purposes
- Authentication (including access control,
integrity, and non-repudiation) - Confidentiality (encryption)
- Establish session keys
- Protect stored data
14Key Lifetimes and Key Compromise
- Authentication keys
- Public keys may have an long lifetime (decades)
- Conventional keys have shorter lifetimes (a year
or two) - If the key is compromised
- Revoke the key
- Effects of compromise
- Authentication Signed documents are rendered
invalid unless time-stamped. - Confidentiality All data encrypted with it is
compromised.
15Cryptography Types
- Symmetric cryptography
- Use the same key for encryption and decryption
- Asymmetric cryptography
- More popularly known as Public Key Cryptography
- Use different keys for encryption and decryption
16(No Transcript)
17Symmetric Cryptography
18Asymmetric Cryptography
19Cryptanalysis
- Cryptanalysis is the process of breaking an
encrypted message without knowledge of key - Several different types of attacks can be
identified - Ciphertext only
- only known algorithm and some ciphertext
- use statistical attacks only
- Purpose is to recover plaintext and/or key
- must be able to identify when have plaintext
- Known plaintext
- know (or strongly suspect) some
plaintext-ciphertext pairs - use this knowledge in attacking cipher and
recover key
20Cryptanalytic Attacks Contd..
- Chosen plaintext (differential cryptanalysis)
- can select plaintext and obtain corresponding
ciphertext more powerful than known plaintext
attack - Picks patterns that may reveal info/structure of
key - Chosen ciphertext (less probable attack)
- can select ciphertext and obtain corresponding
plaintext - Chosen plaintext-ciphertext (Chosen Text)
- can select plaintext and obtain corresponding
ciphertext, or select ciphertext and obtain
plaintext
21Cipher Security
- unconditional security
- With all computing power available, the cipher
cannot be broken since the ciphertext provides
insufficient information to uniquely determine
the corresponding plaintext - computational security
- given limited computing resources (eg time needed
for calculations is greater than age of
universe), the cipher cannot be broken within the
useful lifetime of the information
22Key Strengths
23Stegnography
- Simply takes one piece of information and hides
it within another. - Stenography can also be used to place a hidden
"trademark" in images, audio, and software, a
technique referred to as watermarking. - More
- http//members.tripod.com/steganography/stego/info
.htm - http//www.belmont.cc.oh.us/Majors/Steno.html
24Classical Cryptographic Techniques
- Two basic components in classical ciphers
- substitution and transposition
- Substitution ciphers - has letters replaced by
others - Monoalphabetic
- Polyalphabetic
- Transposition ciphers - has letters arranged in a
different order
25Caesar Cipher History
- A Monoalphabetic Substitution Cipher
- 2000 years ago Julius Ceasar used a simple
substitution cipher, now known as the Caesar
cipher - First attested use in military affairs (Gallic
Wars) - General Caeser Algorithm
- C E(p) (p k) mod (26)
- p D(C) (C k) mod (26)
- Replace each letter by 3rd letter on, eg.
- e.g. SSUET is cipher as V V X H W
26Ceasar Cipher (contd.)
- More generally can use any shift from 1 to 25
- i.e. replace each letter of message by a letter a
fixed distance away - Specify key letter as the letter a plaintext A
maps to - e.g. a key letter of F means
- A map A to F, B to G, ... Y to D, Z to E
- i.e. shift letters by 5 places
- Hence have 25 useful ciphers
27Example Caesar Cipher
- Replace each letter of message by a letter a
fixed distance away - e.g. use the 3rd letter on
- L FDPH L VDZ L FRQTXHUHG (Cipher)
- i came i saw i conquered (Plain)
- i.e. Mapping in above case is as
- ABCDEFGHIJKLMNOPQRSTUVWXYZ
- DEFGHIJKLMNOPQRSTUVWXYZABC
- Caesar Cipher as
- Encryption Ek i -gt i k mod 26
- Decryption Dk i -gt i - k mod 26
28Cryptanalysis Caesar Cipher
- Exhaustive key search
- Given some ciphertext, just try every shift of
letters - LIZHZLVKWRUHSODFHOHWWHUV Original Ciphertext
KHYGYKUJVQTGRNCEGNGVVGTU Shift 1
JGXFXJTIUPSFQMBDFMFUUFST Shift 2
IFWEWISHTOREPLACELETTERS Shift 3
PlaintextHEVDVHRGSNQDOKZBDKDSSDQR Shift 4
GDUCUGQFRMPCNJYACJCRRCPQ Shift 5MJAIAMWLXSVITPEGI
PIXXIVW Shift 25 - Class Room Task
- Break ciphertext "GCUA VQ DTGCM"
29Arbitrary Substitution
- A dramatic increase in the key space is achieved
by allowing an arbitrary substitution. - There will be 26! or greater than 4 x 1026
possible keys. - The cryptanalysis can be exploited after looking
at the regularities of the language. - This approach is referred as Frequency
Distribution Cryptanalysis.
30Playfair Cipher
- Invented by Sir Charles Wheatstone, in 1854.
- Developed for Telegraph Secrecy
- Based on the 55 matrix of letters constructed
using a keyword. - The matrix is constructed by filling in the
letters of the keyword (minus duplicates). - Then filling in the remainder of the matrix with
the remaining letters in alphabetic order. - More
- http//raphael.math.uic.edu/jeremy/crypt/contrib/
hong.html - http//members.magnet.at/wilhelm.m.plotz/Doc/Playf
air.html - http//www.math.temple.edu/renault/cryptology/pla
yfair.html - http//www.mactech.com/progchallenge/9909Challenge
.html
31Playfair Rules of Enciphering
- Repeating plaintext letters are separated by a
filler letter, such as x. - BALOON as BA LX LO ON
- Plaintext letters that fall in same row of the
matrix are each replaced by the letter to the
right. - AR in arch as RM
- Plaintext letters that fall in same column are
each replaced by the letter beneath. - MU in mute as CM
- Otherwise, each plaintext letter is replaced by
the letter that lies in its corresponding row and
column. - SH in shell as PB
- Refer to the matrix given in Text book on page 34.
32Hill Cipher
- Developed by the mathematician Lester Hill in
1929. - Implemented in the form of a machine using gears
and chains like those used with bicycles. - The fact that it is impractical for hand use,
while it predates the computer age. - More
- http//math.vassar.edu/Classes/280/matrixcode.html
- http//home.ecn.ab.ca/jsavard/crypto/ro020103.htm
33Polyalphabetic Cipher
- An approach to improving security is to use
multiple cipher alphabets, hence the name
Polyalphabetic ciphers - Makes cryptanalysis harder since have more
alphabets to guess and because flattens frequency
distribution - Use a key to select which alphabet is used for
each letter of the message - ith letter of key specifies ith alphabet to use
- Use each alphabet in turn
- Repeat from start after end of key is reached
34Polyalphabetic Substitution
35Vigenère Cipher
- Simplest Polyalphabetic substitution cipher is
the Vigenère Cipher - Key is multiple letters long K k1 k2 ... kd
- ith letter specifies ith alphabet to use
- Use each alphabet in turn
- Repeat from start after d letters in message
- Describe this mathematically as the function
- Encryption is done using
- Eki(a) a -gt a ki (mod 26)
- Decryption is done using
- Dki(a) a -gt a - ki (mod 26)
36Vigenère Cipher Contd..
- Write the plaintext out
- Under it write the keyword in repetition
- Use each key letter in turn as a Caesar cipher
key - Encrypt the corresponding plaintext letter
- Example
- Plaintext THISPROCESSCANALSOBEEXPRESSED
- Keyword CIPHERCIPHERCIPHERCIPHERCIPHE
- Plaintext VPXZTIQKTZWTCVPSWFDMTETIGAHLH
37Vernam Cipher
- Introduced by an ATT engineer named Gilbert
Vernam. - Uses a keyword that is as long as the plaintext.
- The key has no statistical relationship to the
plain text. - This system works on binary data rather than
letters. - Mathematical representation
- Pi Ci XOR ki
38Transposition Ciphers
- Referred as classical Transposition or
Permutation ciphers - These hide the message by rearranging the letter
order without altering the actual letters used. - Scheme uses writing message in a rectangle, row
by row, and reading the message off, column by
column, but permute the order of the columns. - The order of the columns then becomes the key to
the algorithm. - The transposition cipher can be made
significantly more secure by performing more than
one stage of transposition.
39Rail Fence Cipher
- Write message with letters on alternate rows (of
depth n). - Read off cipher row by row
- Plain I A E S W C N U R D C M I A I O Q
E E - Cipher IAESW CNURD CMIAI OQEE
40Rail Fence CipherGeometric Figure
41Scytale Cipher
- An early Greek transposition cipher .
- A strip of paper was wound round a staff.
- Message written along staff in rows, then paper
removed. - Leaving a strip of seemingly random letters.
- Not very secure as key was width of paper staff.
42Scytale Cipher (contd.)
43Reverse (Mirror) Cipher
- Write the message backwards
- Plain I CAME I SAW I CONQUERED
- Cipher DEREU QNOCI WASIE MACI
44Key Concepts for Transposition
- In a transposition cipher the key idea is,
- Write the message out in columns according to
some rule - Read the letters off to form the ciphertext
according to another rule - Key used to find order to
- Read off the cipher
- Write in the plaintext, or
- Both
45Row Transposition ciphers
- Group the message and shuffle letters within each
group. - More formally write letters across rows.
- Then re-order the columns before reading off the
rows. - Always have an equivalent pair of keys (Read off
vs. Write In)
46Row Transposition ciphers E.g.
47Example 2
48Example 3
49What is a One Time Pad? OTPs
- An improvement to the Vernam Cipher.
- It is the only currently known unconditionally
secure encryption system. - Other are cryptographically secure which means
that they have a cost associated with breaking,
this cost will be very high, but it would
theoretically be possible to break if enough
compute time could be gathered. - OTPs are provably unconditionally secure.
- Example Statement in C-language
- main(i,c)intcfor(cfopen(c1,"r")(igetchar(
))putchar(getc(c)i))
50How Does It Work?
- Basically you have your random OTP, which both
you and your intended recipient have. You have a
message M, and you compute the ciphertext C by
XORing the message with the OTP - C M XOR OTP
- You send the ciphertext to your recipient, the
recipient knowing the OTP also can recover the
message by computing the reverse, XORing the
ciphertext C with the OTP - M C XOR OTP
- You must never re-use the OTP, other wise it
wouldn't be a "One-Time" pad anymore, and it
would loose it's unbreakable properties as
information would start to be leaked.
51Rotor Machines
- A rotor is a small disk of insulating material.
- Consist of 26 equally-spaced electrical contacts
in a circle on each side. - The contacts on one side are connected to the
contacts on the other side in a scrambled order. - Enigma A Unique Rotor Machine
- Enigma Rotor Machine, one of a very important
class of cipher machines, heavily used during 2nd
world war, - Comprised a series of rotor wheels with internal
cross-connections, providing a substitution using
a continuously changing alphabet.
52(No Transcript)