You are on page 1of 51

DIGITAL SIGNATURE

Module 3
Process
HASH FUNCTIONS

• A cryptographic hash function is a one-way transformation


• It is also called message digest
• A hash function H is a transformation that takes an input m and
returns a fixed-size string, which is called the hash value h
h = H(m))
CONTD….

• Message digest is a fingerprint or the summary of a message


• The hash of a message must be
•"easy" to compute
• "unique"
• "difficult" to invert
PROPERTIES

• The input can be of any length.


• The output has a fixed length.
• H(x) is relatively easy to compute for any given x.
• H(x) is one-way.
• It is infeasible to modify a message without hash being changed
• It is infeasible to find two different messages with the same hash
TYPE OF HASH FUNCTIONS

• Mid- Square Hash function


• Division Hash function
• Folding Hash Function

• It depends on the user which hash function he wants to use.


COMPARISON

• Inclusion
• Verification Method
• Relationship
• Duplicity
ATTACKS ON DIGITAL SIGNATURE

•Key-Only Attack
•Known Message Attack
•Chosen Message Attack
PUBLIC KEY INFRASTRUCTURE

• In public key cryptography, everyone has access to everyone's public key; Public
keys are available to the public.
• PKI is a model for creating, distributing, and revoking certificates based on the
X.509.
• The Internet Engineering Task Force has created the Public Key Infrastructure
X.509(PKIX).
• The duties of a PKI include certificate issuing, private key storage, service to
other protocols, and access control.
COMPONENTS

• Certificate Management System


• Digital Certificates
• Validation Authority
• Certification Authority
• Registration Authority
• End User
PROCESS

CA

RA VA

A B
CERTIFICATION

• It is the fundamental function of all PKI’s .


• The certificate provide a secure way of publishing public keys, so that their validity can be
trusted.
• Basic information need to provide a third party entity with the subjects public key:
• Subject Identification Information
• Subject public key
• CA Identification Information
• Validity(eg: Time)
VALIDATION

• This is the process that ensures that the certificate information is still
valid, as it can change over time.
• Either the user can ask the CA directly about the validity-every time
its used or the CA may include a validity period in the certificate.
KEY MANAGEMENT

• Main Steps performed in a PKI to handle the key pairs;


• Key Generation
• Storage of private keys
• Revocation of public keys
• Publication of certificates and CRL
• Key update
• Backup/Recovery
• Escrow/Recovery
DIGITAL SIGNATURE SCHEME

• RSA Digital Signature Scheme


• Elgammal Digital Signature Scheme
• Schnorr Digital Signature Scheme
RSA DIGITAL SIGNATURE

• RSA idea is also used for signing and verifying a message it is called RSA digital signature
scheme.
• Digital signature scheme changes the role of the private and public keys
• Private and public keys of only the sender are used not the receiver
• Sender uses her own private key to sign the document and the receiver uses the sender’s public
key to verify it.
CONTINUE…

• Step1: The sender A uses the message digest algorithm to calculate the message
digest MD1 over the original message M.
• Step 2: The sender A now encrypts the message digest with her
private key. The output of this process is called the digital signature.
RSA DSS

• Step 3: Now the sender A sends the original message M along with digital signature
DS to receiver B
• Step 4: After the receiver B receives the original message M and the sender A’s
digital signature, B uses the same message digest algorithm which was used by A
and calculate its own message digest MD2 as shown below.
• Step 5: The receiver B now uses the sender’s A’s public key to decrypt the
digital signature. Note that A had used his private key to decrypt the message
digest MD1 to form the digital signature. Therefore only A’s public key can be
used to decrypt it. The output of this process is the original message digest which
was calculated by A (MD1) in step 1.
• Step 6: B now compare the following two message digests.
1. MD2, which it had calculated in step 4
2. MD1, which is retrieved from A’s digital signature in step 5
3. If MD1 = MD2 the following facts are established:
(a) B accepts the original message (M) as the correct, unaltered message from A.
(B) B is also assured that the message came from A and not from someone else attached, posing as
A.
ELGAMAL DIGITAL SIGNATURE

• Here e1,e2,p is Alice’s public key d is her private key


• Signing:
• Alice can sign the digest of a message to any entity including Bob,
• Step 1: Alice chooses a secret random number ‘r’.
• Step 2:Alice calculates the first signature
S1=e1^r mod p
EDS

• Step 3: Alice calculates the 2nd signature


• S2=M-d*S1)*r^-1 mod (p-1)
• Step 4: Alice send M,S1 and S2 to Bob.
• Verifying:
• An entity, such as Bob receives M,S1 and S2 which can be verified.
• Step 1: Bob checks to see if 0<S1<p
• Step 2: Bob checks to see if 0<S2<p-1
EDS

• Step 3: Bob calculates V1=e1^M mod p


• Step 4: Bob calculates V2=e2^S1 * S1^s2 mod p
• Step 5: If V1 is congruent to V2, the message is accepted;
• Otherwise it is rejected.
• We can prove the verification criterion using
e2=e1^d and S1=e1^r
SCHNORR DIGITAL SIGNATURE

• Key generation:
• Select a prime number p (1024 bit)
• Select another large prime number q ( q dividesnp-1)
• Select e1(public key) (e1=e0^(p-1)q mod p)
• Select d –private key’
• E2=e1^d mod p
CONTINUE….

• Signing:
• Choose a random number r
• Calculate S1=h(M|e1^r mod p)
• Calculate S2= r + d*S1 mod p

• Finally send S1, S2, M


CONTINUE..

• Verifying Message:
• Calculate V=h(M|e1^S2 e2^-S1 mod p)
• P=2267 q=103 e0=2
• E1=e0^(p-1)/q mod p
• =2^(2267-1)/103 mod 2267
• =2^22 mod 2267=e1=354//
• D=30
• E2=e1^d mod p
• =354^30 mod 2267=e2=1206//
• Choose a random number(r)= 11
• S1=h(M|e1^r mod p)
• E1=354 e2=1206 d=30 p=2267 q=103 M=1000
• =h(1000|354^11 mod 2267)
• E1^r mod p=354^11 mod 2267=630//
• =h(1000|630)=h(1000630)
• SHA-1 =hash function
• =200=s1//
• S2= r+d*s1 mod p
• =11+(30*200) mod 2267
• =35//
• Verification:
• V=h(M|e1^s2 e2^-s1 mod p)
• V=200//
• V=S1//
PRIVATE KEY MANAGEMENT

• Also known as a secret key


• It is a variable in cryptography
• It play an important role in symmetric and asymmetric cryptography.
• Secret keys are only shared with the keys generator making it highly secure.
HOW DOES A PRIVATE KEY WORK?

• Private key encryption is referred to as symmetric encryption.


• A private key is typically a long, randomly generated number that cannot be guessed.
• Secret key ciphers generally fall into one of two categories;
• Stream and block ciphers
PUBLIC KEY(2,8,11) PRIVATE KEY=3

Step 1: r=4 calculate c1, c2 for plaintext=7


Public key=(e1,e2,p)
E1=2 e2=8 p=11
Private key=d =3
C1=e1^r mod p
=2^4 mod 11=16 mod 11=5//
C2= (e2^r*p) mod p
=(8^4*7) mod 11=6//
• C1=5 c2=6
• Signing:
• Cipher text=(c2*(C1^d)^-1) mod p
• =(6*(5^3)^-1) mod 11
• Ab mod n= a mod n * b mod n
• (5^3)^-1 mod 11
• 125^-1 mod 11
• (125*x)^-1 mod 11=1
• X=3 ; 6*3 mod 11=7//
• Here is trivial example, Alice choose p=3119, e1=2, d=127 and calculate e2=2^127 mod 3119=1702. She also
chooses r to be 307. She announces e1, e2,and p publicly. She keep d secretly. The following show how Alice can
sign a msg M=320
• E2=e0^d mod p
• S1=e1^r mod p
• =2^307 mod 3119=2083 mod 3119=2083
• S2=(M-d*S1)*r^-1 mod p
• =(320-127*2083 mod 3119)*307^-1=2105 mod 3119//
• V1=e1^M mod p=3006 mod 3119
• V2=d^S1*S1^S2 mod p=3006 mod 3119
PUBLIC KEY CRYPTOGRAPHY STANDARDS
PKCS
PKCS
PKCS
PKCS
PKCS
PKCS
PKCS
PKCS
PKCS
PKCS
PKCS

You might also like