Skip to content

Instantly share code, notes, and snippets.

@Tknott95
Last active May 4, 2024 19:52
Show Gist options
  • Save Tknott95/9bd62b91b5f4f5d7c2ef72f64a9e3c88 to your computer and use it in GitHub Desktop.
Save Tknott95/9bd62b91b5f4f5d7c2ef72f64a9e3c88 to your computer and use it in GitHub Desktop.
runemilio reverse engineer aes-256-cbc wallet encodings
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