Ejemplo n.º 1
0
  public static void main(String[] args) {
    try {
      // 입력 파일 이름을 입력받는다
      Scanner stdin = new Scanner(System.in);
      System.out.println("Input File Name");
      String fileName = stdin.nextLine();
      // 파일 읽음
      FileRead in = new FileRead(fileName);
      // 출력 파일 이름을 입력받는다
      System.out.println("Output File Name");
      fileName = stdin.nextLine();
      // 파일 기록
      FileWrite out = new FileWrite(fileName);
      // 암호화
      Encrypt encrypt = new Encrypt();
      // 복호화
      Decrypt decrypt = new Decrypt();
      // 암호화된 문자열을 byte 배열에 담는다
      byte[] encryptText;
      // 복호화된 문자열 저장
      String decryptText;

      String plainText = in.fileRead();
      System.out.println("Plain Text : " + plainText);

      // 암호화
      encryptText = encrypt.encrypt(plainText);
      System.out.println("Encrypt Text : " + encryptText);

      out.fileWrite(encryptText);

      // 복호화
      decryptText = decrypt.decrypt(encryptText);
      System.out.println("Decrypt Text : " + decryptText);
    } catch (Exception e) {
      e.printStackTrace();
      System.out.println("Main Exception");
    }
  }
Ejemplo n.º 2
0
 /*     */ public void Stop() /*     */ {
   /* 281 */ this.RunKey = false;
   /* 282 */ FileWrite.Writetxt(databuffer, count, this.NBeanFrame.getSavePath());
   /*     */ }