question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create Authorization Script to check BCrypt Hash

See original GitHub issue

Our default encryption method for stored passwords in OpenLDAP from 3.0.* to 3.1.2 is BCrypt. OpenDJ does not support BCrypt, so we need to develop an authorization script that utilizes a python library that can verify the passwords using this hashing algorithm.

Here is one example:

http://passlib.readthedocs.io/en/stable/index.html

http://passlib.readthedocs.io/en/stable/lib/passlib.hash.bcrypt.html

>>> from passlib.hash import bcrypt

>>> # generate new salt, hash password
>>> h = bcrypt.hash("password")
>>> h
'$2a$12$NT0I31Sa7ihGEWpka9ASYrEFkhuTNeBQ2xfZskIiiJeyFXhRgS.Sy'

>>> # the same, but with an explicit number of rounds
>>> bcrypt.using(rounds=13).hash("password")
'$2b$13$HMQTprwhaUwmir.g.ZYoXuRJhtsbra4uj.qJPHrKsX5nGlhpts0jm'

>>> # verify password
>>> bcrypt.verify("password", h)
True
>>> bcrypt.verify("wrong", h)
False

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
colonhacommented, Jun 18, 2018

I tried but a subscriptions is required. Since they claim you can obtain and modify by your own i’m trying to contact them.

This version can only be downloaded with an active subscription

0reactions
yuremcommented, Aug 22, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Hash Passwords Using Bcrypt | by Patrick J. McDermott
In this article, I am going to discuss a relatively easy way to encrypt passwords using a cryptographic hashing library called Bcrypt. This...
Read more >
Node.js - Hash and Verify Passwords with Bcrypt
This code verifies the password 'Pa$$w0rd' using bcrypt against the hash stored in the passwordHash variable. const verified = bcrypt.
Read more >
Hashing in Action: Understanding bcrypt - Auth0
The bcrypt hashing function allows us to build a password security platform that scales with computation power and always hashes every ...
Read more >
Simplest way of Password Hashing with bcrypt by SilvenLEAF
//it creates the hashed password. Save this hashedPassword on your DB const hashedPassword = bcrypt.hashSync(yourPasswordFromSignupForm ...
Read more >
Compute bcrypt hash from command line - Unix StackExchange
Some, like py-bcrypt have even additional checks to ensure that null-character isn't a part of password. You can check the Apache implementation ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found