diff options
author | Shawn Severin <shawn.severin@amdocs.com> | 2017-12-07 15:19:25 -0500 |
---|---|---|
committer | Shawn Severin <shawn.severin@amdocs.com> | 2017-12-07 15:19:46 -0500 |
commit | a7b4b96afee33a2ff458f906742d88cd306ed961 (patch) | |
tree | dcf2b16fdc4f52368327d372112cebaf126a1ded /src/utils/Crypto.js | |
parent | 6ac2e7c0bef5ee478b36181b8bb384119ad3d937 (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.js | 22 |
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 +}; |