0

Is there a way to do UNIX crypt(3) in javascript (in node.js, specifically)?

crypt(3) uses DES, I guess it can done by openssl, but how to access openssl from javascript?

Thanks

UPDATE

I found how to do it with node-ffi:

var ffi = require('node-ffi');

var libcrypt = ffi.Library('libcrypt', {
  'crypt': ['string', ['string', 'string']]
});

console.log(libcrypt.crypt('aa', 'bb'));
3
  • have you looked at this? nodejs.org/api/crypto.html Commented Mar 14, 2014 at 10:14
  • @ryanc1256: I checked and didn't find anything that does what crypt(3) does. Commented Mar 14, 2014 at 10:29
  • DES cipher is present in crypto. See crypto.getCiphers(). Commented Mar 14, 2014 at 11:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.