summaryrefslogtreecommitdiffstats
path: root/src/utils/Crypto.js
diff options
context:
space:
mode:
authorShawn Severin <shawn.severin@amdocs.com>2017-12-07 15:19:25 -0500
committerShawn Severin <shawn.severin@amdocs.com>2017-12-07 15:19:46 -0500
commita7b4b96afee33a2ff458f906742d88cd306ed961 (patch)
treedcf2b16fdc4f52368327d372112cebaf126a1ded /src/utils/Crypto.js
parent6ac2e7c0bef5ee478b36181b8bb384119ad3d937 (diff)
Adding filter bar
Issue-ID: AAI-543 Change-Id: I18ec69f4585a9f01feafd009fcd30493a039b064 Signed-off-by: Shawn Severin <shawn.severin@amdocs.com>
Diffstat (limited to 'src/utils/Crypto.js')
-rw-r--r--src/utils/Crypto.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/utils/Crypto.js b/src/utils/Crypto.js
new file mode 100644
index 0000000..c2b34a0
--- /dev/null
+++ b/src/utils/Crypto.js
@@ -0,0 +1,22 @@
+/**
+ * Created by salmaat on 7/13/2017.
+ */
+import CryptoJS from 'crypto-js';
+
+var key = 'key2017';
+
+function encrypt(text) {
+ var encrypted = CryptoJS.AES.encrypt(text, key);
+ return encrypted.toString().split('/').join('*');
+}
+
+function decrypt(text) {
+ var decrypted = CryptoJS.AES.decrypt(text.split('*').join('/'), key);
+ return decrypted.toString(CryptoJS.enc.Utf8);
+}
+
+
+module.exports = {
+ encrypt: encrypt,
+ decrypt: decrypt
+};