Advertisement
kiwiboi

hmac 512

Jul 17th, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var crypto = require('crypto');
  2.  
  3. var server_seed = 'qTGlqBvPdx.sUlKFIlv2DpZKamLE2q8gpoXazTDXz.YIPlWBfCrTo_WR13ieUMwE';
  4. var client_seed = '0000201572';
  5. var nonce = 1;
  6. var count = 1;
  7.  
  8. while (true) {
  9.     var hash = crypto.createHmac('sha512', server_seed).update(client_seed + ':' + nonce.toString()).digest('hex').substring(0, 1);
  10.     if (hash == '0') {
  11.         console.log('  0', nonce);
  12.         if (count++ == 1e2) break;
  13.     } else if (hash == 'f') {
  14.         console.log('  1', nonce);
  15.         if (count++ == 1e2) break;
  16.  
  17.     }
  18.  
  19.     nonce++;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement