Created
November 4, 2019 15:16
-
-
Save adamTrz/e6a67ab997a6f779967f1e92671df657 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const decrypt = (encryptedHex: string) => { | |
| const encryptedBytes = aes.utils.hex.toBytes(encryptedHex); | |
| const aesCtr = new aes.ModeOfOperation.ctr(aes256key); | |
| const decryptedBytes = aesCtr.decrypt(encryptedBytes); | |
| const decryptedText = aes.utils.utf8.fromBytes(decryptedBytes); | |
| return decryptedText; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment