當前位置:首頁 » 操作系統 » rsa演算法c實現

rsa演算法c實現

發布時間: 2023-07-10 06:15:22

① 如何用c語言實現RSA演算法

上學期交的作業,已通過老師在運行時間上的測試
#include <stdio.h>
#include <stdlib.h>

unsigned long prime1,prime2,ee;

unsigned long *kzojld(unsigned long p,unsigned long q) //擴展歐幾里得演算法求模逆
{
unsigned long i=0,a=1,b=0,c=0,d=1,temp,mid,ni[2];
mid=p;
while(mid!=1)
{
while(p>q)
{p=p-q; mid=p;i++;}
a=c*(-1)*i+a;b=d*(-1)*i+b;
temp=a;a=c;c=temp;
temp=b;b=d;d=temp;
temp=p;p=q;q=temp;
i=0;
}
ni[0]=c;ni[1]=d;
return(ni);
}

unsigned long momi(unsigned long a,unsigned long b,unsigned long p) //模冪演算法
{
unsigned long c;
c=1;
if(a>p) a=a%p;
if(b>p) b=b%(p-1);
while(b!=0)
{
while(b%2==0)
{
b=b/2;
a=(a*a)%p;
}
b=b-1;
c=(a*c)%p;
}
return(c);
}

void RSAjiami() //RSA加密函數
{
unsigned long c1,c2;
unsigned long m,n,c;
n=prime1*prime2;
system("cls");
printf("Please input the message:\n");
scanf("%lu",&m);getchar();
c=momi(m,ee,n);
printf("The cipher is:%lu",c);
return;
}

void RSAjiemi() //RSA解密函數
{
unsigned long m1,m2,e,d,*ni;
unsigned long c,n,m,o;
o=(prime1-1)*(prime2-1);
n=prime1*prime2;
system("cls");
printf("Please input the cipher:\n");
scanf("%lu",&c);getchar();
ni=kzojld(ee,o);
d=ni[0];
m=momi(c,d,n);
printf("The original message is:%lu",m);
return;
}

void main()
{ unsigned long m;
char cho;
printf("Please input the two prime you want to use:\n");
printf("P=");scanf("%lu",&prime1);getchar();
printf("Q=");scanf("%lu",&prime2);getchar();
printf("E=");scanf("%lu",&ee);getchar();
if(prime1<prime2)
{m=prime1;prime1=prime2;prime2=m;}
while(1)
{
system("cls");
printf("\t*******RSA密碼系統*******\n");
printf("Please select what do you want to do:\n");
printf("1.Encrpt.\n");
printf("2.Decrpt.\n");
printf("3.Exit.\n");
printf("Your choice:");
scanf("%c",&cho);getchar();
switch(cho)
{ case '1':RSAjiami();break;
case '2':RSAjiemi();break;
case '3':exit(0);
default:printf("Error input.\n");break;
}
getchar();
}
}

② RSA加密解密演算法示例(C語言)

#include <stdlib.h>

#include <stdio.h>

#include <string.h>

#include <math.h>

#include <time.h>

#define PRIME_MAX 200   // 生成素數范圍

#define EXPONENT_MAX 200 // 生成指數e范圍

#define Element_Max 127    // 加密單元的最大值,這里為一個char, 即1Byte

char str_read[100]="hello world !";  // 待加密的原文

int str_encrypt[100];                // 加密後的內容

char str_decrypt[100];              // 解密出來的內容

int str_read_len;                    // str_read 的長度

int prime1, prime2;                  // 隨機生成的兩個質數

int mod, eular;                      // 模數和歐拉數

int pubKey, priKey;                  // 公鑰指數和私鑰指數

// 生成隨機素數,實際應用中,這兩個質數越大,就越難破解。

int randPrime()

{

int prime, prime2, i;

next:

prime = rand() % PRIME_MAX;   // 隨機產生數

if (prime <= 1) goto next;      // 不是質數,生成下一個隨機數

if (prime == 2 || prime == 3) return prime;

prime2 = prime / 2;              // prime>=4, prime2 的平方必定大於 prime , 因此只檢查小於等於prime2的數

for (i = 2; i <= prime2; i++)   // 判斷是否為素數

{

if (i * i > prime) return prime;

if (prime % i == 0) goto next;  // 不是質數,生成下一個隨機數

}

}

// 歐幾里德演算法,判斷a,b互質

int gcd(int a, int b)

{

int temp;

while (b != 0) {

temp = b;

b = a % b;

a = temp;

}

return a;

}

//生成公鑰指數,條件是 1< e < 歐拉數,且與歐拉數互質。

int randExponent()

{

int e;

while (1)

{

e = rand() % eular; if (e < EXPONENT_MAX) break;

}

while (1)

{

if (gcd(e, eular) == 1) return e; e = (e + 1) % eular; if (e == 0 || e > EXPONENT_MAX) e = 2;

}

}

//生成私鑰指數

int inverse()

{

int d, x;

while (1)

{

d = rand() % eular;

x = pubKey * d % eular;

if (x == 1)

{

return d;

}

}

}

//加密函數

void jiami()           

{

str_read_len = strlen(str_read);      //從參數表示的地址往後找,找到第一個'\0',即串尾。計算'\0'至首地址的「距離」,即隔了幾個字元,從而得出長度。

printf("密文是:");

for (int i = 0; i < str_read_len; i++)

{

int C = 1; int a = str_read[i], b = a % mod;

for (int j = 0; j < pubKey; j++) //實現加密

{

C = (C*b) % mod;

}

str_encrypt[i] = C;

printf("%d ", str_encrypt[i]);

}

printf("\n");

}

//解密函數

void jiemi()         

{

int i=0;  for (i = 0; i < str_read_len; i++)

{

int C = 1; int a = str_encrypt[i], b=a%mod;

for (int j = 0; j < priKey; j++)

{

C = (C * b) % mod;

}

str_decrypt[i] = C;

}

str_decrypt[i] = '\0'; printf("解密文是:%s \n", str_decrypt);

}

int main()

{

srand(time(NULL));

while (1)

{

prime1 = randPrime(); prime2 = randPrime(); printf("隨機產生兩個素數:prime1 = %d , prime2 = %d ", prime1, prime2);

mod = prime1 * prime2; printf("模數:mod = prime1 * prime2 = %d \n", mod); if (mod > Element_Max) break; // 模數要大於每個加密單元的值

}

eular = (prime1 - 1) * (prime2 - 1);  printf("歐拉數:eular=(prime1-1)*(prime2-1) = %d \n", eular);

pubKey = randExponent(); printf("公鑰指數:pubKey = %d\n", pubKey);

priKey = inverse(); printf("私鑰指數:priKey = %d\n私鑰為 (%d, %d)\n", priKey, priKey, mod);

jiami(); jiemi();

return 0;

}

③ 如何用C語言實現RSA演算法

RSA演算法它是第一個既能用於數據加密也能用於數字簽名的演算法。它易於理解和操作,也很流行。演算法的名字以發明者的名字
命名:Ron Rivest, Adi Shamir 和Leonard
Adleman。但RSA的安全性一直未能得到理論上的證明。它經歷了各種攻擊,至今未被完全攻破。

一、RSA演算法 :

首先, 找出三個數, p, q, r,
其中 p, q 是兩個相異的質數, r 是與 (p-1)(q-1) 互質的數
p, q, r 這三個數便是 private key

接著, 找出 m, 使得 rm == 1 mod (p-1)(q-1)
這個 m 一定存在, 因為 r 與 (p-1)(q-1) 互質, 用輾轉相除法就可以得到了
再來, 計算 n = pq
m, n 這兩個數便是 public key

編碼過程是, 若資料為 a, 將其看成是一個大整數, 假設 a < n
如果 a >= n 的話, 就將 a 表成 s 進位 (s <= n, 通常取 s = 2^t),
則每一位數均小於 n, 然後分段編碼
接下來, 計算 b == a^m mod n, (0 <= b < n),
b 就是編碼後的資料

解碼的過程是, 計算 c == b^r mod pq (0 <= c < pq),
於是乎, 解碼完畢 等會會證明 c 和 a 其實是相等的 :)

如果第三者進行竊聽時, 他會得到幾個數: m, n(=pq), b
他如果要解碼的話, 必須想辦法得到 r
所以, 他必須先對 n 作質因數分解
要防止他分解, 最有效的方法是找兩個非常的大質數 p, q,
使第三者作因數分解時發生困難
<定理>
若 p, q 是相異質數, rm == 1 mod (p-1)(q-1),
a 是任意一個正整數, b == a^m mod pq, c == b^r mod pq,
則 c == a mod pq

證明的過程, 會用到費馬小定理, 敘述如下:
m 是任一質數, n 是任一整數, 則 n^m == n mod m
(換另一句話說, 如果 n 和 m 互質, 則 n^(m-1) == 1 mod m)
運用一些基本的群論的知識, 就可以很容易地證出費馬小定理的

