Skip to content

Instantly share code, notes, and snippets.

@julienXX
Created August 6, 2009 13:39
Show Gist options
  • Save julienXX/163316 to your computer and use it in GitHub Desktop.
Save julienXX/163316 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Ruby script to generate SSHA (Good for LDAP)
require 'sha1'
require 'base64'
hash = "{SSHA}"+Base64.encode64(Digest::SHA1.digest(ARGV[0]+'salt')+'salt').chomp!
puts 'userPassword: '+hash+"\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment