Cryptography (COMP3223)

QQ: 942371102

Exercise 1: Alice and Bob want to communicate using the RSA cryptosystem. To do so, Alice chooses two large prime numbers p, q and computes the modulus n = pq.

a) Let ϕ(n) be Euler’s totient function, i.e. ϕ(n) returns the number of elements in the multiplicative group (Z ∗ n , ·).

Prove that if n = pq, where p, q are two prime numbers, then we have ϕ(pq) = (p − 1)(q − 1). [4 marks]

Hint: How many integers m between 1 and pq satisfy the condition gcd(m, pq) = 1?

b) Bob receives x = 18 and y = x d ≡ 324 (mod 697) as the RSA signature. Bob has the modulus n = 697 and the public key e = 33, but does not know Alice’s private key. Verify using the square-and-multiply algorithm that Alice’s signature is correct. Show all steps of the computation. [3 marks]

Exercise 2: The following exercises are on prime numbers.

a) Use the Miller-Rabin Primality Test to test whether n = 1105 is a prime. Choose the exponent a = 7.

b) Eve is given a large composite number n = p × q. She attempts a brute force approach to finding a factor of n by testing whether p divides n for p = 2, 3, 5, 7, . . . until she finds a factor p | n. Prove that Eve has to test at most

                                        d = 2^(b/2+1)/bln2

factors until she finds p | n, where b ≈ log2 (n) is the approximate number of bits in n.

Exercise 3: Alice wants to use the following hash function: Given a prime number p, a generator g ∈ Z ∗ p , and a message of length n consisting of values xi ∈ Zp for i = 1, 2, . . . , n, compute the hash h : Z n p → Zp as

                                          

 a) Show that this hash function is not cryptographically secure because it fails the second pre-image test. Assume you are given a message x with hash h(x) and use this information to construct a different message x 0 with the same hash, h(x 0 ) = h(x).

b) Show that finding a pre-image x = h −1 (y) for this hash function is at most as hard as computing a discrete logarithm in Z ∗ p . Hint: Assume you are given y and n, and construct x ∈ Z n p such that y = h(x).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lee1xf520

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值