⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inputparameter.java

📁 RSA编码与解码
💻 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 + -