使用blowfish算法加密消息

时间:2016-06-30 07:09:54

标签: blowfish

 public static String deskripsi(String chiperText, String key) {
   try {
     SecretKeySpec KS = new SecretKeySpec(key.getBytes(), "Blowfish");
     Cipher cipher = Cipher.getInstance("Blowfish");
     cipher.init(Cipher.DECRYPT_MODE, KS);
     byte[] decrypted = cipher.doFinal(Base64.decode(chiperText, Base64.NO_PADDING));
     return new String(decrypted);
   } catch (Exception e) {
     return "ERROR";
   }
 }

如何编写代码来搜索手动计算blowfish算法来加密消息?

0 个答案:

没有答案