Compare commits

...

2 Commits

Author SHA1 Message Date
21be68feb5 Merge pull request 'Add CLI script for hashing LDAP passwords' (#239) from chore/ldap_hash_password_script into master
Reviewed-on: #239
2020-11-20 13:39:40 +00:00
b63c86b37f
Add CLI script for hashing LDAP passwords
Only takes a cleartext password and outputs a salted, hashed password
string for LDAP documents.
2020-11-20 14:36:25 +01:00

5
scripts/ldap/hash_pw.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
password=$(ruby -r base64 -r digest -r securerandom -e "salt = SecureRandom.hex(32); password = '$1'; puts '{SSHA512}' + Base64.strict_encode64(Digest::SHA512.digest(password + salt) + salt)");
echo $password;