-3

I've noticed that the node.js Javascript package for bcrypt requires lots of non-Javascript libraries - C++, Python 2.7, etc.

Why is this necessary? Is there something special about encryption that requires non-Javascript languages?

2
  • 2
    Looks like the node.js package is nothing more than a thin wrapper over the python bcrypt library (which itself uses a CPython module, I would guess for performance reasons). As you can see in the answer to stackoverflow.com/questions/14573488/… there is also a pure JS package available, which I guess will be some orders of magnitude slower. Commented Feb 16, 2017 at 11:40
  • 1
    Primarily because of code reusability - why would people bother writing all crypto/hash libraries for all languages, not to mention the time it takes to test those, just so you can have it 'native' everywhere? If one writes a library in C/C++, you can compile and use it on pretty much any platform in pretty much any language, so that's why those 'popular' libraries tend to be written mostly in C/C++ and you just get a wrapper for your desired language to make it easier to interface. In case of bcrypt, it's essentially a Python-wrapped C module, hence the requirement. Commented Feb 16, 2017 at 11:41

1 Answer 1

-1

A algorithm like bcrypt never depends on a specific language. All general-purpose-langauges like C, Java, Pyton, JS, PHP etc.etc. can be sued to implement such algorithms.

Why they chose to use eg. C instead of just JS is likely because, at least with the currently available tools (compiler, interpreter etc.), C programs are much faster than JS. Encrypting large data sets shouldn't be unnecessary slow.

Sign up to request clarification or add additional context in comments.

Comments

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.