DEV Community

Discussion on: Understanding Hacking 101...

Collapse
 
crimsonmed profile image
Médéric Burlet • Edited

I agree this is so basic. It can easilly be tested in node.js
npmjs.com/package/bcrypt

You can just do:

bcrypt.hash("myPassword", 10, function(err, hash) {
    // Store hash in your password DB.
    console.log(`hash: ${hash}`)
});

bcrypt.hash("myPassword", 10, function(err, hash) {
    // Store hash in your password DB.
    console.log(`hash2: ${hash}`)
});

The two passwords have different hashes.

Furthermore the concept of SALT is basic and easily showcased via node:

codesandbox.io/s/amazing-almeida-b...

I also don't see why this is tagged #javascript when there is no code in the thread

Collapse
 
utkarshyadav profile image
Utkarsh Yadav

Thanks @Médéric Burlet ❤
For helping people understand what Salt is...😊
And also thanks for contributing your code Example in this thread..

Tag is a keyword or term assigned to a piece of information. A kind of metadata helps describe an item and allows it to be found again by browsing or searching.

So. I did tagged JavaScript.... for helping other user find this post intact with JavaScript Keyword ...

And my purpose was not to explain only what salting is.. But how these stuff happens.. (ONLY BASICs) .

Thread Thread
 
crimsonmed profile image
Médéric Burlet

I think you dont have to put the code but explaining how to overcome the problem with salt is a good conclusion to the article. You can explain the generic concept how you add some random string to the original password and hash that so there is randomness in the password.

Of course salting has to be done properly and be secured in it's own way. This is why Bcrypt is very practical.