<證明>
因為 rm == 1 mod (p-1)(q-1), 所以 rm = k(p-1)(q-1) + 1, 其中 k 是整數
因為在 molo 中是 preserve 乘法的
(x == y mod z and u == v mod z => xu == yv mod z),
所以, c == b^r == (a^m)^r == a^(rm) == a^(k(p-1)(q-1)+1) mod pq

1. 如果 a 不是 p 的倍數, 也不是 q 的倍數時,
則 a^(p-1) == 1 mod p (費馬小定理) => a^(k(p-1)(q-1)) == 1 mod p
a^(q-1) == 1 mod q (費馬小定理) => a^(k(p-1)(q-1)) == 1 mod q
所以 p, q 均能整除 a^(k(p-1)(q-1)) - 1 => pq | a^(k(p-1)(q-1)) - 1
即 a^(k(p-1)(q-1)) == 1 mod pq
=> c == a^(k(p-1)(q-1)+1) == a mod pq

2. 如果 a 是 p 的倍數, 但不是 q 的倍數時,
則 a^(q-1) == 1 mod q (費馬小定理)
=> a^(k(p-1)(q-1)) == 1 mod q
=> c == a^(k(p-1)(q-1)+1) == a mod q
=> q | c - a
因 p | a
=> c == a^(k(p-1)(q-1)+1) == 0 mod p
=> p | c - a
所以, pq | c - a => c == a mod pq

3. 如果 a 是 q 的倍數, 但不是 p 的倍數時, 證明同上

4. 如果 a 同時是 p 和 q 的倍數時,
則 pq | a
=> c == a^(k(p-1)(q-1)+1) == 0 mod pq
=> pq | c - a
=> c == a mod pq
Q.E.D.

這個定理說明 a 經過編碼為 b 再經過解碼為 c 時, a == c mod n (n = pq)
但我們在做編碼解碼時, 限制 0 <= a < n, 0 <= c < n,
所以這就是說 a 等於 c, 所以這個過程確實能做到編碼解碼的功能

二、RSA 的安全性

RSA的安全性依賴於大數分解,但是否等同於大數分解一直未能得到理論上的證明,因為沒有證明破解
RSA就一定需要作大數分解。假設存在一種無須分解大數的演算法,那它肯定可以修改成為大數分解演算法。目前, RSA
的一些變種演算法已被證明等價於大數分解。不管怎樣,分解n是最顯然的攻擊方法。現在,人們已能分解多個十進制位的大素數。因此,模數n
必須選大一些,因具體適用情況而定。

三、RSA的速度

由於進行的都是大數計算,使得RSA最快的情況也比DES慢上倍,無論是軟體還是硬體實現。速度一直是RSA的缺陷。一般來說只用於少量數據加密。

四、RSA的選擇密文攻擊

RSA在選擇密文攻擊面前很脆弱。一般攻擊者是將某一信息作一下偽裝( Blind),讓擁有私鑰的實體簽署。然後,經過計算就可得到它所想要的信息。實際上,攻擊利用的都是同一個弱點,即存在這樣一個事實:乘冪保留了輸入的乘法結構:

( XM )^d = X^d *M^d mod n

前面已經提到,這個固有的問題來自於公鑰密碼系統的最有用的特徵--每個人都能使用公鑰。但從演算法上無法解決這一問題,主要措施有兩條:一條是採用好的公
鑰協議,保證工作過程中實體不對其他實體任意產生的信息解密,不對自己一無所知的信息簽名;另一條是決不對陌生人送來的隨機文檔簽名,簽名時首先使用
One-Way HashFunction 對文檔作HASH處理,或同時使用不同的簽名演算法。在中提到了幾種不同類型的攻擊方法。

五、RSA的公共模數攻擊

若系統中共有一個模數,只是不同的人擁有不同的e和d,系統將是危險的。最普遍的情況是同一信息用不同的公鑰加密,這些公鑰共模而且互質,那末該信息無需私鑰就可得到恢復。設P為信息明文,兩個加密密鑰為e1和e2,公共模數是n,則:

C1 = P^e1 mod n

C2 = P^e2 mod n

密碼分析者知道n、e1、e2、C1和C2,就能得到P。

因為e1和e2互質,故用Euclidean演算法能找到r和s,滿足:

r * e1 + s * e2 = 1

假設r為負數,需再用Euclidean演算法計算C1^(-1),則

( C1^(-1) )^(-r) * C2^s = P mod n

