Use bcrypt, por quê?
http://codahale.com/how-to-safely-store-a-password/
ncb000gt criou um módulo incrível para fazer exatamente isso!
https://github.com/ncb000gt/node.bcrypt.js/
bcrypt.hash('password', 5, function( err, bcryptedPassword) {
//save to db
});
//to compare password that user supplies in the future
var hash = getFromDB(..);
bcrypt.compare(userSuppliedPassword, hash, function(err, doesMatch){
if (doesMatch){
//log him in
}else{
//go away
}
});
Grandes adereços para ncb000gt (Nick Campbell) por fazer este módulo incrível