RSA加密解密代码 public void keypair()throws Exception{ Map<String, Object> strObjMap = RSAUtils.initKey(); String publicKey = RSAUtils.getPublicKey(strObjMap); byte[] bytes = RSAUtils.encryptByPublicKey("1234567@".getBytes(), publicKey);//加密完成 String privateKey = RSAUtils.getPrivateKey(strObjMap); byte[] pwd = RSAUtils.decryptByPrivateKey(bytes, privateKey);//解密完成 char[] charpwd = getChars(pwd); System.out.println(new String(pwd));//显示加密内容 }
RSA加密解密代码
最新推荐文章于 2024-06-25 02:40:23 发布