You are on page 1of 14

12/17/2010

Cryptography and Network Definitions


Security • Computer Security - generic name for
Third Edition the collection of tools designed to protect
data and to thwart hackers
by William Stallings
• Network Security - measures to protect
data during their transmission
Lecture slides by Lawrie Brown
• Internet Security - measures to protect
data during their transmission over a
collection of interconnected networks

Aim of Course Services, Mechanisms, Attacks


• our focus is on Internet Security • need systematic way to define
• consists of measures to deter, prevent, requirements
detect, and correct security violations that • consider three aspects of information
involve the transmission of information security:
– security attack
– security mechanism
– security service
• consider in reverse order

1
12/17/2010

Security Service Security Mechanism


– is something that enhances the security of the • a mechanism that is designed to detect,
data processing systems and the information
transfers of an organization
prevent, or recover from a security attack
– intended to counter security attacks • no single mechanism that will support all
– make use of one or more security functions required
mechanisms to provide the service • however one particular element underlies
– replicate functions normally associated with many of the security mechanisms in use:
physical documents
• eg. have signatures, dates; need protection from cryptographic techniques
disclosure, tampering, or destruction; be notarized • hence our focus on this area
or witnessed; be recorded or licensed

Security Attack OSI Security Architecture


• any action that compromises the security • ITU-T X.800 Security Architecture for OSI
of information owned by an organization • defines a systematic way of defining and
• information security is about how to providing security requirements
prevent attacks, or failing that, to detect • for us it provides a useful, if abstract,
attacks on information-based systems overview of concepts we will study
• have a wide range of attacks
• can focus of generic types of attacks
• note: often threat & attack mean same

2
12/17/2010

Security Services Security Services (X.800)


• X.800 defines it as: a service provided by • Authentication - assurance that the
a protocol layer of communicating open communicating entity is the one claimed
systems, which ensures adequate security • Access Control - prevention of the
of the systems or of data transfers unauthorized use of a resource
• Data Confidentiality –protection of data from
• RFC 2828 defines it as: a processing or unauthorized disclosure
communication service provided by a
• Data Integrity - assurance that data received is
system to give a specific kind of protection as sent by an authorized entity
to system resources • Non-Repudiation - protection against denial by
• X.800 defines it in 5 major categories one of the parties in a communication

Security Mechanisms (X.800) Classify Security Attacks as


• specific security mechanisms: • passive attacks - eavesdropping on, or
– encipherment, digital signatures, access monitoring of, transmissions to:
controls, data integrity, authentication – obtain message contents, or
exchange, traffic padding, routing control, – monitor traffic flows
notarization • active attacks – modification of data stream to:
– masquerade of one entity as some other
• pervasive security mechanisms:
– replay previous messages
– trusted functionality, security labels, event
– modify messages in transit
detection, security audit trails, security
– denial of service
recovery

3
12/17/2010

Model for Network Security Model for Network Security


• using this model requires us to:
– design a suitable algorithm for the security
transformation
– generate the secret information (keys) used
by the algorithm
– develop methods to distribute and share the
secret information
– specify a protocol enabling the principals to
use the transformation and secret information
for a security service

Model for Network Access Security Model for Network Access Security
• using this model requires us to:
– select appropriate gatekeeper functions to
identify users
– implement security controls to ensure only
authorised users access designated
information or resources
• trusted computer systems can be used to
implement this model

4
12/17/2010

Summary Cryptography and Network


• have considered:
Security
– computer, network, internet security def’s Third Edition
– security services, mechanisms, attacks by William Stallings
– X.800 standard
– models for network (access) security
Lecture slides by Lawrie Brown

Symmetric Encryption
Chapter 2 – Classical Encryption
Techniques • or conventional / private-key / single-key
• sender and recipient share a common key
Many savages at the present day regard • all classical encryption algorithms are
their names as vital parts of themselves, private-key
and therefore take great pains to conceal
• was only type prior to invention of public-
their real names, lest these should give to
key in 1970’s
evil-disposed persons a handle by which
to injure their owners. —The Golden
Bough, Sir James George Frazer

5
12/17/2010

Basic Terminology Symmetric Cipher Model


• plaintext - the original message
• ciphertext - the coded message
• cipher - algorithm for transforming plaintext to ciphertext
• key - info used in cipher known only to sender/receiver
• encipher (encrypt) - converting plaintext to ciphertext
• decipher (decrypt) - recovering ciphertext from plaintext
• cryptography - study of encryption principles/methods
• cryptanalysis (codebreaking) - the study of principles/
methods of deciphering ciphertext without knowing key
• cryptology - the field of both cryptography and
cryptanalysis

Requirements Cryptography
• two requirements for secure use of • can characterize by:
symmetric encryption: – type of encryption operations used
– a strong encryption algorithm • substitution / transposition / product
– a secret key known only to sender / receiver – number of keys used
Y = EK(X) • single-key or private / two-key or public

X = DK(Y) – way in which plaintext is processed


