13.6 Exercises

  1. Show that if someone discovers the value of k used in the ElGamal signature scheme, then a can also be determined if gcd(r, p1) is small.

  2. Alice signs the hash of a message. Suppose her hash function satisfies h(x)2x  (mod 101) and 1h(x)100 for all x. Suppose m is a valid signed message from Alice. Give another message m1 for which the same signature is also valid.

  3. Alice says that she is willing to sign a petition to save koala bears. Alice’s signing algorithm uses a hash function that has an output of 60 bits (and she signs the hash of the document). Describe how Eve can trick Alice into signing a statement allowing Eve unlimited withdrawals from Alice’s bank account.

  4. Alice uses RSA signatures (without a hash function).

    1. Eve wants to produce Alice’s signature on the document m=123456789. Why is this difficult? Explain this by saying what difficult cryptographic problem must be solved. (Do not say that it’s because Eve does not know the decryption exponent d. Why isn’t there another way to produce the signature?)

    2. Since part (a) is too hard for Eve, she decides to produce Alice’s valid RSA signature on a document so that the signature is s=112090305 (= Alice, when A=01, L=12, etc.). How does Eve find an appropriate message?

  5. Nelson thinks he has a new version of the signature scheme. He chooses RSA parameters n, e, and d. He signs by computing smd  (mod n). The verification equation is (sm)(s+m)=?s2m2.

    1. Show that if Nelson correctly follows the signing procedure, or if he doesn’t, then the signature is declared valid.

    2. Show that Eve can forge Nelson’s signature on any document m, even though she does not know d.

    (The point of this exercise is that the verification equation is important. All Eve needs to do is satisfy the verification equation. She does not need to follow the prescribed procedure for producing the signature.)

  6. Alice has a long message m. She breaks m into blocks of 256 bits: m=m1||m2||||mN. She regards each block as a number between 0 and 22561, and she signs the sum t=m1+m2++mN. This means her signed message is (m, sig(t)), where sig is the signing function. Is this a good idea? Why or why not?

  7. Suppose that (m, r, s) is a message signed with the ElGamal signature scheme. Choose h with gcd(h, p1)=1 and let r1rh  (mod p). Let s1sr1h1r1  (mod p1).

    1. Find a message m1 for which (m1, r1, s1) is a valid signature.

    2. This method allows Eve to forge a signature on the message m1. Why is it unlikely that this causes problems?

  8. Let p=11, q=5, α=3, and k=3. Show that (αk  (mod p))  (mod q)(αk  (mod q))  (mod p). This shows that the order of operations in the DSA is important.

  9. There are many variations to the ElGamal digital signature scheme that can be obtained by altering the signing equation sk1(mar)  (mod p1). Here are some variations.

    1. Consider the signing equation sa1(mkr)  (mod p1). Show that the verification αm(αa)srr  (mod p) is a valid verification procedure.

    2. Consider the signing equation sam+kr  (mod p1). Show that the verification αs(αa)mrr  (mod p) is a valid verification procedure.

    3. Consider the signing equation sar+km  (mod p1). Show that the verification αs=(αa)rrm  (mod p) is a valid verification procedure.

  10. Consider the following variant of the ElGamal Signature Scheme: Alice chooses a large prime p, a primitive root α, and a secret integer a. She computes hαa  (mod p). The numbers p, α, h are made public and a is kept secret. If m<p1, Alice signs m as follows: She chooses a random integer k and computes rαk  (mod p), with 0<r<p1, and samkr  (mod p1). The signed message is (m, r, s). Bob verifies the signature by checking that αsrrhm  (mod p). If mp1, she breaks m into blocks and signs each block.

    1. Show that if Alice signs correctly then the verification congruence is satisfied.

    2. Suppose Eve has a document m1 and she wants to forge Alice’s signature on m1. That is, she wants to find r1 and s1 such that (m1, r1, s1) is valid. Eve chooses r1=2015 and tries to find a suitable s1. Why will it probably be hard to find s1?

    3. Suppose Alice has a very long message m and wants to decrease the size of the signature. How can she use a hash function to do this? Explicitly give the modifications of the above equations that must be done to accomplish this.

  11. The ElGamal signature scheme presented is weak to a type of attack known as existential forgery. Here is the basic existential forgery attack. Choose u, v such that gcd(v, p1)=1. Compute rβvαu  (mod p) and srv1  (mod p1).

    1. Prove the claim that the pair (r, s) is a valid signature for the message m=su  (mod p1) (of course, it is likely that m is not a meaningful message).

    2. Suppose a hash function h is used and the signature must be valid for h(m) instead of for m (so we need to have h(m)=su). Explain how this scheme protects against existential forgery. That is, explain why it is hard to produce a forged, signed message by this procedure.

  12. Alice’s RSA public key is (n, e) and her private key is d. Recall that a document with an RSA signature (m, s) is valid if mse  (mod n). Bob wants Alice to sign a document m but he does not want Alice to read the document. Assume m<n. They do the following:

    1. Bob chooses a random integer k with gcd(k, n)=1. He computes m1kem  (mod n).

    2. Alice signs m1 by computing s1m1d  (mod n).

    3. Bob divides s1 by k mod n to obtain sk1s1  (mod n).

    1. Show that (m, s) is valid.

    2. Why is it assumed that gcd(k, n)=1?

  13. Alice wants to sign a document using the ElGamal signature scheme. Suppose her random number generator is broken, so she uses k=a in the signature scheme. How will Eve notice this and how can Eve determine the values of k and a (and thus break the system)?

  14. Suppose Alice signs contracts using a 30-bit hash function h (and h is known to everyone). If m is the contract, then (m, sig(h(m))) is the signed contract (where sig is some public signature function). Eve has a file of 220 fraudulent contracts. She finds a file with 220 contracts with valid signatures (by Alice) on them. Describe how Eve can accomplish her goal of putting Alice’s signature on at least one fraudulent document.

    1. In several cryptographic protocols, one needs to choose a prime p such that q=(p1)/2 is also prime. One way to do this is to choose a prime q at random and then test 2q+1 for primality. Suppose q is chosen to have approximately 300 decimal digits. Assume 2q+1 is a random odd integer of 300 digits. (This is not quite accurate, since 2q+1 cannot be congruent to 1 mod 3, for example. But the assumption is good enough for a rough estimate.) Show that the probability that 2q+1 is prime is approximately 1/345 (use the prime number theorem, as in Section 9.3). This means that with approximately 345 random choices for the prime q, you should be able to find a suitable prime p.

    2. In a version of the Digital Signature Algorithm, Alice needs a 256-bit prime q and a 2048-bit prime p such that q|p1. Suppose Alice chooses a random 256-bit prime q and a random 1792-bit even number k such that qk+1 has 2048 bits. Show that the probability that qk+1 is prime is approximately 1/710. This means that Alice can find a suitable q and p fairly quickly.

  15. Consider the following variation of the ElGamal signature scheme. Alice chooses a large prime p and a primitive root α. She also chooses a function f(x) that, given an integer x with 0x<p, returns an integer f(x) with 0f(x)<p1. (For example, f(x)=x73x+2  (mod p1) for 0x<p is one such function.) She chooses a secret integer a and computes βαa  (mod p). The numbers p, α, β and the function f(x) are made public.

    Alice wants to sign a message m:

    1. Alice chooses a random integer k with gcd(k, p1)=1.

    2. She computes rαk  (mod p).

    3. She computes sk1(mf(r)a)  (mod p1).

    The signed message is (m, r, s).

    Bob verifies the signature as follows:

    1. He computes v1βf(r)rs  (mod p).

    2. He computes v2αm  (mod p).

    3. If v1v2  (mod p), he declares the signature to be valid.

    1. Show that if all procedures are followed correctly, then the verification equation is true.

    2. Suppose Alice is lazy and chooses the constant function satisfying f(x)=0 for all x. Show that Eve can forge a valid signature on every message m1 (for example, give a value of k and of r and s that will give a valid signature for the message m1).

  16. Alice wants to sign a long message m=m1||m2||||mL that she has broken into blocks m1, , mL. She knows that signing each block mi individually is wasteful, so she computes g(m)=m1m2mL and signs g(m). Her signed message is (m, sigA(g(m))). Suppose Eve has a message that Alice signed. How can Eve put Alice’s signature on fraudulent messages?

  17. In some scenarios, it is necessary to have a digital document signed by multiple participants. For example, a contract issued by a company might need to be signed by both the Issuer and the Supervisor before it is valid. To accomplish this, a trusted entity chooses n=pq to be the product of two large, distinct primes and chooses integers k1, k2, k3>1 with k1k2k31  (mod (p1)(q1)). The pair (n, k1) is given to the Issuer, the pair (n, k2) is given to the Supervisor, and the pair (n, k3) is made public.

    1. Under the assumption that RSA is hard to decrypt, why should it be difficult for someone who knows at most one of k1, k2 to produce s such that sk3m  (mod n)?

    2. Devise a procedure where the Issuer signs the contract first and gives the signed contract to the Supervisor, who then signs it in such a way that anyone can verify that the document was signed by both the Issuer and the Supervisor. Use part (a) to show why the verification convinces someone that both parties signed the contract.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset