Skip to content

Instantly share code, notes, and snippets.

@mfischer-zd
Created August 31, 2012 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mfischer-zd/3547202 to your computer and use it in GitHub Desktop.
Save mfischer-zd/3547202 to your computer and use it in GitHub Desktop.
SSHA crypted password generator
#!/usr/bin/env ruby
# Ruby script to generate SSHA (Good for LDAP)
require 'sha1'
require 'base64'
hash = "{SSHA}"+Base64.encode64(Digest::SHA1.digest(ENV['PASS']+ENV['SALT'])+ENV['SALT']).chomp!
puts 'userPassword: '+hash+"\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment