欧拉计划 发表于 2016-10-4 00:31:13

题目182:RSA加密

RSA encryption

The RSA encryption is based on the following procedure:

Generate two distinct primes p and q.
Compute n=pq and φ=(p-1)(q-1).
Find an integer e, 1<e<φ, such that gcd(e,φ)=1.

A message in this system is a number in the interval .
A text to be encrypted is then somehow converted to messages (numbers in the interval ).
To encrypt the text, for each message, m, c=me mod n is calculated.

To decrypt the text, the following procedure is needed: calculate d such that ed=1 mod φ, then for each encrypted message, c, calculate m=cd mod n.

There exist values of e and m such that me mod n=m.
We call messages m for which me mod n=m unconcealed messages.

An issue when choosing e is that there should not be too many unconcealed messages.
For instance, let p=19 and q=37.
Then n=19*37=703 and φ=18*36=648.
If we choose e=181, then, although gcd(181,648)=1 it turns out that all possible messages
m (0≤m≤n-1) are unconcealed when calculating me mod n.
For any valid choice of e there exist some unconcealed messages.
It's important that the number of unconcealed messages is at a minimum.

Choose p=1009 and q=3643.
Find the sum of all values of e, 1<e<φ(1009,3643) and gcd(e,φ)=1, so that the number of unconcealed messages for this value of e is at a minimum.


题目:

RSA 加密基于以下的过程:

生成 2 个不同的质数 p 和 q。

计算 n=pq 和 φ=(p-1)(q-1)。

找到一个整数 e,1<e<φ,并且 gcd(e,φ)=1(即二者互质)


在这个系统中的一条消息就是 中的一个数。

需要被加密的文本会被转换成消息(一些 之间的数)。

为了对文本加密,对于每个消息 m, 计算 c=me mod n。


要解密文本,则需要下面的过程:

计算 d,满足 ed=1 mod φ,然后,对所有的加密消息 c,计算 m=cd mod n


存在 e 和 m 的值,满足 me mod n=m。

我们把满足 me mod n=m 的消息 m 叫做公开消息。


一个选择 e 的问题是,不应该存在过多的公开消息。

比如,设 p=19 , q=37。则 n=19*37=703 , φ=18*36=648

如果我们选择 e = 181,则尽管 gcd(181,648)=1,但可以证明,当计算 me mod n 时,所有可能的消息 m (0≤m≤n-1) 都是公开的。


对于任意有效的 e,总是会存在一些公开消息。

让公开消息数目最少,是非常重要的。


选择 p=1009 ,q=3643,找出所有满足下面条件的 e 值的和:

1<e<φ(1009,3643) 以及 gcd(e,φ)=1,满足这两个条件的 e 得到的公开消息数是最少的。

页: [1]
查看完整版本: 题目182:RSA加密