-
-
Save ChALkeR/515e505d3d922fbfd58f to your computer and use it in GitHub Desktop.
Inspecting memory with Buffer: crypto.pbkdf2
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
var crypto = require('crypto'); | |
var token = 'password' + Math.random().toString(32); | |
crypto.pbkdf2(token, 'salt', 1, 2, function(err, result) { console.log(result.length) } ) | |
var step = 0; | |
function inspect() { | |
var buf = (new Buffer(100)).toString('ascii'); | |
var ind = buf.indexOf(token); | |
if (ind !== -1) { | |
console.log('Found at step ' + step + ': ' + buf);//buf.substr(ind, token.length)); | |
} | |
} | |
for (step = 0; step < 10000; step++) { | |
inspect(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment