- Generating an electronic signature:
An electronic signature is generated using the Elliptic Curve Digital Signature Algorithm (ECDSA). The steps to generate an electronic signature are as follows:
- Calculate the public key: The public key is calculated by multiplying the generating point G with the secret signature key k. In this case, the generating point G is (4, 1) and the secret signature key k is 4. So, the public key P is calculated as follows:
P = k * G = 4 * (4, 1) = (4, 1) + (4, 1) + (4, 1) + (4, 1)
Using the elliptic curve point addition formula, we get:
P = (4, 1) + (4, 1) = (0, 6)
P = (0, 6) + (4, 1) = (3, 1)
P = (3, 1) + (4, 1) = (5, 1)
P = (5, 1) + (4, 1) = (6, 6)
So, the public key P is (6, 6).
- Calculate the random point R: The random point R is calculated by multiplying the generating point G with the random number r. In this case, the generating point G is (4, 1) and the random number r is 5. So, the random point R is calculated as follows:
R = r * G = 5 * (4, 1) = (4, 1) + (4, 1) + (4, 1) + (4, 1) + (4, 1)
Using the elliptic curve point addition formula, we get:
R = (4, 1) + (4, 1) = (0, 6)
R = (0, 6) + (4, 1) = (3, 1)
R = (3, 1) + (4, 1) = (5, 1)
R = (5, 1) + (4, 1) = (6, 6)
R = (6, 6) + (4, 1) = (2, 1)
So, the random point R is (2, 1).
- Calculate the signature: The signature is calculated using the hash of the message, the random point R, and the secret signature key k. In this case, the hash of the message is 3, the random point R is (2, 1), and the secret signature key k is 4. So, the signature (r, s) is calculated as follows:
r = R.x mod n = 2 mod 11 = 2
s = (k^-1 * (hash + r * k)) mod n = (4^-1 * (3 + 2 * 4)) mod 11 = (3 * 4^-1) mod 11 = (3 * 3) mod 11 = 2
So, the signature is (2, 2).
- Verifying an electronic signature:
The steps to verify an electronic signature are as follows:
-
Calculate the public key: The public key is calculated by multiplying the generating point G with the secret signature key k. In this case, the generating point G is (3, 2) and the secret signature key k is not given. However, we are given the public key P = (5, 1).
-
Calculate the random point R: The random point R is calculated by multiplying the generating point G with the random number r. In this case, the generating point G is (3, 2) and the random number r is not given. However, we are given the signature (1, 2), which means that the random point R is (1, 2).
-
Verify the signature: The signature is verified by checking if the following equation holds true:
s^-1 * hash * G + s^-1 * r * P = R
In this case, the hash is 4, the signature is (1, 2), and the public key is (5, 1). So, we need to check if the following equation holds true:
2^-1 * 4 * (3, 2) + 2^-1 * 1 * (5, 1) = (1, 2)
Using the elliptic curve point addition formula, we get:
2^-1 * 4 * (3, 2) = (3, 2) + (3, 2) = (0, 6)
2^-1 * 1 * (5, 1) = (5, 1)
So, the left-hand side of the equation is (0, 6) + (5, 1) = (1, 2), which is equal to the right-hand side of the equation. Therefore, the signature is verified.