- 6
- 0
- 约1.02万字
- 约 8页
- 2021-11-21 发布于福建
- 举报
RSA 算法
#include iostream
#include stdlib
#include timeusing namespace std;//RSA 算法所需参数
typedef struct RSA_PARAM_Tag
{
unsigned __int64 p, q; //两个素数,不参与加密解密运算
unsigned __int64 f; //f=(p-1)*(q-1) ,不参与加密解密运算
unsigned __int64 n, e; // 公匙, n=p*q ,gcd(e,f)=1
unsigned __int64 d; // 私匙, e*d=1 (mod f) ,gcd(n,d)=1
unsigned __int64 s; // 块长,满足 2^s=n 的最大的 s,即 log2(n)
} RSA_PARAM;// 小素数表
const static long g_PrimeTable[]=
{
3,
5
原创力文档

文档评论(0)