Created
July 17, 2020 19:26
-
-
Save artiya4u/668e856dff1b1ef021fade83d496e8a7 to your computer and use it in GitHub Desktop.
This file contains 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
CREATE TEMPORARY FUNCTION decrypt(_text STRING) RETURNS STRING LANGUAGE js AS | |
""" | |
let key = CryptoJS.enc.Utf8.parse("KEY"); | |
let options = { iv: CryptoJS.enc.Utf8.parse("IV"), mode: CryptoJS.mode.CBC }; | |
let _decrypt = CryptoJS.AES.decrypt(_text, key, options).toString(CryptoJS.enc.Utf8); | |
return _decrypt; | |
""" OPTIONS (library="gs://crypto-lib/crypto-js.min.js"); | |
SELECT decrypt('ENCRYPTED'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment