Hello i'm trying to decrypt a base64 string with php and i can't figure it out.
I am able to decrypt it with JavaScript using CryptoJS with the code below
var data = 'encrypted_url';
var key = "my_token";
function decryptByDES(cipherTextString, keyString) {
var keyHex = CryptoJS.enc.Utf8.parse(keyString);
var decrypted = CryptoJS.DES.decrypt({
ciphertext: CryptoJS.enc.Base64.parse(cipherTextString)
}, keyHex, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
});
return decrypted.toString(CryptoJS.enc.Utf8);
}
console.log(decryptByDES(data, key);
What is the equivalent of this code in PHP?
source https://stackoverflow.com/questions/70094214/how-to-decode-a-string-in-base64-with-php
Comments
Post a Comment