Last active
May 4, 2024 19:52
-
-
Save Tknott95/9bd62b91b5f4f5d7c2ef72f64a9e3c88 to your computer and use it in GitHub Desktop.
runemilio reverse engineer aes-256-cbc wallet encodings
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
const crypto = require('crypto'); | |
// will give example strings later | |
const hexString = ""; | |
const base64String = ""; | |
const encryptedData = ""; | |
// Convert hexadecimal string to a buffer for the key | |
const keyBuffer = Buffer.from(hexString, 'hex'); | |
// Convert base64-encoded string to a buffer for the IV | |
const ivBuffer = Buffer.from(base64String, 'base64'); | |
const decipher = crypto.createDecipheriv('aes-256-cbc', keyBuffer, ivBuffer); | |
let decryptedData = ''; | |
decipher.on('readable', () => { | |
let chunk; | |
while (null !== (chunk = decipher.read())) { | |
decryptedData += chunk.toString('utf8'); | |
} | |
}); | |
decipher.on('end', () => { | |
console.log('Decrypted data:', decryptedData); | |
}); | |
decipher.write(encryptedData, 'base64'); | |
decipher.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment