展开全部
import javax.crypto.Cipher;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.security.Key;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.SecureRandom;
public class RSA_Encrypt {
/** 指定加密算法为62616964757a686964616fe58685e5aeb931333339656465DESede */
private static String ALGORITHM = "RSA";
/** 指定key的大小 */
private static int KEYSIZE = 128;
/** 指定公钥存放文件 */
private static String PUBLIC_KEY_FILE = "PublicKey";
/** 指定私钥存放文件 */
private static String PRIVATE_KEY_FILE = "PrivateKey";
// private static String PUBLIC_KEY_FILE &