Lecture 7
Lecture 7
Lecture 7
and
Asymmetric
Cryptography
Lecture 7
Hash functions
Content Asymmetric key cryptography
Encryption protects against passive attack (eavesdropping)
Authentication
Message authentication is a procedure to allow parties to verify
that received message is authentic (content is not altered and
source is authentic).
Message authentication is concerned with :
protecting the integrity of a message (or data)
validating identity of originator
non-repudiation of origin (dispute resolution)
HASH Message digest depends on all the bits in the input message
Any alteration of the input message during transmission would
FUNCTION? cause its message digest to not match with its original message
digest.
DIFFERENT
WAYS TO USE
HASHING FOR
MESSAGE
AUTHENTICA
TION
Continued..
All algorithms for computing the hashcode of a message view the
message as a sequence of n-bit blocks. The message is processed
one block at a time in an iterative fashion in order to generate its
hashcode
SIMPLE HASH
FUNCTIONS
Hash function: A transformation of a message of arbitrary length
into a fixed-length number
h = H (M)
No secret key
One-way Hash Hash function creates a fingerprint (message digest) of a message
Function
Used to detect changes to message
usually assume hash function is public
one-way property
collision free (no same hash for two different data)
Good for data integrity, but useless for security
WHEN IS A
A hash function is called cryptographically secure if the following
HASH two conditions are satisfied:
It is computationally infeasible to find a message that corresponds
FUNCTION to a given hashcode. This is sometimes referred to as the one-way
property of a hash function
CRYPTOGRAP It is computationally infeasible to find two different messages that
HICALLY hash to the same hashcode value. This is also referred to as the
strong collision resistance property of a hash function.
SECURE
Hash
Functions
Requirements
One-way Hash
Example
Most secure hash functions are based on the structure proposed
by Ralph Merkle in 1979. This structure forms the basis of MD5,
Whirlpool and the SHA series of hash functions.
The input message is partitioned into L number of bit blocks, each
of size b bits. If necessary, the final block is padded suitably so that
it is of the same length as others.
The final block also includes the total length of the message
Structure of whose hash function is to be computed.
Hash takes two inputs, the b bit block of the input message meant for
that stage and the n-bit output of the previous stage.
For the n-bit input, the first stage is supplied with a special n-bit
pattern called the Initialization Vector (IV).
The function f that processes the two inputs, one n bits long and
the other b bits long, to produce an n bit output is usually called
the compression function.
Merkle’s
structure
SHA (Secure Hash Algorithm) refers to a family of NIST-approved
cryptographic hash functions.
The following table shows the various parameters of the different
SHA hash functions.
The SHA The algorithms SHA-256, SHA-384, and SHA-512 are collectively
Family of Hash referred to as SHA-2.
SHA-1 is a successor to MD5 that was a widely used hash function.
Functions
Also known as asymmetric-key cryptography, to distinguish it
from the symmetric-key cryptography
Encryption and decryption are carried out using two different
PUBLIC-KEY keys. The two keys in such a key pair are referred to as the public
key and the private key.
CRYPTOGRAP Its is based on mathematical functions rather than on simple
HY operations in symmetric encryption.
Like symmetric key, its security depends on the length of key
and computational work into breaking the cipher .
Encryption/decryption: sender encrypts a message with the
recipient’s public key.
Application of
Digital signature: the sender signs the message with private key.
Public-key
Key exchange: Two sides cooperate to exchange a session key.
The processing steps undertaken by A to convert M into its
encrypted form C that can be placed on the wire are:
C = E (PUB, E (PRA, M))
where E() stands for encryption. The processing steps undertaken
by B to recover M from C are
Application of M = D (PUA, D (PRB, C))
Public-key where D() stands for decryption.
The sender A encrypting his/her message with its own private key
PRA provides authentication. This step constitutes A putting
his/her digital signature on the message.
The sender A further encrypting his/her message with the
receiver’s public key PUB provides confidentiality.
Price paid for achieving confidentiality and authentication at the
same time
four times in all for encryption/decryption.
The message goes through two encryptions at the sender’s place
and two decryptions at the receiver’s place.
Each of these four steps involves separately the computationally
complex public-key algorithm.
Application of IMPORTANT: Note that public-key cryptography does not make
Public-key obsolete the more traditional symmetric-key cryptography.
Because of the greater computational overhead associated with
public-key crypto systems, symmetric-key systems continue to be
widely used for content encryption. However, public-key
encryption has proved indispensable for key management, for
distributing the keys needed for the more traditional symmetric
key encryption/decryption of the content, for digital signature
applications, etc.
RSA and Diffie-Hellman are two most important public-key
Public-key algorithms.
Algorithms
Algorithm Encryption/D Digital Key
ecryption signature exchange
RSA Yes Yes Yes
Diffie- No No Yes
Hellman
Consider Nick and Connie
Diffie – They share arbitrary number G
Hellman Key Each Nick and Connie have their secret keys:
Exchange Nick : n
Connie : c
Idea!
Log Problem
Problem!
Discreet Log
Problem
Diffie –
Hellman Key
Exchange
Thank you Questions!!!