コード例 #1
0
 /**
  * Static Main starting method
  *
  * @param args command line parameters
  */
 public static void main(String[] args) {
   try {
     long t1, t2;
     System.out.println("***** TEST STARTED *****");
     Des3Encrypter me = new Des3Encrypter();
     t1 = System.currentTimeMillis();
     me.doIt(args);
     t2 = System.currentTimeMillis();
     System.out.println("***** TEST FINISHED [" + (t2 - t1) + "]*****");
   } catch (Throwable th) {
     System.out.println("***** TEST FAILED *****");
     th.printStackTrace(System.out);
   }
 }
コード例 #2
0
  /**
   * Similar to main method but is not static
   *
   * @param args command line parameters
   * @throws Exception if something fails during the execution
   */
  public void doIt(String[] args) throws Exception {

    String s = encryptStr("un ejemplo");
    System.out.println(s);
    System.out.println(decryptStr(s));
    Des3Encrypter.decryptStr("");
  }