• block / stream
• assume encryption algorithm is known
• implies a secure channel to distribute key

6
12/17/2010

Types of Cryptanalytic Attacks Brute Force Search


• ciphertext only
– only know algorithm / ciphertext, statistical, can • always possible to simply try every key
identify plaintext • most basic attack, proportional to key size
• known plaintext
• assume either know / recognise plaintext
– know/suspect plaintext & ciphertext to attack cipher
• chosen plaintext
– select plaintext and obtain ciphertext to attack cipher
• chosen ciphertext
– select ciphertext and obtain plaintext to attack cipher
• chosen text
– select either plaintext or ciphertext to en/decrypt to
attack cipher

More Definitions Classical Substitution Ciphers


• unconditional security • where letters of plaintext are replaced by
– no matter how much computer power is other letters or by numbers or symbols
available, the cipher cannot be broken since
the ciphertext provides insufficient information • or if plaintext is viewed as a sequence of
to uniquely determine the corresponding bits, then substitution involves replacing
plaintext plaintext bit patterns with ciphertext bit
• computational security patterns
– given limited computing resources (eg time
needed for calculations is greater than age of
universe), the cipher cannot be broken

7
12/17/2010

Caesar Cipher Caesar Cipher


• earliest known substitution cipher • can define transformation as:
a b c d e f g h i j k l m n o p q r s t u v w x y z
• by Julius Caesar D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

• first attested use in military affairs • mathematically give each letter a number
a b c d e f g h i j k l m
• replaces each letter by 3rd letter on 0 1 2 3 4 5 6 7 8 9 10 11 12
n o p q r s t u v w x y Z
• example: 13 14 15 16 17 18 19 20 21 22 23 24 25

meet me after the toga party • then have Caesar cipher as:
PHHW PH DIWHU WKH WRJD SDUWB C = E(p) = (p + k) mod (26)
p = D(C) = (C – k) mod (26)

Cryptanalysis of Caesar Cipher Monoalphabetic Cipher


• only have 26 possible ciphers • rather than just shifting the alphabet
– A maps to A,B,..Z • could shuffle (jumble) the letters arbitrarily
• each plaintext letter maps to a different random
• could simply try each in turn ciphertext letter
• a brute force search • hence key is 26 letters long
• given ciphertext, just try all shifts of letters
Plain: abcdefghijklmnopqrstuvwxyz
• do need to recognize when have plaintext Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN
• eg. break ciphertext "GCUA VQ DTGCM" Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA

8
12/17/2010

Language Redundancy and


Monoalphabetic Cipher Security
Cryptanalysis
• now have a total of 26! = 4 x 1026 keys • human languages are redundant
• eg "th lrd s m shphrd shll nt wnt"
• with so many keys, might think is secure
• letters are not equally commonly used
• but would be !!!WRONG!!! • in English e is by far the most common letter
• problem is language characteristics • then T,R,N,I,O,A,S
• other letters are fairly rare
• cf. Z,J,K,Q,X
• have tables of single, double & triple letter
frequencies

English Letter Frequencies Use in Cryptanalysis


• key concept - monoalphabetic substitution
ciphers do not change relative letter frequencies
• discovered by Arabian scientists in 9th century
• calculate letter frequencies for ciphertext
• compare counts/plots against known values
• if Caesar cipher look for common peaks/troughs
– peaks at: A-E-I triple, NO pair, RST triple
– troughs at: JK, X-Z
• for monoalphabetic must identify each letter
– tables of common double/triple letters help

9
12/17/2010

Example Cryptanalysis Playfair Cipher


• given ciphertext: • not even the large number of keys in a
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX monoalphabetic cipher provides security
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
• one approach to improving security was to
• count relative letter frequencies (see text)
• guess P & Z are e and t
encrypt multiple letters
• guess ZW is th and hence ZWP is the • the Playfair Cipher is an example
• proceeding with trial and error fially get: • invented by Charles Wheatstone in 1854,
it was disclosed yesterday that several informal but
direct contacts have been made with political but named after his friend Baron Playfair
representatives of the viet cong in moscow

Playfair Key Matrix Encrypting and Decrypting


• a 5X5 matrix of letters based on a keyword • plaintext encrypted two letters at a time:
1. if a pair is a repeated letter, insert a filler like 'X',
• fill in letters of keyword (sans duplicates) eg. "balloon" encrypts as "ba lx lo on"
2. if both letters fall in the same row, replace each with
• fill rest of matrix with other letters letter to right (wrapping back to start from end),
eg. “ar" encrypts as "RM"
• eg. using the keyword MONARCHY 3. if both letters fall in the same column, replace each
MONAR with the letter below it (again wrapping to top from
bottom), eg. “mu" encrypts to "CM"
CHYBD
4. otherwise each letter is replaced by the one in its
EFGIK row in the column of the other letter of the pair, eg.
LPQST “hs" encrypts to "BP", and “ea" to "IM" or "JM" (as
desired)
UVWXZ

10
12/17/2010

