Skip to content

Instantly share code, notes, and snippets.

@crypticgeek
Last active January 14, 2016 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crypticgeek/031302d973909e0d4867 to your computer and use it in GitHub Desktop.
Save crypticgeek/031302d973909e0d4867 to your computer and use it in GitHub Desktop.
Some ruby code demoing how NetIQ SSPR (v3.2 tested) hashing works
require 'digest/sha1'
plain = 'password'
salt = 'MBS9ZgZ5r7IGU8O1hfVyajXZkaoSZPbu'
answer = 'FxHUyOPwsrulLoacXlrkHN2qJ3M='
i = 100000
sha1 = Digest::SHA1.new
sha1.update(salt+plain)
(i-1).times do
temp = sha1.digest
sha1.reset
sha1.update(temp)
end
puts "stored value = #{answer}"
puts "calulated value = #{sha1.base64digest}"
puts "it works!" if sha1.base64digest === answer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment