diff --git a/src/main/java/StreamAesUtils.java b/src/main/java/StreamAesUtils.java index 14bf6bc..14dcf8e 100644 --- a/src/main/java/StreamAesUtils.java +++ b/src/main/java/StreamAesUtils.java @@ -19,21 +19,21 @@ public class StreamAesUtils { if (!hashMap.containsKey("nonce")) { return null; } - System.out.println("cipher=" + (hashMap.get("cipher"))); - System.out.println("username=" + (hashMap.get("username"))); - System.out.println("padding=" + (hashMap.get("padding"))); - System.out.println("algorithm=" + (hashMap.get("algorithm"))); - System.out.println("nonce=" + (hashMap.get("nonce"))); + System.err.println("cipher=" + (hashMap.get("cipher"))); + System.err.println("username=" + (hashMap.get("username"))); + System.err.println("padding=" + (hashMap.get("padding"))); + System.err.println("algorithm=" + (hashMap.get("algorithm"))); + System.err.println("nonce=" + (hashMap.get("nonce"))); return fromUserNonceSuperSecretKey(hashMap.get("username"), hashMap.get("nonce"), superSecretKey); } public static Aes fromUserNonceSuperSecretKey(String username, String nonce, String superSecretKey) throws NoSuchAlgorithmException { if (GenKey.generateDefaultUsername().equals(username)) { - System.out.println("AES use User Password"); + System.err.println("AES use User Password"); } else if ("none".equals(username)) { superSecretKey = GenKey.generateDefaultPsw(); } else { - System.out.println("AES key-exchange unknown username"); + System.err.println("AES key-exchange unknown username"); return null; } byte[] md5 = md5Digest(nonce + ":" + superSecretKey); diff --git a/src/main/java/main.kt b/src/main/java/main.kt index 9bb2a0b..6cbc537 100644 --- a/src/main/java/main.kt +++ b/src/main/java/main.kt @@ -30,19 +30,19 @@ class Args(parser: ArgParser) { fun main(args: Array) = mainBody { ArgParser(args).parseInto(::Args).run { if (keyExchange == null && nonce == null) { - println("Either the Key-Exchange or the nonce must be provided!") + System.err.println("Either the Key-Exchange or the nonce must be provided!") exitProcess(1) } if (cloudPassword == null) { - println("Cloud password not provided, using the default one for unprovisioned cameras") + System.err.println("Cloud password not provided, using the default one for unprovisioned cameras") } if (isatty(STDIN_FILENO) == 1) { - println("Data to ${if (encrypt) "encrypt" else "decrypt"} must be sent to standard input!") + System.err.println("Data to ${if (encrypt) "encrypt" else "decrypt"} must be sent to standard input!") exitProcess(1) } val toProcess = System.`in`.readAllBytesCompat() if (toProcess == null) { - println("Unable to read data from stdin!") + System.err.println("Unable to read data from stdin!") exitProcess(1) }