diff options
author | Thomas Nelson <nelson24@att.com> | 2020-01-03 06:45:41 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-01-03 06:45:41 +0000 |
commit | 795b11fcb6ca3822e8b089bb52e2d3619a4bc1f9 (patch) | |
tree | 0f24c1b71fc42d48b7f1ec158f7bfadf6ff8bcbc | |
parent | c2efe177fb1f418734e7d3d7ece32e7ddd97a640 (diff) | |
parent | 5ce93c11421b270e538f188857175d749d6a27cc (diff) |
Merge "Encrypt/Decrypt tool"
-rw-r--r-- | music-core/src/main/java/org/onap/music/main/CipherUtil.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/music-core/src/main/java/org/onap/music/main/CipherUtil.java b/music-core/src/main/java/org/onap/music/main/CipherUtil.java index 327022d5..3278dc12 100644 --- a/music-core/src/main/java/org/onap/music/main/CipherUtil.java +++ b/music-core/src/main/java/org/onap/music/main/CipherUtil.java @@ -259,13 +259,20 @@ public class CipherUtil { } } - /*public static void main(String[] args) { + public static void main(String[] args) { - System.out.println("Encrypted password: "+encryptPKC("cassandra")); + if (args.length < 2) { + System.out.println("Usage: java -jar CipherUtil <key> <password>"); + return; + } + + keyString = args[0]; + String password = args[1]; + + String enc = encryptPKC(password); + System.out.println("Encrypted password: " + enc); - System.out.println("Decrypted password: "+decryptPKC("dDhqAp5/RwZbl9yRSZg15fN7Qul9eiE/JFkKemtTib0=")); - System.out.println("Decrypted password: "+decryptPKC("I/dOtD/YYzBStbtOYhKuUUyPHSW2G9ZzdSyB8bJp4vk=")); - System.out.println("Decrypted password: "+decryptPKC("g7zJqg74dLsH/fyL7I75b4eySy3pbMS2xVqkrB5lDl8=")); - }*/ + System.out.println("Decrypted password (to verify): " + decryptPKC(enc)); + } } |