Security of the Playfair Cipher Polyalphabetic Ciphers


• security much improved over monoalphabetic • another approach to improving security is to use
• since have 26 x 26 = 676 digrams multiple cipher alphabets
• would need a 676 entry frequency table to • called polyalphabetic substitution ciphers
analyse (verses 26 for a monoalphabetic) • makes cryptanalysis harder with more alphabets
• and correspondingly more ciphertext to guess and flatter frequency distribution
• was widely used for many years (eg. US & • use a key to select which alphabet is used for
British military in WW1) each letter of the message
• it can be broken, given a few hundred letters • use each alphabet in turn
• since still has much of plaintext structure • repeat from start after end of key is reached

Vigenère Cipher Example


• simplest polyalphabetic substitution cipher • write the plaintext out
is the Vigenère Cipher • write the keyword repeated above it
• effectively multiple caesar ciphers • use each key letter as a caesar cipher key
• key is multiple letters long K = k1 k2 ... kd • encrypt the corresponding plaintext letter
• ith letter specifies ith alphabet to use • eg using keyword deceptive
• use each alphabet in turn key: deceptivedeceptivedeceptive
plaintext: wearediscoveredsaveyourself
• repeat from start after d letters in message
ciphertext:ZICVTWQNGRZGVTWAVZHCQYGLMGJ
• decryption simply works in reverse

11
12/17/2010

Aids Security of Vigenère Ciphers


• simple aids can assist with en/decryption • have multiple ciphertext letters for each
• a Saint-Cyr Slide is a simple manual aid plaintext letter
– a slide with repeated alphabet • hence letter frequencies are obscured
– line up plaintext 'A' with key letter, eg 'C' • but not totally lost
– then read off any mapping for key letter • start with letter frequencies
• can bend round into a cipher disk – see if look monoalphabetic or not
• or expand into a Vigenère Tableau (see • if not, then need to determine number of
text Table 2.3) alphabets, since then can attach each

Kasiski Method Autokey Cipher


• ideally want a key as long as the message
• method developed by Babbage / Kasiski
• repetitions in ciphertext give clues to period • Vigenère proposed the autokey cipher
• so find same plaintext an exact period apart • with keyword is prefixed to message as key
• which results in the same ciphertext • knowing keyword can recover the first few letters
• of course, could also be random fluke • use these in turn on the rest of the message
• eg repeated “VTW” in previous example • but still have frequency characteristics to attack
• suggests size of 3 or 9 • eg. given key deceptive
• then attack each monoalphabetic cipher key: deceptivewearediscoveredsav
individually using same techniques as before plaintext: wearediscoveredsaveyourself
ciphertext:ZICVTWQNGKZEIIGASXSTSLVVWLA

12
12/17/2010

One-Time Pad Transposition Ciphers


• if a truly random key as long as the • now consider classical transposition or
message is used, the cipher will be secure permutation ciphers
• called a One-Time pad • these hide the message by rearranging
• is unbreakable since ciphertext bears no the letter order
statistical relationship to the plaintext
• without altering the actual letters used
• since for any plaintext & any ciphertext
there exists a key mapping one to other • can recognise these since have the same
• can only use the key once though frequency distribution as the original text
• have problem of safe distribution of key

Rail Fence cipher Row Transposition Ciphers


• write message letters out diagonally over a • a more complex scheme
number of rows • write letters of message out in rows over a
specified number of columns
• then read off cipher row by row • then reorder the columns according to
• eg. write message out as: some key before reading off the rows
m e m a t r h t g p r y Key: 3 4 2 1 5 6 7
Plaintext: a t t a c k p
e t e f e t e o a a t o s t p o n e
d u n t i l t
• giving ciphertext w o a m x y z
MEMATRHTGPRYETEFETEOAAT Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ

13
12/17/2010

Product Ciphers Rotor Machines


• ciphers using substitutions or transpositions are • before modern ciphers, rotor machines were
not secure because of language characteristics most common product cipher
• hence consider using several ciphers in • were widely used in WW2
succession to make harder, but: – German Enigma, Allied Hagelin, Japanese Purple
– two substitutions make a more complex substitution • implemented a very complex, varying
substitution cipher
– two transpositions make more complex transposition
– but a substitution followed by a transposition makes a
• used a series of cylinders, each giving one
new much harder cipher substitution, which rotated and changed after
each letter was encrypted
• this is bridge from classical to modern ciphers
• with 3 cylinders have 263=17576 alphabets

Steganography Summary
• an alternative to encryption • have considered:
• hides existence of message – classical cipher techniques and terminology
– monoalphabetic substitution ciphers
– using only a subset of letters/words in a
longer message marked in some way – cryptanalysis using letter frequencies
– Playfair ciphers
– using invisible ink
– polyalphabetic ciphers
– hiding in LSB in graphic image or sound file
– transposition ciphers
• has drawbacks – product ciphers and rotor machines
– high overhead to hide relatively few info bits – stenography

14

You might also like