1

https://www.devglan.com/online-tools/aes-encryption-decryption

Encrypted data results as image

now if i decrypt the result using Node.js

const CryptoJS = require('crypto-js'); var bytes = CryptoJS.AES.decrypt('HcMV322sPPrFonlvXZ5pvFpXABVrxYVAXrEr9vcu7TIFOPNQVGq5svEv3959sRDxkDHB/nav80iGMPBiz8bDeA==', 'my secretkey 123'); var originalText = bytes.toString(CryptoJS.enc.Utf8); console.log(originalText, '--->'); 

image results in empty string

1
  • 1
    got the solution let keyUtf8 = CryptoJS.enc.Utf8.parse(secretKey) ENC = CryptoJS.AES.decrypt(ENC, keyUtf8, { mode: CryptoJS.mode.ECB, keySize: 128 }); ENC = CryptoJS.enc.Utf8.stringify(ENC).toString(); Commented Feb 19, 2020 at 8:02

1 Answer 1

1
let keyUtf8 = CryptoJS.enc.Utf8.parse(secretKey) ENC = CryptoJS.AES.decrypt(ENC, keyUtf8, { mode: CryptoJS.mode.ECB, keySize: 128 }); ENC = CryptoJS.enc.Utf8.stringify(ENC).toString(); 
Sign up to request clarification or add additional context in comments.

2 Comments

please add a small description
This may answer the question. However, code only answers are not as useful as answers that document the code or have an detailed explanation on why this code is the solution to the question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.