lib/util/crypto.js
function encode(password, cb) {
  var secret_key = conf.secret_key
    , iterations = conf.pbkdf2_iterations
    , keylen = conf.pbkdf2_keylen;

  crypto.pbkdf2(password, secret_key, iterations, keylen, function(err, derivedKey) {
    var str;

    if(err) {
      cb(err);
    } else {
      str = new Buffer(derivedKey).toString('base64');
      cb(null, str);
    }
  });
}
function encode(password, cb) {
  var secret_key = conf.secret_key
    , iterations = conf.pbkdf2_iterations
    , keylen = conf.pbkdf2_keylen;

  crypto.pbkdf2(password, secret_key, iterations, keylen, function(err, derivedKey) {
    var str;

    if(err) {
      cb(err);
    } else {
      str = new Buffer(derivedKey).toString('base64');
      cb(null, str);
    }
  });
}
function encode ( password , cb ) { var secret_key = conf . secret_key , iterations = conf . pbkdf2_iterations , keylen = conf . pbkdf2_keylen ; crypto . pbkdf2 ( password , secret_key , iterations , keylen , function ( err , derivedKey ) { var str ; if ( err ) { cb ( err ) ; } else { str = new Buffer ( derivedKey ) . toString ( 'base64' ) ; cb ( null , str ) ; } } ) ; }
Passes an encoded version of `password` to `cb` or and error

@param password
@param cb
Passes an encoded version of password to cb or and error