From a54dd4e961816a13054a6f561418908e13c64b5a Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 25 Jun 2018 15:04:16 +0000 Subject: Basic HTML framework and created initial JavaScript. --- www/index.html | 44 ++++++++------------------------------------ www/scripts/main.js | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 36 deletions(-) create mode 100644 www/scripts/main.js diff --git a/www/index.html b/www/index.html index 09ab51c..ad0c0ed 100644 --- a/www/index.html +++ b/www/index.html @@ -5,47 +5,19 @@ PassMan + -Source:
-Passphrase:
-Result:
-Decrypted:
- - - +
+Passphrase: +  +  + - +
diff --git a/www/scripts/main.js b/www/scripts/main.js new file mode 100644 index 0000000..e3c1f7b --- /dev/null +++ b/www/scripts/main.js @@ -0,0 +1,16 @@ + +function AESEncrypt(source, phrase) +{ + var encryptedAES = CryptoJS.AES.encrypt(source, phrase); + + return encryptedAES.toString(); +} + +function AESDecrypt(source, phrase) +{ + var decryptedBytes = CryptoJS.AES.decrypt(source, phrase); + + return decryptedBytes.toString(CryptoJS.enc.Latin1); +} + +// vim: sw=4 ts=4 -- cgit v1.2.3