📄 rsa.java
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package rsalab;import java.util.Random;import java.math.BigInteger;/** * * @author Fredrik *//** * * @author Fredrik */public class RSA { private BigInteger n; private BigInteger e; private BigInteger d; //initiate RSA with length of n equal to bitlength public RSA(int bitLength){ Random rndGen=new Random(1); //create p and q, size bitlength/2 //calculate n //calculate fi(n)=(p-1)(q-1) //create e //calculate d } public byte[] encrypt(byte[] plaintext){ byte[] ciphertext={0,0}; return ciphertext; } public byte[] decrypt(byte[] ciphertext){ byte[] plaintext={0,0}; return plaintext; } public byte[] getPublicExponent(){ byte[] eBytes=null; return eBytes; } public byte[] getN(){ byte[] nBytes=null; return nBytes; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -