Digital Signatures
Digital Signatures
1. What is DSS?
2. What is Digital Signature?
3. Write and Explain Digital Signature
Algorithm(DSA).
4. Describe the attack on Digital
Signature.
5. Attacks on Digital Signature.
6. Elliptic Curve Cryptography
What is DSS?
Digital Signature Standard (DSS)
As we know, signature is a way of authenticating the data coming from a
trusted individual. Similarly, digital signature is a way of authenticating a
digital data coming from a trusted source. Digital Signature Standard
(DSS) is a Federal Information Processing Standard(FIPS) which defines
algorithms that are used to generate digital signatures with the help
of Secure Hash Algorithm(SHA) for the authentication of electronic
documents. DSS only provides us with the digital signature function
and not with any encryption or key exchanging strategies.
OR
Digital Signature is a way to validate the authenticity and integrity of the
message or digital or electronic documents. Authenticity means to check
whether the data is coming from a valid source or not to the receiver i.e.
to verify the identity of the sender and integrity means to check that the
data or message should not be altered during the transmission.
A hash code is generated from the message and given as input to the
signature function on the sender side. The other inputs to a signature
function include a unique random number k for the signature, the
private key of sender PR(a), and the global public key i.e., PU(g).
The output of the signature function consists of two components: s & r,
which are concatenated with the input message and then sent to the
receiver. Signature = {s, r}.
On the receiver side, the hash code for the message sent is generated by
the receiver by applying a hash function. The verification function is used
for verifying the message and signature sent by the sender. The
verification function takes the hash code generated, signature components
s and r, the public key of the sender (PU(a)), and the global public key.
The signature function is compared with the output of the verification
function and if both the values match, the signature is valid because A
valid signature can only be generated by the sender using its private key.
https://www.simplilearn.com/tutorials/cryptography-tutorial/digital-signat
ure-algorithm
With one exception, they work on the public key cryptography architecture.
Typically, an asymmetric key system encrypts using a public key and decrypts
with a private key. For digital signatures, however, the reverse is true. The
signature is encrypted using the private key and decrypted with the public key.
Because the keys are linked, decoding it with the public key verifies that the
proper private key was used to sign the document, thereby verifying the
signature's provenance.
The image above shows the entire process, from the signing of the key to its
verification. So, go through each step to understand the procedure thoroughly.
● Step 2: Next, it bundles the message together with the hash digest h and
encrypts it using the sender’s private key.
● Step 3: It sends the encrypted bundle to the receiver, who can decrypt it
using the sender’s public key.
● Step 4: Once it decrypts the message, it is passed through the same hash
function (H#), to generate a similar digest.
● Step 5: It compares the newly generated hash with the bundled hash value
received along with the message. If they match, it verifies data integrity.
1. RSA Algorithm
2. DSA Algorithm
Both the algorithms serve the same purpose, but the encryption and
decryption functions differ quite a bit. So, now that you understand how it is
supposed to function while verifying the signature, let’s deep dive into our
focus for today, the DSA Algorithm.
Block Diagram of Digital Signature
● Encryption: The hash is then encrypted using the sender's private key.
● Verification: The signature is then verified using the sender's public key to
ensure the signature's validity and the document's authenticity.
Role of Digital Signatures
● Digital signatures are used for authentication or verification. They are used
to verify the authenticity and integrity of a digital document or message.
● Message Authentication: You can verify the origin of the sender using the
right key combination.
● Integrity Verification: You cannot tamper with the message since it will
prevent the bundle from being decrypted altogether.
● Non-repudiation: The sender cannot claim they never sent the message if
verifies the signature.
The image above shows the entire procedure of the DSA algorithm. You will
use two different functions here, a signing function and a verification function.
The difference between the image of a typical digital signature verification
process and the one above is the encryption and decryption part. They have
distinct parameters, which you will look into in the next section of this lesson
on the DSA Algorithm.
Keeping the image above in mind, go ahead and see how the entire process
works, starting from creating the key pair to verifying the signature at the end.
1. Key Generation
There are two steps in the key generation process: parameter generation and
per-user keys.
Parameter Generation
● Later a user can choose a prime number q of N bit and another prime
number as p of L bit in such a way that p-1 is multiple of q. And then
choose h as an integer from the list ( 2……..p-2).
p, q and g are the algorithm parameters that are shared amongst different
users of the systems.
Per-user Keys
To compute the key parameters for a single user, first choose an integer x
(private key) from the list (1…….q-1), then compute the public key,
y=g^(x)*mod(p).
2. Signature Generation
● It passes the original message (M) through the hash function (H#) to get
our hash digest(h).
● Apart from the digest, you also use a random integer k such that 0 < k < q.
● To calculate the value of r, you use the formula r = (gk mod p) mod q.
● To calculate the value of s, you use the formula s = [K-1(h+x . R)mod q].
3. Key Distribution
While distributing keys, a signer should keep the private key (x) secret and
publish the public key (y) and send the public key (y) to the receiver without
any secret mechanism.
Signing
● compute
● Calculate
● The signature is defined by two key elements (r,s). Also, key elements k
and r are used to create a new message. Nevertheless, computing r with
modular exponential process is a very expensive process and computed
before the message is known. Computation is done with the help of the
Euclidean algorithm and Fermat's little theorem.
4. Signature Verification
● You use the same hash function (H#) to generate the digest h.
● You then pass this digest off to the verification function, which needs other
variables as parameters too.
Key-only attack: In the key-only attack, the assumption is that some information was
made public by a genuine user. This attacker now tries to misuse this public
information. This is similar to the ciphertext-only attack in encryption. Here, the
attacker tries to create the signature of the genuine user.
RSA is the most prominent algorithm used in public key cryptography techniques for
encryption and digital signatures. Over the years, the key lengths for RSA have been
increasing. This puts considerable burden on RSA. Another public key cryptography
technique is gaining popularity in the last few years. It is called as Elliptic Curve
Cryptography (ECC). The main difference between RSA and ECC is that unlike RSA,
ECC offers the same level of security for smaller key sizes. ECC is highly
mathematical in nature, and therefore, we shall just have an overview of this
technique.
Elliptic curves
An elliptic curve is similar to a normal curve drawn as a graph on x and y-axes. It has
points. Each point can be designated by an (x, y) coordinate, just like any other graph.
For instance, a point can be designated as (4, –9), which means that it is 4 units on the
right hand side of the x-axis from the center and 9 below the y-axis from the center, as
shown in Fig. 4.51
Consider an elliptic curve (E) with a point P. Now, generate a random number d. Let
we have Q = d ¥ P. Now, the mathematics says that E, P and Q are public values, and
the challenge is to find d. This is called as elliptic curve discrete logarithm problem.
As long as the curve is big enough, it is almost impossible to find d. Thus, E, P, Q
together form the public key and d is the corresponding private key.