資源簡介
用Pohlig-Hellman算法加密文件,屬于密碼學問題,用Java編寫.
代碼片段和文件信息
import?java.math.*;
import?java.security.SecureRandom;
import?java.util.*;
public?class?BigIntegerMath?{
???//Define?some?BigInteger?constants;?this?is?handy?for?comparisons
???static?final?BigInteger?ZERO=new?BigInteger(“0“);
???static?final?BigInteger?ONE=new?BigInteger(“1“);
???static?final?BigInteger?TWO=new?BigInteger(“2“);
???static?final?BigInteger?THREE=new?BigInteger(“3“);
???static?final?BigInteger?FOUR=new?BigInteger(“4“);
???//A?nonrecursive?version?of?euclid.??It?returns?an?array?answer?of?3?BigIntegers
???//answer[0]?is?the?gcd?answer[1]?is?the?coefficient?of?a?answer[2]?the?coeff?of?b
???public?static?BigInteger[]?euclid(BigInteger?aBigInteger?b)?throws?IllegalArgumentException?{
??????//Throw?an?exception?if?either?argument?is?not?positive
??????if?(a.com
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄??????????0??2013-03-19?21:01??PohligHellman
?????文件??????14030??2002-05-07?12:29??PohligHellman\BigIntegerMath.java
?????文件???????6442??2002-05-07?12:32??PohligHellman\PrimeGenerator.java
?????文件??????14373??2013-03-18?21:23??PohligHellman\Ciphers.java
?????文件???????4248??2002-05-07?12:34??PohligHellman\TestPohligHellmanCipherap
?????文件????????137??2013-03-19?21:05??PohligHellman\TestPohlingHellmanCipherap
-----------?---------??----------?-----??----
????????????????39230????????????????????6
評論
共有 條評論