TestMain.java 954 B

123456789101112131415161718192021222324252627282930
  1. import com.min.base64.Base64;
  2. import com.min.des.DesUtils;
  3. public class TestMain {
  4. /**
  5. * @param args
  6. * @throws Exception
  7. */
  8. public static void main(String[] args) throws Exception {
  9. // System.out.println(SHA1.enCoded("10000004" + "q1111111"));
  10. // System.out.println(SHA1.enCoded("10000005" + "q1111111"));
  11. // System.out.println(SHA1.enCoded("10000006" + "q1111111"));
  12. // System.out.println(SHA1.enCoded("10000007" + "q1111111"));
  13. String desDe = Base64.encode(DesUtils.getInstance().encrypt(Base64.encode("123432145321").getBytes(),"123445678".getBytes(), null));
  14. System.out.println(desDe);
  15. String string = new String(DesUtils.getInstance().decrypt(Base64.decodeBytes(desDe), "123445678".getBytes(), null));
  16. String code = Base64.decode(string);
  17. System.out.println(code);
  18. // byte[] decrypt = DesUtils.getInstance().decrypt(code.getBytes(), "123445678".getBytes(), null);
  19. // System.out.println(decrypt.toString());
  20. }
  21. }