Content pfp
Content
@
0 reply
0 recast
2 reactions

Daniel Lombraña pfp
Daniel Lombraña
@teleyinex.eth
You learn Small things along the way. Encrypting with AES256 is "simple" once you know how to do it properly because it has many parameters. Basically, it is important to remember that you have to pass -A for the base64 encoding so you can URL encode it later on and decrypt it in any server. Why? Because by default, OpenSSL adds break lines to support old systems. Example with OpenSSL: printf "this is something that you want to keep secret" | /usr/bin/openssl enc -aes-256-cbc -pass pass:"the strongest password of the world" -a -salt -md md5 -e -base64 -A Then, you can URL encode the output and decrypt it directly (after decoding the URL encode) with this JS code: const CryptoJS = require("crypto-js"); var encrypted = "encrypted output from previous command" var bytes = CryptoJS.AES.decrypt(encrypted, "the strongest password of the world"); var originalText = bytes.toString(CryptoJS.enc.Utf8); console.log(originalText); Done!
0 reply
0 recast
3 reactions