Blowfish加密算法源码

Blowfish加密算法源码。

     这个Blowfish源码来自jive3.X,使用实例:


public  class BlowfishTest{ 
       public  static void main(String [] args){
        //实际应用中这里应是个随机数
String keyString = "hello cnjbb!"; String testString = "独孤求胜"; System.out.println("加密前**************\n"+"testString = "+testString); Blowfish crypt = new Blowfish(keyString);
System.out.println("开始加密"); testString = crypt.encryptString(testString); System.out.println("加密之后**************\n"+"testString = "+testString); System.out.println("开始解密"); testString = crypt.decryptString(testString); System.out.println("解密之后**************\n"+"testString = "+testString); }   }

运行结果:



 
  

你可能感兴趣的:(Blowfish加密算法源码)