鱼C论坛

 找回密码
 立即注册
查看: 2273|回复: 0

题目182:RSA加密

[复制链接]
发表于 2016-10-4 00:31:13 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
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 [0,n-1].
A text to be encrypted is then somehow converted to messages (numbers in the interval [0,n-1]).
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(即二者互质)


在这个系统中的一条消息就是 [0,n-1] 中的一个数。

需要被加密的文本会被转换成消息(一些 [0,n-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 得到的公开消息数是最少的。

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-7-2 21:54

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表