Public Algo Authentication Etc
Public Algo Authentication Etc
Public Algo Authentication Etc
The number of primes is infinite. Still it is difficult to find out number of primes smaller
than or equal to a given number n (consider n as large number)
Next, we discuss two theorems namely, Fermet’s theorem and Euler’s theorem that are
considered important in public key cryptography.
Suppose a number ‘q’ can be factored as p1e1 p2e 2 .... pkek then (iii) and (iv) can be
combined as Φ(q) = ( p1e1 p1e1 1 ) ( p2e2 p2e2 1 ) .....( pkek pkek 1 )
In second last example factoring Φ(49) as Φ(7) x Φ(7) is not correct as 7 is not relatively
prime to 7. Hence, rule 3 is not applicable.
where, a is an integer and p is a prime and p does not divides a i.e., a and p are
relatively prime to each other.
Use – Fermat’s little theorem is useful in finding quickly some exponentiation and
multiplicative inverses.
Uses [1]:-
(i) Finding of some exponentiations
Example 11: 2062 mod 77 = (20 mod 77) (20Φ(77)+1 mod 77)
= (20) (20) mod 77 = 15
Example 12: 60-1 mod 187 = 60 Φ(187)-1 mod 187 = 60159mod 187 = 53 mod 187
Order of an Element
Order of an element is represented as ord(a) and is defined as the smallest integer i such
that
ai ≡ e (mod n)
where, e is identity element equal to 1.
Corresponding elements: 1, 3, 5, 7.
Order of each element (by trial and error) using above definition.
a. 11 ≡ 1 mod (8) → ord(1) = 1.
b. 32 ≡ 1 mod (8) → ord(3) = 2.
c. 52 ≡ 1 mod (8) → ord(5) = 2.
d. 72 ≡ 1 mod (8) → ord(7) = 2.
Euler’s Theorem
States that for any member of group G = <Zp∗, ×> the following holds:
aΦ(n) ≡ e (mod n) – (3)
comparing equation (3) with order of group, it can be found that the relation ai ≡ 1 (mod
n) holds when i = Φ(n). thus, it is ensured that atleast one order of element exists.
Example 15: Find order of all elements in the group G = <Z6∗, ×>
The table (Table 2) for r = ai (mod 6) is drawn with shadded area identifying r = 1 for i =
Φ(6) = 2.
Similarly, r = 1 for other values of i for every member element of the group. Considering
smallest i for every member element, we have their orders as:
Ord(1) = 1, ord(5) = 2
Primitive Roots: In the group G = <Zn∗, ×>, an element whose order is equal to Φ(n), is
called the primitive root of the group.
Example:
1. In G = <Z8∗, ×> (example 14), no primitive roots are there because none of the
element’s order is equal to Φ(8) = 4. Infact, the order of elements are all smaller than
4.
2. For group G = <Z10∗, ×> Φ(n) = 4. The results of ai ≡ r (mod 10) along with primitive
roots are shown in Table 3
Answer: G = <Z13∗, ×> ; <Z26∗, ×> ; and G = <Z98∗, ×> have primitive roots as in first
group n=13 is prime, in second group n=26 can be expressed as 2 × 13 and in third group
n = 98 can be expressed as 98 = 2 × 72.
Example 17:
Find the primitive roots in G = <Z7*, ×> and show that the entire set can be generated from
them.
Answer: Φ(Φ(n)) = Φ(Φ(7)) = Φ(6) = 2. Hence, two primitive roots 3 and 5 are possible.
These can generate the entire set as shown below (Table 4):
If n = p then group G = <Zp*, ×> is cyclic as it always has a primitive root and is
hence considered in discrete logarithms.
Elements in this group include all integers from 1 to p − 1.
The elements can be created using gx where, g are primitive roots or generator and x
is an integer from 1 to Φ(n) = p − 1.
In modular arithmetic discrete logarithms are used to solve the problems of the form y =
ax (mod n) in which y is given and x is needed to be solved.
In this table, a particular value of y and g (or base a) is searched to solving the x.
Answer: The tabulation (Table 5) of discrete logarithm for the group G = <Z5*, ×> is done
below:
Here, y = 3, g (or a) = 2
x = L23 mod 5 = 3.
Some of the useful properties of discrete logarithms may be stated (Table 6) as:
Applications
Applications (use) for public key cryptosystem falls under following three categories.
Encryption/Decryption – Use of public key encryption for providing confidentiality.
Encryption is done using receiver’s public key while decryption is done using
receiver’s private key.
Digital Signature – Use of public key encryption for providing message and user
authentication. Usually a small sized data is derived as a function of message and
then it is encrypted using sender’s private key so as to represent signature.
Key Exchange – Use of public key encryption for exchanging and deriving session
keys. This may involve private keys of both parties (Diffie-Hellman method).
Table 62 – lists the algorithms of public key cryptography that uses all three, two or single
of the above mentioned functionalities.
Requirements
Public key cryptography utilizes two related keys. The public key cryptographic
algorithms must fulfill the following conditions:-
1) It is computationally easy
(i) by a party (say Veeru) to generate a key pair (KV, PV)
(ii) to generate ciphertext (C) from plaintext (P) by other party (say Jai) using public
key of first party as
C EPV (M )
(iii)To decrypt the ciphertext to get back the plaintext as
M DKV (C ) DKV ( EPV (M ))
2) The private and public keys can be applied in any order as
M DKV ( EPV (M )) DPV ( EKV (M ))
3) It is computationally infeasible for an attacker (say Gabbar) to find (i) the private key
(KV), (ii) the plaintext (M) using ciphertext (C) and public key (PV)
The above requirement reduces itself to the need for a trap-door one-way
function.
A one way function is one that itself is easy to calculate but finding its inverse is
infeasible.
i.e. Y = f (x) is easy, while X = f-1 (y) is infeasible.
where, X is domain of function and Y is its range.
A function is easy to calculate means computations can be done in polynomial
time i.e., na, where n is input of n bits and a is a constant.
Here, infeasible to calculate means it requires time much larger than polynomial
time e.g. of the order of 2n.
A trap door one way function is one for which finding inverse is feasible (may
be calculated in polynomial time) provided some additional information is
known i.e., for a trapdoor K, calculating inverse
X f K1 ( y) is easy.
The traditional notion of best case/worst case complexity is not followed in case
of cryptography. In cryptography infeasible to compute means it is infeasible for
all input irrespective of best or worst case input.
Diffie and Hellman’s introduction of Public key cryptography in 1976 paved the path for
development of one of the most widely accepted and general purpose public key
encryption method (in 1977) at MIT by Ron Rivest, Adi Shamir, and Len Adleman. This
method is popularly known as Rivest-Shamir-Adleman (RSA) scheme. It is a block cipher
in which the block size is taken as 1024 bits.
Description
The RSA algorithm has three components: key generation, encryption and decryption.
Each of these is described below:
Key generation
1. Select two large prime numbers p and q (p q)
2. Calculate n = p × q
3. Calculate (n) = (p – 1) (q – 1)
4. Select an integer e (≤ (n)) such that it is relatively prime to (n) (Euler totient
function) i.e., gcd ((n), e) = 1
5. Calculate multiplicative inverse of e (name it as d) as:
d e-1 (mod (n))
{e, n} becomes the public key while {d, n} becomes the private key
Encryption
Consider plaintext as M
Then ciphertext (C) is evaluated using public key (e, n) and exponentiation as:
C = Me mod n
Decryption
Plaintext M is gained using private key (d, n) as:
M = Cd mod n
Figure 5 shows the complexity of encryption and decryption in RSA algorithm whereas
Figure 6 shows the encryption, decryption and key generation process.
Gabber
P:Plaintext = e C mod n
C Exponential complexity
C: Ciphertext = P e mod n
Polynomial complexity
Jai Veeru
P P
Select p, q
n=p×q
Veeru Select e and d
Jai
d
e
Decryption P = C mod n
Encryption C = P mod n
Example 1:
Apply RSA algorithm for encrypting message m=10
Consider primes p=11, q=3.
Answer:
n = p*q = 11*3 = 33
z = (p-1)(q-1) = 10*2 = 20
Choose d=7
Compute ‘e’ such that 7*e = 1 mod 20
e =3
Public key = (n, e) = (33, 3)
Private key = (n, d) = (33, 7).
Decryption
m' = cd mod n = 107 mod 33 = 10000000 mod 33 = 10 (plaintext)
Figure 7 shows another example (self explanatory) where the sender wants to send
message NO. For this purpose he maps alphabets to numbers 00 to 25.
Jai Veeru
Proof:
C = Me mod n
Message can be obtained back as:
M = Cd mod n = (Me)d mod n = Med mod n ( ed mod (n) = 1)
Security
RSA may be targeted using any of the following four methods:
1. Brute force – Under this category, attacker tries all possible combinations for private
keys. Thus, RSA must use large key space i.e. increase key size. In RSA, a complex
key generation method is used. Also encryption/decryption depends upon key size.
Thus, upon increasing key size, the system will become slow i.e., processing with
large key will consume extra time.
3. Timing attacks – In these attacks, attacker observes the time taken by computer to
decrypt the messages. The observations are then used to determine the private key .
These are ciphertext only attacks.
The attacker starts from left - bit by bit. If the particular iteration for decrypting
a single bit is slow, the bit is assumed to be 1.
If the particular iteration for decrypting a single bit is fast, the bit is assumed to
be 0.
Thus, variation in execution time is utilized for breaking RSA.
The following countermeasures are utilized to dampen the effect of timing
attacks.
(i) Ensuring that all exponentiation steps take equal amount of time (constant
exponentiation time method). This method degrades the performance.
(ii) Addition of random delay for confusing the attacker. This is not much
effective as the attacker can take additional measures to compensate the
added random delays.
(iii)Blinding – This method is used by RSA data security and in this method
ciphertext is multiplied with a random number before going for
exponentiation. Blinding adds to computation and therefore has associated
performance issues.
RSA data security considers finding method as follows:
a) A secret random number (r) is generated such that 0 < r < n-1
b) Multiply ciphertext by r (Blinding) as
C = C (re) mod n where, e is public exponent
c) Decrypt ciphertext as
M = (C )d mod n
d) Calculate plaintext as
M = M r-1 mod n
Where r-1 is multiplicative inverse of r mod n
(ii) Use of Public Directory- A third party maintains a public directory that keeps
public keys of all users (Figure 9). This organization keeps entries of the form
{name, public key} for each user. For keeping entry and for updating later, each
user registers either in person or through secure authenticated communication.
The entry may be changed dynamically later or upon getting the key
compromised. For updation, authentic communication between user and public
directory is required. In case the private key of the directory gets compromised,
the attacker may impersonate any user, eavesdrop on messages and may even
modify the directory records.
PA
PB
Directory of public keys
PC
Public-key
Initiator A Responder B
authority
1. Request || Time1
3. EPB ( IDA || N1 )
4. Request || Time2
6. EPA ( N1 || N 2 )
7. EPB ( N 2 )
(iv) Use of certificates- The previous two schemes have drawbacks. The public
directory is vulnerable to tampering while public-key authority being central to
the system must be able to handle large user requests for public keys. It may
become bottleneck as whenever a communication is required it is contacted for
user’s public key.
The concept of public certificates issued by central authority proves useful under
such conditions. A public key is extracted from certificate whenever
communication is required. The authority need not be contacted every time for
public key. This reduces load on authority. Also, as the certificate is signed by
authority it is reliable and can be trusted. The certificate contains name &
identifier of owner of public key, time of creation of certificate and public key
itself. The certificate authority is a trusted third party (usually government
organization). A user submits its public key through secure communication
medium to authority, authority in turn creates and signs corresponding
certificate. This certificate is published in a public repository or database.
Anybody can obtain this certificate and verify the contents and authority’s
signature using public key of the authority.
Certificate
Initiator A Responder B
Authority
IDA || PA
C A EK auth (Time1 || IDA || PA )
IDB || PB
(1) CA
(2) CB
The entire process is shown in Figure 11. The scheme has following steps:
(i) Each participating user submits the request for certificate to the authority.
The request contains identifier and public key.
(ii) The certificate authority issues a certificate as
CA EK Auth (T ¦¦IDA ¦¦PA )
Here, T is the Timestamp of generation of certificate
KAuth is the private key of certificate issuing authority
(iii)This certificate is given to the other corresponding communicating user.
The user may verify the certificate and extract public key of user A as
DPAuth (CA ) DPAuth ( EK Auth (T ¦¦IDA ¦¦PA )) T ¦¦IDA¦¦PA
Thus, T ensures that the certificate is current and prevents replays of old
certificates. The certificates with old timestamps are considered as
expired. PA is the desired public key of user with IDA.
Initiator A Responder B
1. PA || IDA
2. EPA ( K S )
Generates K S
Data packets protected using K S
Initiator A Responder B
1. EPB ( N1 || IDA )
2. EPA ( N1 || N 2 )
3. EPB ( N 2 )
4. EPB [ EK A ( K S )]
First, let us discuss a simple key distribution mechanism shown in Figure 12. The
communication is done between A and B using following steps.
(i) A generates public key pair, keeps private key with itself and sends ID A
(identifier A) and PA (public key of A) to B.
(ii) B generates secret key for session (KS), encrypts using A’s public key and sends
it back to A as
EPA ( KS )
(iii)A decrypts the message as
DK A ( EPA ( KS ))
and obtains secret session key (KS). Now, both A and B have shared and similar
secret keys.
(iv) A and B starts communicating using KS while discarding the public keys.
A second method that shares the symmetric encryption key and maintains confidentiality
and authentication is proposed by Needham and Schroeder (Figure 13). In this method,
both the parties share random numbers (nonce N1 and N2). The following steps are
involved in this method.
(i) A sends IDA and a nonce (N1) encrypted using B’s public key.
(ii) B extracts N1 and then reply by keeping both N1 and a new nonce (N2) into reply.
The reply is encrypted using A’s public key. The receipt of N1 at A ensures that B
has correctly received previous message and A is infact communicating with B.
(iii)A decrypts and extracts N2. This N2 is encrypted with public key of B and then send
to B. This is to confirm B that it is infact communicating with A.
(iv) A selects secret encryption key KS and encrypts it twice: using public key of B (PB)
to ensure only B can retrieve it and using its own private key (KA) as
C EPB ( EK A ( KS ))
(v) B decrypts the ciphertext message to gain the secret key.
A hybrid approach that uses Key Distribution Centre (KDC) for distributing secret key is
also used. In this scheme, KDC shares secret master key with each of its users. KDC
evolves secret session keys and send them encrypted with master keys to the users. The
session keys are distributed frequently. Use of public key encryption/decryption for their
distribution could cause computation issues. Hence, public key encryption is limited to
update master key that is not changed so frequently. As this scheme uses KDC, it should
be backward compatible with existing KDC mechanism and involve minimal changes.
Jai Veeru
1. Generate a random number Generate a random number
XJ < q XV < q
2. Calculate YJ α X J mod q Calculate YV α XV mod q
3. Exchange YJ Exchange YV
4. Calculate K (YV ) X J mod q Calculate K (YJ ) XV mod q
Consider q = 23, α = 5
Insecure Channel
Calculations by Jai: Calculations by Veeru:
Private Key XJ=6 XV=15
Public Key YJ=56 mod 23
= 8 mod 23
23, 5, 8
YV=515 mod 23
19 19 mod 23
Calculate K JG (YG1 ) X J mod q KGJ (YJ ) XG1 mod q KVG (YG 2 ) XV mod q
It can be easily seen that KJG = KGJ and KGV = KVG. Hence, whatever message (M)
is sent encrypted by Jai (using KJG) is intercepted and decrypted by Gabbar (using
KGJ). Gabbar reads the message and again encrypts it (using KGV) before sending it
to Veeru. Upon receipt, Veeru decrypts the message M (using KVG).
Thus, the middle man, Gabbar is able to read the encrypted message without letting
this fact known to Jai or Veeru.
The Diffe-Hellman key exchange protocol is prone to MitM attacks because it lacks
user authentication. This can be overcome by using digital signatures and public-key
certificates.
REQUIREMENTS OF AUTHENTICATION
The following are the authentication requirements imposed during communication of
message(s) between sender and receiver.
(i) The received message should be send only by the alleged sender i.e., message and the
acknowledgements from fraudulent source are never accepted.
(ii) The message has not been altered on the way i.e., insertion, deletion, transformation
and modification of message contents is not possible.
(iii)The sequencing of messages or its parts is maintained i.e., it is not possible for the
attacker to change the sequencing.
(iv) The delayed or replayed messages must not be accepted i.e., modification in timings
of message is not possible. Thus, a message cannot be accepted beyond a particular
time limit.
(v) Non repudiation of source (sender) is ensured i.e., a source may never deny sending
of message.
(vi) Non repudiation of destination (receiver) is ensured i.e., destination cannot deny
receipt of message.
AUTHENTICATION FUNCTIONALITY
Authentication of message involves two steps:
(i) Creation of a value (termed as authenticator) that is used to authenticate the message.
(ii) Verification of authenticator by receiver.
Out of all possible bit combinations only small subset may be considered as legitimate e.g.,
out of all possible combination only few qualify as per ordinary English language. Thus,
the problem of determining that a given cipher text decrypts to intelligible plaintext is
difficult. The difficulty level get raise if the plaintext considered for encryption is in binary
format/file.
This provides ample opportunities to the attacker for disrupting or interfering decryption
process at receiver by sending forged random messages that appears as encrypted messages
from legitimate users.
Veeru
Decrypted from
Jai Message encoded using Caesar Jai’s message Decrypted from
cipher (key =3): Gabbar’s message
Meaningful
Hqhpb zloo uhdfk vrrq Meaningless
(Accept)
(Discard)
Thus, a structure is required to be added to the transmitted message that enhances the
authentication capabilities for example, addition of check sum or Frame Check Sequence
(FCS) as error control measure to the message M and then encrypting the complete block
(Figure 3 (a)) strengthens authentication. The receiver first decrypts the message using
shared secret key and then calculates FCS from decrypted message.
If the calculated FCS matches with the FCS contained in the encrypted message, the
message (plaintext) is considered as authentic. If the attacker tries to disrupt the decryption
process by sending random message for decryption then it is unlikely that such relationship
between decrypted message M and FCS prevail and hence attacker’s messages are easily
discarded. If instead of this above mentioned scheme (termed as internal error control)
another scheme (termed as external error control) is used where the FCS is calculated by
sender for the encrypted message and is concatenated with the encrypted message (Figure
3 (b)), the attacker again has opportunity to disrupt or interfere the decryption process. This
is because the attacker can now create forged messages with valid FCS and may direct them
towards receiver.
Another example where structuring adds towards enhancing the authentication capabilities
is TCP segment encryption. The TCP segment is encapsulated in IP datagram and the part
of datagram excepting IP header is encrypted. The TCP header information includes
checksum, sequence number etc. In case the attacker tries to create and send a forged
datagram, the resulting encrypted text (containing TCP header information) will become
meaningless and therefore leading to discarding of such forged datagrams.
* Take message M * Decrypt using key (K)
* Apply function F EK [ M || F ( M )] * Apply F to M
to M and append * Compare F(M) with the
Sender A F(M) to M one kept along with M Receiver
* Encrypt M || F(M) B
using key (K)
(a) Internal error control
In Public-key Encryption each sender and receiver has two key pairs (private and public
key). Thus, there are two possibilities (Figure 1 (b), Figure 1 (c)). (i) Sender uses public
key of the receiver for encryption of message M (ii) sender uses its own private key for
encryption of message M. The former ensures only confidentiality while latter ensures
authentication and signature. This is because in (i) above anybody can send encrypted
message but only the intended receiver is able to decrypt the message as only he has his
private key. In (ii) above only the sender can encrypt the message M using his private key
while others are able to verify this by decrypting using corresponding public key. Here, the
encrypted ciphertext becomes digital signature because only sender A owns his private key
( 𝐾𝐴 ) not even receiver B has any idea about this. This scheme does not provide
confidentiality as anyone who posses public key of the sender can decrypt the encrypted
message. Figure 1 (d) illustrates the public-key encryption scheme that provides both
confidentiality and authentication. Hence, first sender encrypts M using his private key
( K A ) . This becomes its signature and used for authentication and is then encrypted using
receiver’s public key to ensure confidentiality. The major drawback in this scheme as
compared to symmetric method is requirement of more calculations. Here, the public key
encryption is applied 2 times and public key decryption is applied. 2 times making count as
four whereas in symmetric method only one encryption and one decryption is required.
* Take message M *Apply MAC function C
* Apply MAC M || CK ( M ) that utilizes key K to M
function C that * Compare C ( M ) with
K
Sender A utilizes key K to M the one kept along with Receiver
and appendC ( M ) M B
K
to M
(a) Message authentication
(b)
Among these above mentioned hash techniques, (ii) and (iii) are popular, though they do not
involve encryption. This is due to following;
Encryption using software is relatively slow as compared to encryption using
hardware.
Hardware used for encryption is usually optimized for large sized data. Hence, due to
the initialization (startup) cost, small encryption is not effective on such hardware.
Hardware cost for several systems cannot be considered as negligible.
Algorithms for encryption (e.g. RSA algorithm) are usually patented and therefore
cost is involved for attaining licenses.
Define MAC as
Δ(M) = X1 X2 …. Xm
CK(M) = EK (Δ(M)) - (1)
Where, E is encryption algorithm (DES in electronic code book mode); K is secret
Key; and is Exclusive OR (XOR) operation.
Instead of Brute force attack, attacker opted for fraud insertion and created Ym by
replacing X1 to Xm-1 by new desired values Y1 to Ym-1.
Ym = Y1 Y2 …… Ym-1 Δ(M) - (2)
Received Δm = Y1 Y2 ……. Ym {Substitute Ym from (2)}
= ΔM
Thus, hash of Δm is same as per eqn. (1) above and therefore new message (Y1 ¦¦ Y2
¦¦…..Ym-1) is inserted and still M accepted by receiver.
This should not happen and requirement (i) should be followed by MAC authenticator.
The requirement (ii) deals with protecting against brute-force attack. Consider, key
size (K) > MAC size (n).
As MAC function is many-to-one, for applying brute-force attack, attacker must try
different key values (Ki) such that
In case K n, the first round may produce a match. Thus, efforts required to find the
authentication key is not less than the efforts required to find the decryption key and
the key may be found in Ist round itself.
The requirement (iii) says that existence of weak spots (where algorithm proves to be
weak) in M should be avoided otherwise the attacker may easily get early success in
identifying new message (M′) such that hash of M and M′ are equal.
Outputi-1
+ OutputN-1 +
Outputi OutputN
Output1
(64 bits) (64 bits) (64 bits)
DAC =16 to 64 bits of OutputN
(i) Initial
Result = 0
Block I
(ii) Rotate Result (Hash
Value) left by 1 bit
Block II
.
.
.
Block N (iii) XOR rotated Result
with current block and
store it back into Result
Result
Repeat steps (ii) & (iii) till all
th
i Result bit = N blocks have been XORed
XORing of ith bit of
all blocks
(a) Hash function using XOR (b) Hash function using XOR with
rotation
Figure 7 Two simple Hash function (one using XOR other using XOR with rotation)
Below two simple hash functions are presented to enhance the understandability [3].
(1) Hash function (Figure 7(a)) that performs bit-by-bit XoRing of every block to
produce single bit of hash code (Ci) as:
Ci = bi1 bi2 …. bim
where
m = number blocks (each block is of n-bit size)
bij = ith bit of jth block
The above function is effective for data integrity check. It provides parity for each
bit and is known as longitudinal redundancy check.
The function is less effective where data is predictably formatted e.g. in normal
text files, the MSB in each octet is always zero. For 128 bit hash code effectiveness
should be 2-128 but in the normal text file case it is 2-112 as 16 bit positions evaluates
to zero hash code.
Thus a method to randomize the input is required.
(2) Hash function that shifts one bit in circular fashion on hash code after each block is
processed (Figure 7(b))
It has two steps
(i) n – bit hash code is initialized to zero.
(ii) For each n – bit block of data:
Rotate the hash code left then XoR it with block bits and store it back into hash
code.
This hash function is still of not much use even when encrypted hash code is used
along with the message because it is easy to prepare alternate message which still
evaluates same hash code.
Another technique that encrypts message and hash code is as:
Compression function f
For initializing these registers square roots of first eight prime numbers is
calculated and the first 64 bits corresponding to fractional part of each root is
assigned to these registers in big endian format (where MSB corresponds to
leftmost byte position). Thus initial values (in hexadecimal) of these registers
during first block processing are [3]:
a = 6A09E667F3BCC908
b = BB67AE8584CAA73B
c = 3C6EF372FE94F82B
d = A54FF53A5F1D36F1
e = 510E527FADE682D1
f = 9B05688C2B3E6C1F
g = 1F83D9ABFB41BD6B
h = 5BE0CDI9137E2179
The output of last round (80th round) is added with Hi-1 to produce final
Hi from this processing. Each of the eight registers (a, b, c, d, e, f, g
and h) are added independently using modulo 264 addition.
Step 5: After processing all blocks, the output Message Digest (MD) (of 512
bits) from Nth block processing represents the hash code or value
Hiding the round complexities, entire algorithm may be summed as:
HO = IV
Hi = SUM64 (Hi-1, abcdefghi)
MD = HN
where,
IV is the initial value of buffer (abcdefgh)
abcdefghi represents out of last round processing for ith message block
SUM64 represents addition in modulo 264 for each word.
MD represents final message digest or hash value
Mi
Mi (1024 bits)
Word by
H i - 1 (512 bits) word addition
F
mod 264 H i (512 bits)
i th message block processing
th
Output of 79 round is added to Hi - 1 to yield Hi
Figure 10 Single Block (1024 bit) Processing (SHA-512) corresponding to ith block
Digital signatures provide authenticity to message and to its originator. Considering two
party communication, authentication is either mutual or one-way. Therefore, discussion in
this section pertains to two categories: (1) Mutual authentication and (2) One-way
authentication.
First approach requires tracking of sequence numbers for each participant and due
to this overhead, sequence numbers are seldom used in authentication and key
exchange.
Second approach based on timestamp is useful in connectionless applications. It
cannot be used for connection oriented applications due to following reasons:
(i) Another protocol that requires synchronization among various processor
clocks is required. This protocol should be fault tolerant and secure.
(ii) If one of the party’s clock faults, there are chances of attack.
(iii)Precise synchronization is difficult due to variable and unpredictable network
delays.
))
D
A
¦¦ I
(K
S
B
K
¦¦ E
KDC
1
¦¦ N
¦¦ N
1
B
D
B
¦¦ ID
¦¦ I
(K
S
A
ID
A
K
)E
(2
(1)
A B
(3) E K b (K S ¦¦ ID A )
(4)EKS (N2 )
(5)KS ( f (N2 ))
Denning’s improvement:
Denning [5][6] suggested incorporating timestamp in steps 2 and 3 using
distributed clock mechanism to overcome the weakness of Needham and
Schroeder protocol. The entire communication is shown in Figure 4:
))
¦¦ T
D
A
¦¦ I
(K
S
KDC
B
K
¦¦ E
¦¦ T
B
¦¦ ID
D
B
¦¦ I
A
D
(K
S
(1)I
A
K
E
(2)
A B
(3)EKB (KS ¦¦ IDA ¦¦ T)
(4)EKS (N1 )
(5) K S f ( N1 )
Figure 4 Denning’s improvement
(2)
B
K
E
ID B
) ¦¦
¦¦ T
b
¦¦ N b
S
¦¦ K
¦¦ E K
a
¦¦ N
B
(ID
B
(ID
A
¦¦ N
A
A B
K
E
a
¦¦ T b
(3)
(1) ID A ¦¦ N a
)
(4)Ticket ¦¦ EK S (N b )
r
Pr
e
E
C
A T ) ¦¦
ate A ¦¦
B
ID
fic Pu
¦
Ce DA ¦
A
D
)I
S (I
(1
rti
A
Pr
)E
A B
(2
Pu = Public key
Pr = Private key
Another protocol (shown in Figure 8.7) proposed by Woo and Lam [8], does away
with clock synchronization issues and uses only nonces.
(5)
E Pr KDC Cer
KDC
( ID A fica
B B)
Pu
(4)
¦¦ P te A
t
ID A
rtif B ¦¦
i
u A)
e
Ce DC (ID
B
t
¦¦ I
ID
ica
DB
¦¦ E P
A ¦¦
K
¦¦ E P
Pr
ID
E
uB
(2)
( E Pr KD
(1)
KD u
C
(N a
C
(N a
)
(3)E ( N ¦¦ ID )
¦¦ K S
A Pu a BA
B
(6)EPu A ( EPrKDC ( N a ¦¦ K S ¦¦ IDB ) ¦¦ Nb ))
¦¦ ID
B
))
(7)EKS ( Nb )
KDC
b
K
¦¦ E
1
¦¦ N
1
¦¦ N
M : Contents of E-mail
B
D
B
¦¦ ID
¦¦I
S
(K
A
a
K
ID
)E
(2
(1)
A B
(3) EKb (KS ¦¦ IDA ) ¦¦ EK S ( M )
Figure 8 Use of symmetric encryption
This method does not protect against replays and use of timestamp may
improve the situation.
2. Authentication M ¦¦EPrA ( H (M ))
Digital Certificate
Table 2 Use of public key encryption
In (2), another user (adversary) may capture the message, calculate new hash and
encrypt message using his private key and deliver it to receiver. This should not
be permitted. Hence message M should be encrypted (also in 3 (ii)).
For encrypting message, one time session key may be used. This key is itself
encrypted using B’s public key before transmitting.
M || signature (r, s) M' || signature (r', s')
Sender A Receiver B
Output H s’ r’ Pu G Pu A y
Global
Global Public
Public KeyKey Components
Components ( P u G ) :: Prime Prime numbers
numbers pp
and
and q;
q; aa primitive
primitive number
number hh and and generator
generator gg based
based upon
upon itit
Sender’s
Sender’s Private
Private Key:
Key: xx random
random or or pseudorandom
pseudorandom integer
integer
with
with 00 << xx << qq
x
M
M == message
message H(M)
H(M) == hash
hash of
of MM
Sender’s
Sender’s Public
Public Key:
Key: yy == ggx mod
mod pp
M’,
M’, r’,
r’, s’
s’ == received
received versoins
versoins of
of M,
M, r,r, ss
Sender’s
Sender’s Per-Message
Per-Message Secret
Secret Number
Number
kk == random
random or
or pseudorandom
pseudorandom integer
integer with
with 00 << kk << qq
(3) Verifying
(i) r and s are checked by receiver i.e. 0 < r < q and 0 < s < q.
(ii) Digest/hash of message is calculated (Assuming receiver knows the hashing
algorithm used by sender).
(iii)Receiver calculates V as
1 1
V [( g h ( M ) s y rs ) mod p]mod q
(iv) If r is congruent to V, the sign is verified, else rejected.