?? inputparameter.java
字號:
/**
*
*/
package RSA;
import java.io.*;
import RSA.Cipher;
import java.math.BigInteger;
import RSA.InputMessage;
/**
* @author Administrator
*
*/
public class InputParameter {
private byte[] primep;
private byte[] primeq;
private byte[] publickey;
Cipher cipher = new Cipher();
InputMessage inputMessage;
public InputParameter(){}
public void inputParameter(){
InputStream inputStream = System.in;
System.out.println("\nPlease enter the PrimeP:");
try{
primep = new byte[10];
inputStream.read(primep);
}catch(IOException ep){
ep.printStackTrace();
}
System.out.println("\nPlease enter the PrimeQ:");
try{
primeq = new byte[10];
inputStream.read(primeq);
}catch(IOException eq){
eq.printStackTrace();
}
//String qstring = new String(primeq);
System.out.println("\nPlease enter the EncryptKey:");
try{
publickey = new byte[10];
inputStream.read(publickey);
}catch(IOException epk){
epk.printStackTrace();
}
//String pkstring = new String(publickey).trim();
String pstring = new String(primep).trim();
String qstring = new String(primeq).trim();
String pkstring = new String(publickey).trim();
BigInteger primeQ = new BigInteger(qstring);
BigInteger primeP = new BigInteger(pstring);
BigInteger publicKey = new BigInteger(pkstring);
cipher.init(primeP, primeQ, publicKey);
inputMessage = new InputMessage(primeP, primeQ, publicKey);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -