interconnect/model/src/main/java/de/taimos/dvalin/interconnect/model/MessageCryptoUtil.java
/**
     * start this to generate an AES key or (de/en)crypt data
     *
     * @param args the CLI arguments
     */
start this to generate an AES key or (de/en)crypt data
@param args the CLI arguments
start this to generate an AES key or ( de / en ) crypt data @param args the CLI arguments
@SuppressWarnings("resource")
    public static void main(String[] args) {
        try {
            System.out.println("Select (k=generate key; c=crypt; d=decrypt):");
            System.out.println();
            Scanner scan = new Scanner(System.in, "UTF-8");
            if (!scan.hasNextLine()) {
                return;
            }
            switch (scan.nextLine()) {
                case "k":
                    MessageCryptoUtil.generateKey();
                    break;
                case "c":
                    System.out.print("Input data: ");
                    final String data = scan.nextLine();
                    System.out.println(MessageCryptoUtil.crypt(data));
                    break;
                case "d":
                    System.out.print("Input data: ");
                    final String ddata = scan.nextLine();
                    System.out.println(MessageCryptoUtil.decrypt(ddata));
                    break;
                default:
                    break;
            }
        } catch (final Exception e) {
            e.printStackTrace();
        }
    }
@ SuppressWarnings ( "resource" ) public static void main ( String [ ] args ) { try { System . out . println ( "Select (k=generate key; c=crypt; d=decrypt):" ) ; System . out . println ( ) ; Scanner scan = new Scanner ( System . in , "UTF-8" ) ; if ( ! scan . hasNextLine ( ) ) { return ; } switch ( scan . nextLine ( ) ) { case "k" : MessageCryptoUtil . generateKey ( ) ; break ; case "c" : System . out . print ( "Input data: " ) ; final String data = scan . nextLine ( ) ; System . out . println ( MessageCryptoUtil . crypt ( data ) ) ; break ; case "d" : System . out . print ( "Input data: " ) ; final String ddata = scan . nextLine ( ) ; System . out . println ( MessageCryptoUtil . decrypt ( ddata ) ) ; break ; default : break ; } } catch ( final Exception e ) { e . printStackTrace ( ) ; } }
start this to generate an AES key or (de/en)crypt data
 @param args the CLI arguments
start this to generate an AES key or ( de / en ) crypt data @param args the CLI arguments