Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHA-512 encryption #611

Open
DeolTito opened this issue Feb 15, 2022 · 1 comment
Open

SHA-512 encryption #611

DeolTito opened this issue Feb 15, 2022 · 1 comment

Comments

@DeolTito
Copy link

Hello,

We have tried encrypting a password for a user with SHA-512 encryption in LDAP and the format of the password is as mentioned below.

{SHA512}r2K5zao5z45eey49xafOOd8DxFGbGgnqsUAxsoeaLjdWm6RUKAGLXvs3x+BUKVXvHP47odin9AhSkiZLRZZbOw==

We've also generated a password with SHA-512 encryption on a control panel (cPanel) and the password format is as mentioned below.

$6$oa7whGtyZ61Hc0TN$4rfjAyMTdVLzkw9euTZmRSkIaSlqu9MuvaD3wSnGjV7JOaBpMLr6dsLnURrMp5n8fS3vapCn7RMBE9t8lb5IZ/:19032::::::

As you see, both uses the same encryption but the password format is quite different.

Is it possible to encrypt the password in LDAP using the format used by cPanel?

@4xoc
Copy link

4xoc commented Feb 16, 2022

LDAP has a very specific password format where the {} part defines what type of password this is (for example {SASL}someUsername, no password is saved at all but delegated to SASL). The Part after the {} is just the base64 encoded hash in case of sha/sha2 to represent binary data in ASCII chars. Those hashes can be represented in many ways, OpenLDAP uses the described format and that cannot be changed. BTW, sha2 support needs to have an additional module pw-sha2 loaded in slapd for sha256 and larger (same goes for >=ssha256).
Check out ldappasswd which allows you to generate new passwords in ldap format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants