Lecture 3
Lecture 3
3. Digital signature
Some Basic Terminology
• plaintext - original message
• ciphertext - 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) - study of principles/ methods of
deciphering ciphertext without knowing key
• cryptology - field of both cryptography and cryptanalysis
Encryption
Cipher
• Cipher is a method for encrypting messages
Key A Key B
Caesar Cipher
ABCDEFGHIJKLMNOPQRSTUVWXYZ
DEFGHIJKLMNOPQRSTUVWXYZABC
Key (3)
Decryption
Cipher Text Plain Text
Cipher:
Message: Caesar Cipher Message:
Dwwdfn Dw Gdzq Algorithm Attack at Dawn
Key (3)
C=(p+k) mod 26
C=(8+3) mod 26
C=11 mod 26
C=11
Substitution Cipher
Polyalphabetic Cipher
• Developed by Blaise de Vigenere
– Also called Vigenere cipher
• Uses a sequence of monoalphabetic ciphers in tandem
– e.g. C1, C2, C2, C1, C2
Key
Cryptanalysis of Caesar Cipher
ABCDEFGH I JKLMNOPQRSTUVWXYZ
Key
Language Redundancy and Cryptanalysis
• Plaintext:
Substitution Cipher
Example of Vigenère Cipher
Message:
Encrypted
Cipher: Message:
Bob, I love you.
??
Alice
WORD
Transposition
Rail Fence
• The plaintext is written down as a sequence of
diagonals
• then read off as a sequence of rows.
• ciphertext: MEMATRHTGPRYETEFETEOAAT
Transposition
Row Column transposition
• A more complex scheme is to write the message in a
rectangle, row by row, and read 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.
• For example,
• Plaintext: attack postponed until two am
• Key: 4 3 1 2 5 6 7
Transposition
Row Column transposition
• Plaintext: attack postponed until two am
• Key: 4 3 1 2 5 6 7
Column out 4 3 1 2 5 6 7
Plaintext a t t a c k p
O s t p o n E
d u n t i l t
w o a m x y z
ciphertext:
TTNAAPTMTSUOAODWCOIXKNLYPET
Ciphers
Shannon’s Characteristics of “Good” Ciphers
• The amount of secrecy needed should determine
the amount of labor appropriate for the encryption
and decryption.
• The set of keys and the enciphering algorithm
should be free from complexity.
• The implementation of the process should be as
simple as possible.
• Errors in ciphering should not propagate and
cause corruption of further information in the
message.
• The size of the enciphered text should be no larger
than the text of the original message.
Encryption Systems
Properties of Trustworthy Systems
• It is based on sound mathematics.
– Good cryptographic algorithms are derived from solid
principles.
• It has been analyzed by competent experts and
found to be sound.
– Since it is hard for the writer to envisage all possible
attacks on the algorithm
• It has stood the “test of time.”
– Over time people continue to review both mathematical
foundations of an algorithm and the way it builds upon
those foundations.
– The flaws in most algorithms are discovered soon after
their release.
Cryptanalysis
Techniques
• Cryptanalysis is the process of breaking an encryption code
– Tedious and difficult process
• Several techniques can be used to deduce the algorithm
– Attempt to recognize patterns in encrypted messages, to be able
to break subsequent ones by applying a straightforward decryption
algorithm
– Attempt to infer some meaning without even breaking the
encryption, such as noticing an unusual frequency of
communication or determining something by whether the
communication was short or long
– Attempt to deduce the key, in order to break subsequent messages
easily
– Attempt to find weaknesses in the implementation or
environment of use of encryption
– Attempt to find general weaknesses in an encryption algorithm,
without necessarily having intercepted any messages
Cryptoanalysis
• The objective of attacking an encryption system is to recover the key in use
rather then simply to recover the plaintext of a single ciphertext
• There are two general approaches to attacking a conventional encryption
scheme: Cryptoanalysis and Brute-force-attack
• Cryptanalysis: Cryptanalytic attacks rely
• on the nature of the algorithm plus
• Some knowledge of the general characteristics of the plaintext
• Some sample plaintext ciphertext pairs.
• This type of attack exploits the characteristics of the algorithm to attempt to
deduce a specific plaintext or to deduce the key being used
Cryptoanalysis
Cryptography is characterised by
• Only relatively weak algorithms fail to withstand a
ciphertext-only attack.
• Generally, an encryption algorithm is designed to withstand a
known-plaintext attack.
• Therefore, all that the encryption algorithm should meets one
or both of the following criteria:
– The cost of breaking the cipher exceeds the value of the encrypted
information.
– The time required to break the cipher exceeds the useful lifetime
of the information.
Cryptoanalysis
• Brute-force attack: The attacker tries every possible
key on a piece of ciphertext until an intelligible
translation into plaintext is obtained.
• On average, half of all possible keys must be tried
to achieve success
• If either type of attack succeeds in deducing the key,
the effect is catastrophic: All future and past
messages encrypted with that key are compromised.
How much time is involved for various
key spaces
Data Encryption Standard (DES)
Basics
• Goal of DES is to completely scramble the data and
key so that every bit of cipher text depends on every
bit of data and ever bit of key
• DES is a block Cipher Algorithm
– Encodes plaintext in 64 bit chunks
– One parity bit for each of the 8 bytes thus it reduces to
56 bits
• It is the most used algorithm
– Standard approved by US National Bureau of Standards
for Commercial and nonclassified US government use in
1993
Encryption Algorithm
Summary
• Project Work
Encryption
Symmetric Algorithms
• Algorithms in which the key for encryption and
decryption are the same are Symmetric
– Example: Caesar Cipher
• Types:
1. Block Ciphers
– Encrypt data one block at a time (typically 64 bits, or 128 bits)
– Used for a single message
2. Stream Ciphers
– Encrypt data one bit or one byte at a time
– Used if data is a constant stream of information
Symmetric Encryption
Key Strength
• Strength of algorithm is determined by the size of the key
– The longer the key the more difficult it is to crack
• Key length is expressed in bits
– Typical key sizes vary between 48 bits and 448 bits
• Set of possible keys for a cipher is called key space
– For 40-bit key there are 240 possible keys
– For 128-bit key there are 2128 possible keys
– Each additional bit added to the key length doubles the security
• To crack the key the hacker has to use brute-force
(i.e. try all the possible keys till a key that works is found)
– Super Computer can crack a 56-bit key in 24 hours
– It will take 272 times longer to crack a 128-bit key
(Longer than the age of the universe)
Symmetric Encryption
Limitations
• Any exposure to the secret key compromises secrecy
of ciphertext
• A key needs to be delivered to the recipient of the
coded message for it to be deciphered
– Potential for eavesdropping attack during transmission of
key
Asymmetric Encryption
Basics
• Uses a pair of keys for encryption
– Public key for encryption
– Private key for decryption
• Messages encoded using public key can only be decoded by
the private key
– Secret transmission of key for decryption is not required
– Every entity can generate a key pair and release its public key
David’s
Bob’s Bob’s
Trudeau Public Key
Message Encrypted
Cipher David
+ Public key (Middle-man)
Message
Trudeau’s David’s
Trudeau’s Trudeau’s
New Message Message
Encrypted Cipher Encrypted Cipher
+ public key + public key
Message Message
Asymmetric Encryption
Session-Key Encryption
• Used to improve efficiency
– Symmetric key is used for encrypting data
– Asymmetric key is used for encrypting the symmetric key
Send to Recipient
Encrypted
Cipher
Key
(RSA)
Session Key
Bob’s Cipher
Public Key (DES) Alice and Bob
Bob’s Session Key Generate Same
Private Key
Session Key!
Alice’s Cipher
Public Key
(DES)
Asymmetric Encryption
Key Diffie-Hellman Mathematical Analysis
Bob & Alice
agree on non-secret
Bob prime p and value a
Alice
Message
Message Digest
Digest
Algorithm
Message Authentication Codes
Basics
• A message digest created with a key
• Creates security by requiring a secret key to be
possesses by both parties in order to retrieve the
message
Message
Message Digest Digest
Algorithm
Secret Key
Password Authentication
Basics
• Password is secret character string only known to user and
server
• Message Digests commonly used for password authentication
• Stored hash of the password is a lesser risk
– Hacker can not reverse the hash except by brute force attack
• Problems with password based authentication
– Attacker learns password by social engineering
– Attacker cracks password by brute-force and/or guesswork
– Eavesdrops password if it is communicated unprotected over the
network
– Replays an encrypted password back to the authentication server
Authentication Protocols
Basics
• Set of rules that governs the communication of data related to authentication
between the server and the user
• Techniques used to build a protocol are
– Transformed password
• Password transformed using one way function before transmission
• Prevents eavesdropping but not replay
– Challenge-response
• Server sends a random value (challenge) to the client along with the authentication
request. This must be included in the response
• Protects against replay
– Time Stamp
• The authentication from the client to server must have time-stamp embedded
• Server checks if the time is reasonable
• Protects against replay
• Depends on synchronization of clocks on computers
– One-time password
• New password obtained by passing user-password through one-way function n times
which keeps incrementing
• Protects against replay as well as eavesdropping
Authentication Protocols
Kerberos
• Kerberos is an authentication service that uses symmetric key
encryption and a key distribution center.
• Kerberos Authentication server contains symmetric keys of all
users and also contains information on which user has access
privilege to which services on the network
Authentication
Personal Tokens
• Personal Tokens are hardware devices that generate unique
strings that are usually used in conjunction with passwords for
authentication
• Different types of tokens exist
– Storage Token: A secret value that is stored on a token and is
available after the token has been unlocked using a PIN
– Synchronous one-time password generator: Generate a new
password periodically (e.g. each minute) based on time and a secret
code stored in the token
– Challenge-response: Token computes a number based on a
challenge value sent by the server
– Digital Signature Token: Contains the digital signature private key
and computes a computes a digital signature on a supplied data value
• A variety of different physical forms of tokens exist
– e.g. hand-held devices, Smart Cards, PCMCIA cards, USB tokens
Authentication
Biometrics
• Uses certain biological characteristics for
authentication
– Biometric reader measures physiological indicia and
compares them to specified values
– It is not capable of securing information over the
network
• Different techniques exist
– Fingerprint Recognition
– Voice Recognition
– Handwriting Recognition
– Face Recognition
– Retinal Scan
– Hand Geometry Recognition
Authentication
Iris Recognition
The scanning process takes advantage of the
natural patterns in people's irises, digitizing them
for identification purposes
Facts
• Probability of two irises producing exactly the same
code: 1 in 10 to the 78th power
• Independent variables (degrees of freedom)
extracted: 266
• IrisCode record size: 512 bytes
• Operating systems compatibility: DOS and
Windows (NT/95)
• Average identification speed (database of 100,000
IrisCode records): one to two seconds
Authentication
Digital Signatures
• A digital signature is a data item which accompanies or is
logically associated with a digitally encoded message.
• It has two goals
– A guarantee of the source of the data
– Proof that the data has not been tampered with
Sender’s Sender’s
Private Key Public Key
Message Digest Digest Message
Sent to Algorithm Algorithm Digest
Receiver
Same?
Digital
Message Signature Signature Signature Message
Digest Algorithm Sent to Algorithm Digest
Receiver
Sender Receiver
Authentication
Digital Cerftificates
• A digital certificate is a signed statement by a trusted party that another
party’s public key belongs to them.
– This allows one certificate authority to be authorized by a different authority
(root CA)
• Top level certificate must be self signed
• Any one can start a certificate authority
– Name recognition is key to some one recognizing a certificate authority
– Verisign is industry standard certificate authority
Identity
Information
Signature
Sender’s Certificate
Algorithm
Public Key
Certificate
Authority’s
Private Key
Authentication
Cerftificates Chaining
• Chaining is the practice of signing a certificate with another private key
that has a certificate for its public key
– Similar to the passport having the seal of the government
• It is essentially a person’s public key & some identifying information signed
by an authority’s private key verifying the person’s identity
• The authorities public key can be used to decipher the certificate
• The trusted party is called the certificate authority
Signature
Certificate New Certificate
Algorithm
Certificate
Authority’s
Private Key
Cryptanalysis
Basics
• Practice of analyzing and breaking cryptography
• Resistance to crypt analysis is directly proportional to the key
size
– With each extra byte strength of key doubles
• Cracking Pseudo Random Number Generators
– A lot of the encryption algorithms use PRNGs to generate keys
which can also be cracked leading to cracking of algorithms
• Variety of methods for safe guarding keys (Key Management)
– Encryption & computer access protection
– Smart Cards