From a7b4b96afee33a2ff458f906742d88cd306ed961 Mon Sep 17 00:00:00 2001 From: Shawn Severin Date: Thu, 7 Dec 2017 15:19:25 -0500 Subject: Adding filter bar Issue-ID: AAI-543 Change-Id: I18ec69f4585a9f01feafd009fcd30493a039b064 Signed-off-by: Shawn Severin --- src/utils/Crypto.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/utils/Crypto.js (limited to 'src/utils/Crypto.js') 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 +}; -- cgit 1.2.3-korg