I have an decryption function that uses crypto from nodejs to decrypt them. But I would like to conver them to CryptoJs library. So far when I checked cryptoJs documentation, I am unable to figure out any equivalent function for them.
export const decryptURl=(string)=>{
const CRYPTO_KEY='keycode'
const iv = crypto
.createHash("sha256")
.update(CRYPTO_KEY)
.digest();
const key = crypto
.createHash("sha256")
.update(CRYPTO_KEY)
.digest();
const resizedIV = Buffer.allocUnsafe(16);
iv.copy(resizedIV);
const decipher = crypto.createDecipheriv('aes256', key, resizedIV);
let decrypted = decipher.update(string, 'hex', 'utf8')
return decrypted;
}
Is there a way to convert these code to use cryptoJs library?
Are there equivalent functions or another separate library for doing this?