![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 84
熊與猫v
这个作者很懒,什么都没留下…
展开
-
Python实现任意两个不等质数p,q,N=p*q,构造Zn*(小于N且与N互质,modN),是否成群
完整代码如下:#判断是否为素数 def isprime(): count = 1 while (count): n = int(input("输入一个质数:")) for i in range(2, n): if n % i == 0: print(" %d 这不是一个质数!" % n) ...原创 2018-03-25 18:28:50 · 1384 阅读 · 1 评论 -
Python实现RSA加密,解密
import math import random #生成素数数组 def prime_array(): arraya = [] for i in range(2,100): #生成前100中的素数,从2开始因为2是最小的素数 x = prime(i,2) #i为素数时返回True,则将x加入arraya数组中;2为测试值 if x: ...原创 2018-04-22 16:59:16 · 4953 阅读 · 0 评论