當前位置:編程學習大全網 - 編程軟體 - 請教RSA算法中的大素數選取問題

請教RSA算法中的大素數選取問題

尋找用什麽辦法得到素數的問題壹直是業界關註的,建議妳看看eurocrypt的會議資料,有很多。有壹本書叫做Handbook of Applied Cryptography,在http://www.cacr.math.uwaterloo.ca/hac/ 可以免費下載。對於樓下的幾點錯誤應指出的是,在RSA算法中,本身不存在所謂的RSA算法中的素性檢測算法。Prime generator本身就是壹個比較復雜的問題。用於生成大素數的軟件有很多,而且有很多是開放源代碼的,比如maple,如果想自己實現,可供參考。能通過素性檢測的數不都是素數,但是素數壹定能通過素性檢測。我的研究生論文是研究Large RSA moduli的,有問題隨時問

The big primes in RSA algorithm should be of same length, and co-prime. You can write a code which generates primes from 2,3,5,7.... until the bits you specified.

For example, you want to generate a prime which is of length 15 bits, just generate a prime which is larger than 2^15.

the pseudocode will be as followed:

int prime[MAX_INT],flag;

prime[0] = 2;

prime[1] = 3;

prime[2] = 5;

count = 3;

i = 7;

while ( i < 2^b) {

flag = 0;

for (j = 0, j<count; j++) {

if (i is not divided by j) flag = 1;

else {flag = 0;break;}

};

if (flag==1) {prime[count]=i;count++};

i++;

}

sorry for not being able to type Chinese, any questions, do not hesitate to ask me.

  • 上一篇:把照片變成卡通人物的軟件,誰知道呢.....
  • 下一篇:灑水泵葉輪怎麽更換?
  • copyright 2024編程學習大全網