public static String decode(String date_c) throws Exception { byte date_d[] = DES.tobytes(date_c); // System.out.println(date_d); byte date_e[] = DES.decode(date_d, key); // System.out.println(date_e); String date_f = new String(date_e); // System.out.println(date_f); return date_f; }
public static String encode(String date) throws Exception { // System.out.println(date); byte date_a[] = date.getBytes(); // System.out.println(date_a); byte date_b[] = DES.encode(date_a, key); // System.out.println(date_b); String date_c = DES.tostring(date_b); // System.out.println(date_c); return date_c; }