Code Monkey home page Code Monkey logo

cryptmd5-for-javascript's People

Contributors

blam avatar eisenkolb avatar f4810 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cryptmd5-for-javascript's Issues

Completely broken (on Node v8.1.2)

This module does not treat strings correctly as binary. No return values are valid. You need to pass 'binary' to Hash.prototype.update, or better yet, use Hash.prototype.digest without an argument (you get a Buffer object instead of a string).

Test:

var cryptmd5 = require('cryptmd5');
var cp = require('child_process');
var salts = [ '0000', 'UwV8', '92AB', '    ' ];
var passwords = [ 'password', '$iB7-tZeYp', '5a;eDIaT6Fq-NQe9:Ypj', 'UHMQUbac:_F%I*?8;HkuJdjsoVtBjzJz.J6?S;$%9,wB.cn.AKV*zrFT&3V6FN8c' ];
salts.forEach(function(salt) {
  passwords.forEach(function(password) {
    var opensslResult = cp.execSync('openssl passwd -1 -salt "' + salt + '" "' + password + '"').toString().trim();
    var cryptmd5Result = cryptmd5.cryptMD5(password, salt);
    console.log(opensslResult, cryptmd5Result, opensslResult == cryptmd5Result ? 'SUCCESS' : 'FAILED');
  });
});

Output:

$1$0000$aWwcZQIpZ/gD70N/fOUeh0 $1$0000$VtjqZ2dMBvsUmNcmmB1Er/ FAILED
$1$0000$xpuwLnUdN2/VgqV1upjQt. $1$0000$ex2.nm24yBAS3XGlKA60b1 FAILED
$1$0000$VVsZ2IjwX4v3spDLkCZsi/ $1$0000$dICRVw3Z6JLiBXSsFCwYM0 FAILED
$1$0000$JihTCFqGpBaZlIasx9cJ5/ $1$0000$3X7fya51Assg59llpHVkc0 FAILED
$1$UwV8$67M.3YMKh8ItI5.yhl2Zf/ $1$UwV8$khQeDiqg4YwEsGxgtduj20 FAILED
$1$UwV8$OhuhXlQvrBdWy4JjXneml. $1$UwV8$uxlS7CzJrekR3y.aRxelI/ FAILED
$1$UwV8$56rzDyLzsvjnH2MokZbrm/ $1$UwV8$6ufPuZ.0TrqpJWy4ttAHG/ FAILED
$1$UwV8$RQa12n7.dU.6upwj6GAkV1 $1$UwV8$u8MVnnJ8d7Yh7v3em54Ol. FAILED
$1$92AB$iMudtmg/UO2dhzZgBudkZ. $1$92AB$krAdB3zeYRH3wAXA51W4q0 FAILED
$1$92AB$QqZ6FsMqz3vz8I5G5fANX/ $1$92AB$IJVwiusUF79LG5.//eEOf1 FAILED
$1$92AB$1/Q9T0GVJfFcYz6U06jZ5. $1$92AB$E7NQo.JwLFfRx1pl2Tabb. FAILED
$1$92AB$kUZpMKw0PwWYMWdH69rtM. $1$92AB$QwgWY4UkWtVo4jgquZUPF0 FAILED
$1$    $XPcscamJTSm22xABupzQ1. $1$    $ijMahtW0Q.QMoyW9owq5F0 FAILED
$1$    $DKKvfQXvMMds4EFnGKQEe. $1$    $5HFfBZIoAuyYnxNwo7bem/ FAILED
$1$    $uvoJq39cchkkbuporqk2l1 $1$    $i7sNIdClAruCm/FZBAC3e/ FAILED
$1$    $/3965JlxdV8oXpaKAb4oY1 $1$    $0BhGzbd.v9e9ve.6EnEv6. FAILED

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.