1 package net.sourceforge.lightcrypto.test; 2 3 import net.sourceforge.lightcrypto.*; 4 5 import java.io.ByteArrayOutputStream ; 6 import java.io.DataOutputStream ; 7 import java.io.ByteArrayInputStream ; 8 9 import org.bouncycastle.util.encoders.Base64; 10 11 18 public class Run { 19 public static void main(String args[]) { 20 try { 21 22 23 24 System.out.println("ciphertext:" + PBECrypt.decrypt(new StringBuffer ("DW5WQMZuGkfKEg80QqDRrG1kOZ9gI/Pd"),new StringBuffer ("mypassword"))); 25 26 27 System.out.println("plain:" + PBECrypt.encrypt(new StringBuffer ("this is A test"),new StringBuffer ("mypassword"))); 28 29 129 130 138 139 142 144 146 148 150 152 154 156 158 161 163 167 170 171 174 180 181 184 } catch (Exception ex) { 185 ex.printStackTrace(); 186 System.out.println(ex.getMessage()); 187 } 188 } 189 } 190 | Popular Tags |