0% found this document useful (0 votes)
6 views

2. Authentication - Access Control Cryptography

Uploaded by

singhlegend382
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

2. Authentication - Access Control Cryptography

Uploaded by

singhlegend382
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 69

Authentication, Access Control,

and Cryptography

From Security in Computing, Fifth Edition, by Charles P. Pfleeger, et al. (ISBN: 9780134085043).
Authentication
• The act of proving that a user is who she says she is.
• Methods:
– Something the user knows
– Something the user is
– Something the user has
Something You Know
• Passwords
• Security questions
• Attacks on “something you know”:
– Dictionary attacks
– Inferring likely passwords/answers
– Guessing
– Defeating concealment
– Exhaustive or brute-force attack
– Rainbow tables
Distribution of Password Types
Password Storage

Plaintext Concealed
Biometrics: Something You Are
Problems with Biometrics
• Intrusive
• Expensive
• Single point of failure
• Sampling error
• False readings
• Speed
• Forgery
Tokens: Something You Have
Federated Identity Management
Single Sign-On
Access Control
Access Policies
• Goals:
– Check every access
– Enforce least privilege
– Verify acceptable usage

• Track users’ access


o Enforce at appropriate granularity
o Use audit logging to track accesses
Implementing Access Control
• Reference monitor
• Access control directory
• Access control matrix
• Access control list
• Privilege list
• Capability
• Procedure-oriented access control
• Role-based access control
Reference Monitor
Access Control Directory
Access Control Matrix
Access Control List
Problems Addressed by Encryption
• Suppose a sender wants to send a message to a
recipient.
• An attacker may attempt to
– Block the message
– Intercept the message
– Modify the message
– Fabricate an authentic-looking alternate message
Encryption Terminology
• Sender
• Recipient
• Transmission medium
• Interceptor/intruder
• Encrypt, encode, or encipher
• Decrypt, decode, or decipher
• Cryptosystem
• Plaintext
• Ciphertext
Encryption/Decryption Process
Symmetric vs. Asymmetric
Secret Key vs. Public Key Encryption
Stream Ciphers
Block Ciphers
Stream vs. Block

Stream Block
Advantages  Speed of  High diff usion
transformation  Immunity to
 Low error insertion of
propagation symbol

Disadvantages  Low diff usion  Slowness of


 Susceptibility to encryption
malicious  Padding
insertions and  Error
modifications propagation
Cryptography
• The art of secret writing.
• It is technique of securing information and
communications through use of codes so that
only those person for whom the information is
intended can understand it and process it.
Cryptography (cont.)
• characterize cryptographic system by:

– type of encryption operations used


• substitution / transposition / product
– number of keys used
• single-key or private / two-key or public
– way in which plaintext is processed
• block / stream
Symmetric Encryption
• or conventional / private-key / single-key.
• sender and recipient share a common key.
• all classical encryption algorithms are private-
key.
Symmetric Cipher Model
Requirements
• two requirements for secure use of symmetric
encryption:
– a strong encryption algorithm
– a secret key known only to sender / receiver
• mathematically have:
Y = EK(X)
X = DK(Y)
Cryptanalysis
• objective to recover key not just message
• general approaches:
– cryptanalytic attack
– brute-force attack
Cryptanalytic Attacks
• ciphertext only
– only know algorithm & ciphertext, is statistical,
know or can identify plaintext
• known plaintext
– know/suspect plaintext & ciphertext
• chosen plaintext
– select plaintext and obtain ciphertext
• chosen ciphertext
– select ciphertext and obtain plaintext
• chosen text
– select plaintext or ciphertext to en/decrypt
More Definitions
• unconditional security
– no matter how much computer power or time 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 (eg time
needed for calculations is greater than age of
universe), the cipher cannot be broken
Brute Force Search
• always possible to simply try every key
• most basic attack, proportional to key size
• assume either know / recognise plaintext

Key Size (bits) Number of Alternative Time required at 1 Time required at 106
Keys decryption/µs decryptions/µs
32 232 = 4.3 × 109 231 µs = 35.8 minutes 2.15 milliseconds
56 256 = 7.2 × 1016 255 µs = 1142 years 10.01 hours
128 2128 = 3.4 × 1038 2127 µs = 5.4 × 1024 years 5.4 × 1018 years

168 2168 = 3.7 × 1050 2167 µs = 5.9 × 1036 years 5.9 × 1030 years

26 characters 26! = 4 × 1026 2 × 1026 µs = 6.4 × 1012 years 6.4 × 106 years
(permutation)
Classical Substitution Ciphers
• Letters of plaintext are replaced by other
letters or by numbers or symbols

• If plaintext is viewed as a sequence of bits,


then substitution involves replacing plaintext
bit patterns with ciphertext bit patterns
Caesar Cipher
• earliest known substitution cipher.
• by Julius Caesar.
• first attested use in military affairs.
• replaces each letter by 3rd letter on.

• example:
meet me after the toga party
PHHW PH DIWHU WKH WRJD SDUWB
Caesar Cipher
• Mathematically, give each letter a number
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
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

• then have Caesar cipher as:


c = E(p) = (p + k) mod 26 = (24+3) mod 26= 1 (b)
p = D(c) = (c – k) mod 26
= (1-3) mod 26 = -2 mod 26= 24

• 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
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
Cryptanalysis of Caesar Cipher
• only have 26 possible ciphers
– A maps to A,B,..Z
• Attacker could simply try each in turn
• a brute force search
• given ciphertext, just try all shifts of letters
• do need to recognize when have plaintext
• eg. break ciphertext "GCUA VQ DTGCM"
Monoalphabetic Cipher
• rather than just shifting the alphabet, could shuffle
(jumble) the letters arbitrarily.
• each plaintext letter maps to a different random
ciphertext letter.
• hence key is 26 letters long.

Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN

Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
Monoalphabetic Cipher Security
• now have a total of 26! = 4 x 1026 keys.
• with so many keys, might think is secure.
• but would be !!!WRONG!!!.
• problem is language characteristics.
Language Redundancy and Cryptanalysis

• human languages are redundant.


• eg "th lrd s m shphrd shll nt wnt"
• letters are not equally commonly used.
• in English E is by far the most common letter
– followed by T,R,N,I,O,A,S
• other letters like Z,J,K,Q,X are fairly rare.
• have tables of single, double & triple letter
frequencies for various languages.
English Letter Frequencies
Use in Cryptanalysis attack
• 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
Playfair Cipher
• not even the large number of keys in a
monoalphabetic cipher provides security.
• one approach to improving security was to
encrypt multiple letters.
• the Playfair Cipher is an example.
• invented by Charles Wheatstone in 1854, but
named after his friend Baron Playfair.
Playfair Key Matrix
• a 5X5 matrix of letters based on a keyword
• fill in letters of keyword (sans duplicates)
• fill rest of matrix with other letters
• eg. using the keyword MONARCHY
M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
Encrypting and Decrypting
• plaintext is encrypted two letters at a time
1. if a pair is a repeated letter, insert filler like 'X’
2. if both letters fall in the same row, replace each
with letter to right (wrapping back to start from
end)
3. if both letters fall in the same column, replace
each with the letter below it (again wrapping to
top from bottom)
4. otherwise each letter is replaced by the letter in
the same row and in the column of the other
letter of the pair
Example of Playfair Cipher
• The sender and the receiver deicide on a particular
key, say ‘tutorials’.
• In a key table, the first characters (going left to right) in
the table is the phrase, excluding the duplicate letters.
• The rest of the table will be filled with the remaining
letters of the alphabet, in natural order. The key table
works out to be −
Process of Playfair Cipher

• First, a plaintext message is split into pairs of


two letters (digraphs). If there is an odd
number of letters, a Z is added to the last
letter. Let us say we want to encrypt the
message “hide money”. It will be written as −
• HI DE MO NE YZ
• The rules of encryption are −

– If both the letters are in the same column, take the letter
below each one (going back to the top if at the bottom)

T U O R I
A L S B C
D E F G H ‘H’ and ‘I’
are in same
K M N P Q column,
V W X Y Z hence take
letter below
them to
replace. HI
→ QC
• If both letters are in the same row, take the letter to the
right of each one (going back to the left if at the farthest
right)

T U O R I
A L S B C
D E F G H ‘D’ and ‘E’
are in same
K M N P Q row, hence
V W X Y Z take letter to
the right of
them to
replace. DE
→ EF
• If neither of the preceding two rules are true, form
a rectangle with the two letters and take the
letters on the horizontal opposite corner of the
rectangle.
• Using these rules, the result of the encryption of
‘hide money’ with the key of ‘tutorials’ would be −
• QC EF NU MF ZV
• Decrypting the Playfair cipher is as simple as doing
the same process in reverse. Receiver has the same
key and can create the same key table, and then
decrypt any messages made using that key.
Security of Playfair Cipher
• security much improved over monoalphabetic.
• since have 26 x 26 = 676 digrams
• would need a 676 entry frequency table to analyse
(verses 26 for a monoalphabetic)
• and correspondingly more ciphertext

• was widely used for many years


– eg. by US & British military in WW1
• it can be broken, given a few hundred letters.
• since still has much of plaintext structure.
Polyalphabetic Ciphers
• polyalphabetic substitution ciphers
• improve security using multiple cipher alphabets
• make cryptanalysis harder with more alphabets to
guess and flatter frequency distribution
• use a key to select which alphabet is used for each
letter of the message
• use each alphabet in turn
• repeat from start after end of key is reached
Vigenère Cipher
• simplest polyalphabetic substitution cipher
• effectively multiple caesar ciphers
• 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
• decryption simply works in reverse
Example of Vigenère Cipher
• write the plaintext out
• write the keyword repeated above it
• use each key letter as a caesar cipher key
• encrypt the corresponding plaintext letter
• eg using keyword deceptive
key: deceptivedeceptivedeceptive
plaintext: wearediscoveredsaveyourself
ciphertext:ZICVTWQNGRZGVTWAVZHCQYGLMGJ

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
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Vigenere Cipher

• This scheme of cipher uses a text string (say, a


word) as a key, which is then used for doing a
number of shifts on the plaintext.
• For example, let’s assume the key is ‘point’.
Each alphabet of the key is converted to its
respective numeric value: In this case,
• p → 15, o → 14, i → 8, n → 13, and t → 19.
• Thus, the key is: 15 14 8 13 19.
Process of Vigenere Cipher
• The sender and the receiver decide on a key.
Say ‘point’ is the key. Numeric representation
of this key is ‘15 14 8 13 19’.
• The sender wants to encrypt the message, say
‘attack from south east’. He will arrange
plaintext and numeric key as follows −
a t t a c k f r o m s o u t h e a s t
1 1 8 1 1 1 1 8 1 1 1 1 8 1 1 1 1 8 1
5 4 3 9 5 4 3 9 5 4 3 9 5 4 3
• He now shifts each plaintext alphabet by the number
written below it to create ciphertext as shown below

a t t a c k f r o m s o u t h e a s t
1 1 8 1 1 1 1 8 1 1 1 1 8 1 1 1 1 8 1
5 4 3 9 5 4 3 9 5 4 3 9 5 4 3
p h b n v z t z b f h c c g a t o a g

• Here, each plaintext character has been shifted by a


different amount – and that amount is determined by
the key.
• The key must be less than or equal to the size of the
message.
Security of Vigenère Ciphers
• have multiple ciphertext letters for each
plaintext letter.
• hence letter frequencies are obscured.
• but not totally lost.
• start with letter frequencies
– see if look monoalphabetic or not
• if not, then need to determine number of
alphabets, since then can attach each
Autokey Cipher
• ideally want a key as long as the message
• Vigenère proposed the autokey cipher
• with keyword is prefixed to message as key
• knowing keyword can recover the first few letters
• use these in turn on the rest of the message
• but still have frequency characteristics to attack
key: initial key is 12 (M)
Key Stream: M A T T A C K S U C C E S S F U
plaintext: A T T A C K S U C C E S S F U L
ciphertext: M T M T C M C M W E G W K X Z F
Ci=(Pi+Ki)mod 26
One-Time Pad
• if a truly random key as long as the message is used,
the cipher will be secure
• called a One-Time pad
• is unbreakable since ciphertext bears no statistical
relationship to the plaintext
• since for any plaintext & any ciphertext there exists
a key mapping one to other
• can only use the key once though
• problems in generation & safe distribution of key
Transposition Ciphers
• now consider classical transposition or
permutation ciphers
• these hide the message by rearranging the
letter order
• without altering the actual letters used
• can recognise these since have the same
frequency distribution as the original text
Row Transposition Ciphers
• a more complex transposition
• write letters of message out in rows over a
specified number of columns
• then reorder the columns according to some
key before reading off the rows
Key: BACKIN
Plaintext: HELLOHOWAREYOUabcd
H E L L O H
Ciphertext: EWUHOOLAAOECLRBHYD

O W A R E Y

O U a b c d

B A C K I N
Product Ciphers
• ciphers using substitutions or transpositions are not
secure because of language characteristics
• hence consider using several ciphers in succession to
make harder, but:
– two substitutions make a more complex substitution
– two transpositions make more complex transposition
– but a substitution followed by a transposition makes a new
much harder cipher
• this is bridge from classical to modern ciphers
Rotor Machines
• before modern ciphers, rotor machines were most
common complex ciphers in use
• widely used in WW2
– German Enigma, Allied Hagelin, Japanese Purple
• implemented a very complex, varying substitution
cipher
• used a series of cylinders, each giving one
substitution, which rotated and changed after each
letter was encrypted
• with 3 cylinders have 263=17576 alphabets
Hagelin Rotor Machine
Steganography
• an alternative to encryption
• hides existence of message
– using only a subset of letters/words in a longer
message marked in some way
– using invisible ink
– hiding in LSB in graphic image or sound file
• has drawbacks
– high overhead to hide relatively few info bits
Summary
• have considered:
– classical cipher techniques and terminology
– monoalphabetic substitution ciphers
– cryptanalysis using letter frequencies
– Playfair cipher
– polyalphabetic ciphers
– transposition ciphers
– product ciphers and rotor machines
– stenography

You might also like