Last active
June 16, 2023 02:27
-
-
Save sachadee/08098738d6a3edf9030603ee635053eb to your computer and use it in GitHub Desktop.
AES ECB decryption in JavaScript
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script> | |
<script> | |
var encrypted ='gfp6wzvTH3lN5TO2B37yWQ=='; //python is base64 ECB | |
var key ='AAAAAAAAAAAAAAAA'//key used in Python | |
key = CryptoJS.enc.Utf8.parse(key); | |
var decrypted = CryptoJS.AES.decrypt(encrypted, key, {mode:CryptoJS.mode.ECB}); | |
console.log(decrypted.toString(CryptoJS.enc.Utf8)); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment