diff options
author | Tschaen, Brendan <ctschaen@att.com> | 2019-10-17 16:16:49 -0400 |
---|---|---|
committer | Tschaen, Brendan <ctschaen@att.com> | 2019-10-17 16:16:49 -0400 |
commit | 5ce93c11421b270e538f188857175d749d6a27cc (patch) | |
tree | 00e2c45c0b56b8a734d145960e49435a584bb75d | |
parent | 5300ffcc9f94bfe04b11485d9e0cdbc02db0bd22 (diff) |
Encrypt/Decrypt tool
Change-Id: If268c58fd20980d207c2533bd4fa4721e06baa85
Issue-ID: MUSIC-528
Signed-off-by: Tschaen, Brendan <ctschaen@att.com>
-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)); + } } |