另外,還有其它幾種利用公共模數攻擊的方法。總之,如果知道給定模數的一對e和d,一是有利於攻擊者分解模數,一是有利於攻擊者計算出其它成對的e』和d』,而無需分解模數。解決辦法只有一個,那就是不要共享模數n。

RSA的小指數攻擊。 有一種提高 RSA速度的建議是使公鑰e取較小的值,這樣會使加密變得易於實現,速度有
所提高。但這樣作是不安全的,對付辦法就是e和d都取較大的值。

RSA演算法是
第一個能同時用於加密和數字簽名的演算法,也易於理解和操作。RSA是被研究得最廣泛的公鑰演算法,從提出到現在已近二十年,經歷了各種攻擊的考驗,逐漸為人
們接受,普遍認為是目前最優秀的公鑰方案之一。RSA的安全性依賴於大數的因子分解,但並沒有從理論上證明破譯RSA的難度與大數分解難度等價。即RSA
的重大缺陷是無法從理論上把握它的保密性能
如何,而且密碼學界多數人士傾向於因子分解不是NPC問題。
RSA的缺點主要有:A)產生密鑰很麻煩,受到素數產生技術的限制,因而難以做到一次一密。B)分組長度太大,為保證安全性,n 至少也要 600
bits
以上,使運算代價很高,尤其是速度較慢,較對稱密碼演算法慢幾個數量級;且隨著大數分解技術的發展,這個長度還在增加,不利於數據格式的標准化。目
前,SET( Secure Electronic Transaction )協議中要求CA採用比特長的密鑰,其他實體使用比特的密鑰。

C語言實現

#include <stdio.h>
int candp(int a,int b,int c)
{ int r=1;
b=b+1;
while(b!=1)
{
r=r*a;
r=r%c;
b--;
}
printf("%d\n",r);
return r;
}
void main()
{
int p,q,e,d,m,n,t,c,r;
char s;
printf("please input the p,q: ");
scanf("%d%d",&p,&q);
n=p*q;
printf("the n is %3d\n",n);
t=(p-1)*(q-1);
printf("the t is %3d\n",t);
printf("please input the e: ");
scanf("%d",&e);
if(e<1||e>t)
{
printf("e is error,please input again: ");
scanf("%d",&e);
}
d=1;
while(((e*d)%t)!=1) d++;
printf("then caculate out that the d is %d\n",d);
printf("the cipher please input 1\n");
printf("the plain please input 2\n");
scanf("%d",&r);
switch(r)
{
case 1: printf("input the m: "); /*輸入要加密的明文數字*/
scanf("%d",&m);
c=candp(m,e,n);
printf("the cipher is %d\n",c);break;
case 2: printf("input the c: "); /*輸入要解密的密文數字*/
scanf("%d",&c);
m=candp(c,d,n);
printf("the cipher is %d\n",m);break;
}
getch();
}

④ 求RSA演算法的源代碼(c語言)

這個是我幫個朋友寫的,寫的時候發現其實這個沒那麼復雜,不過,時間復雜度要高於那些成型了的,為人所熟知的rsa演算法的其他語言實現.
#include
int
candp(int
a,int
b,int
c)
{
int
r=1;
b=b+1;
while(b!=1)
{
r=r*a;
r=r%c;
b--;
}
printf("%d",r);
return
r;
}
void
main()
{
int
p,q,e,d,m,n,t,c,r;
char
s;
{printf("input
the
p:\n");
scanf("%d\n",&p);
printf("input
the
q:\n");
scanf("%d%d\n",&p);
n=p*q;
printf("so,the
n
is
%3d\n",n);
t=(p-1)*(q-1);
printf("so,the
t
is
%3d\n",t);
printf("please
intput
the
e:\n");
scanf("%d",&e);
if(e<1||e>t)
{printf("e
is
error,please
input
again;");
scanf("%d",&e);}
d=1;
while
(((e*d)%t)!=1)
d++;
printf("then
caculate
out
that
the
d
is
%5d",d);
printf("if
you
want
to
konw
the
cipher
please
input
1;\n
if
you
want
to
konw
the
plain
please
input
2;\n");
scanf("%d",&r);
if(r==1)
{
printf("input
the
m
:"
);/*輸入要加密的明文數字*/
scanf("%d\n",&m);
c=candp(m,e,n);
printf("so
,the
cipher
is
%4d",c);}
if(r==2)
{
printf("input
the
c
:"
);/*輸入要解密的密文數字*/
scanf("%d\n",&c);
m=candp(c,d,n);
printf("so
,the
cipher
is
%4d\n",m);
printf("do
you
want
to
use
this
programe:yes
or
no");
scanf("%s",&s);
}while(s=='y');
}
}

⑤ 求RSA 的C++源代碼 !謝謝!

請注意保存,以防失效,如果幫到你,請採納

⑥ 求正確的RSA加密解密演算法C語言的,多謝。

RSA演算法它是第一個既能用於數據加密也能用於數字簽名的演算法。它易於理解和操作,也很流行。演算法的名字以發明者的名字命名:RonRivest,AdiShamir和LeonardAdleman。但RSA的安全性一直未能得到理論上的證明。它經歷了各種攻擊,至今未被完全攻破。一、RSA演算法:首先,找出三個數,p,q,r,其中p,q是兩個相異的質數,r是與(p-1)(q-1)互質的數p,q,r這三個數便是privatekey接著,找出m,使得rm==1mod(p-1)(q-1)這個m一定存在,因為r與(p-1)(q-1)互質,用輾轉相除法就可以得到了再來,計算n=pqm,n這兩個數便是publickey編碼過程是,若資料為a,將其看成是一個大整數,假設a=n的話,就將a表成s進位(s因為rm==1mod(p-1)(q-1),所以rm=k(p-1)(q-1)+1,其中k是整數因為在molo中是preserve乘法的(x==ymodzan==vmodz=>xu==yvmodz),所以,c==b^r==(a^m)^r==a^(rm)==a^(k(p-1)(q-1)+1)modpq1.如果a不是p的倍數,也不是q的倍數時,則a^(p-1)==1modp(費馬小定理)=>a^(k(p-1)(q-1))==1modpa^(q-1)==1modq(費馬小定理)=>a^(k(p-1)(q-1))==1modq所以p,q均能整除a^(k(p-1)(q-1))-1=>pq|a^(k(p-1)(q-1))-1即a^(k(p-1)(q-1))==1modpq=>c==a^(k(p-1)(q-1)+1)==amodpq2.如果a是p的倍數,但不是q的倍數時,則a^(q-1)==1modq(費馬小定理)=>a^(k(p-1)(q-1))==1modq=>c==a^(k(p-1)(q-1)+1)==amodq=>q|c-a因p|a=>c==a^(k(p-1)(q-1)+1)==0modp=>p|c-a所以,pq|c-a=>c==amodpq3.如果a是q的倍數,但不是p的倍數時,證明同上4.如果a同時是p和q的倍數時,則pq|a=>c==a^(k(p-1)(q-1)+1)==0modpq=>pq|c-a=>c==amodpqQ.E.D.這個定理說明a經過編碼為b再經過解碼為c時,a==cmodn(n=pq)但我們在做編碼解碼時,限制0intcandp(inta,intb,intc){intr=1;b=b+1;while(b!=1){r=r*a;r=r%c;b--;}printf("%d\n",r);returnr;}voidmain(){intp,q,e,d,m,n,t,c,r;chars;printf("pleaseinputthep,q:");scanf("%d%d",&p,&q);n=p*q;printf("thenis%3d\n",n);t=(p-1)*(q-1);printf("thetis%3d\n",t);printf("pleaseinputthee:");scanf("%d",&e);if(et){printf("eiserror,pleaseinputagain:");scanf("%d",&e);}d=1;while(((e*d)%t)!=1)d++;printf("thencaculateoutthatthedis%d\n",d);printf("thecipherpleaseinput1\n");printf("theplainpleaseinput2\n");scanf("%d",&r);switch(r){case1:printf("inputthem:");/*輸入要加密的明文數字*/scanf("%d",&m);c=candp(m,e,n);printf("thecipheris%d\n",c);break;case2:printf("inputthec:");/*輸入要解密的密文數字*/scanf("%d",&c);m=candp(c,d,n);printf("thecipheris%d\n",m);break;}getch();}

⑦ 怎樣用c語言實現rsa演算法

* RSA.H - header file for RSA.C
*/

/* Copyright (C) RSA Laboratories, a division of RSA Data Security,
Inc., created 1991. All rights reserved.
*/

int RSAPublicEncrypt PROTO_LIST
((unsigned char *, unsigned int *, unsigned char *, unsigned int,
R_RSA_PUBLIC_KEY *, R_RANDOM_STRUCT *));
int RSAPrivateEncrypt PROTO_LIST
((unsigned char *, unsigned int *, unsigned char *, unsigned int,
R_RSA_PRIVATE_KEY *));
int RSAPublicDecrypt PROTO_LIST
((unsigned char *, unsigned int *, unsigned char *, unsigned int,
R_RSA_PUBLIC_KEY *));
int RSAPrivateDecrypt PROTO_LIST
((unsigned char *, unsigned int *, unsigned char *, unsigned int,
R_RSA_PRIVATE_KEY *));

⑧ C++實現RSA加密解密演算法

#include <iostream>
using namespace std;

template <class HugeInt>
HugeInt Power( const HugeInt & x, const HugeInt & n, // 求x^n mod p
const HugeInt & p )
{
if( n == 0 )
return 1;

HugeInt tmp = Power( ( x * x ) % p, n / 2, p );

if( n % 2 != 0 )
tmp = ( tmp * x ) % p;

return tmp;
}

template <class HugeInt>
void fullGcd( const HugeInt & a, const HugeInt & b, //
HugeInt & x, HugeInt & y )
{
HugeInt x1, y1;

if( b == 0 )
{
x = 1;
y = 0;
}
else
{
fullGcd( b, a % b, x1, y1 );
x = y1;
y = x1 - ( a / b ) * y1;
}
}

template <class HugeInt>
HugeInt inverse( const HugeInt & p, const HugeInt & q, // 求d
const HugeInt & e )
{
int fyn = ( 1 - p ) * ( 1 - q );
HugeInt x, y;

fullGcd( fyn, e, x, y );
return x > 0 ? x : x + e;
}

int main( )
{
cout << "Please input the plaintext: " << endl;
int m;
cin >> m;
cout << "Please input p,q and e: " << endl;
int p, q, e;
cin >> p >> q >> e;
int n = p * q;
int d = inverse( p, q, e );
int C = Power( m, e, n );
cout << "The ciphertext is: " << C << endl;
cout << "\n\nPlease input the ciphertext: " << endl;
cin >> C;
cout << "\n\nPlease input p, q and d: " << endl;
cin >> p >> q >> d;
n = p * q;
m = Power( C, d, n );
cout <<"The plaintext is: " << m << endl << endl;

system( "pause" );
return 0;
}

這就是RSA加密解密演算法

⑨ C++如何實現RSA數據加密的演算法

void CRSAEncriptDlg::OnOK()
{
UpdateData(); //選取素數p和q
int p = 43;
int q = 59;
//計算n
int n = p*q;
int cn = (p-1)*(q-1); //選取b
int b = 5;
//選取a,使a*b-cn*x=1
int a =1949;
//將明文以兩個字元為一組進行分組,以00表示a,01表示b,03表示c,......

if (m_Info.IsEmpty())
{
MessageBox("請輸入加密信息");
return;
}
int len = m_Info.GetLength();
if (len %2 != 0)
{
MessageBox("輸入的字元數必須為偶數");
return;
}
//存儲明文的數字化格式
int iData[100];// = new int(len);
int index = 0;
CString str;
for (int i = 0 ; i< len; i++,index++)
{
int one = m_Info[i]-97;
int two = m_Info[i+1]-97;
if (two<10)
str.Format("%i0%i",one,two);
else
str.Format("%i%i",one,two);
iData[index] = atoi(str);
i++;
}
//對明文數字進行加密
//c= E(m) = m^b mod n m為明文數字
m_Encript = "";
for (i = 0 ; i< index ; i++)
{
iData[i] = ((UINT64) pow(iData[i],b)) % n;
if (i != index-1)
str.Format("%i-",iData[i]);
else
str.Format("%i",iData[i]);
m_Encript+=str;
}
UpdateData(FALSE);
}

熱點內容
s3哪個配置性價比高 發布:2025-03-17 13:06:09 瀏覽:317
氣體壓縮能量 發布:2025-03-17 13:00:16 瀏覽:75
壓縮油19 發布:2025-03-17 12:25:29 瀏覽:855
linux上網代理 發布:2025-03-17 12:23:56 瀏覽:359
c是高級語言嗎 發布:2025-03-17 12:16:31 瀏覽:523
python泛型 發布:2025-03-17 12:15:01 瀏覽:482
編程貓被盜 發布:2025-03-17 12:02:18 瀏覽:131
海關鎖密碼箱如何設置新密碼 發布:2025-03-17 11:53:50 瀏覽:560
農業卡號的密碼在哪裡改 發布:2025-03-17 11:48:57 瀏覽:966
楊瀾超級訪問 發布:2025-03-17 11:47:17 瀏覽:237