Saturday, December 20, 2014

sha512 password creation (ruby)

#!/usr/bin/env ruby
def check
  if ARGV[0] == nil
    abort 'please input argv[0]'
  end
end

check

require 'digest/sha2'
sha2p=Digest::SHA512.hexdigest(ARGV[0])
p sha2p

# Testing 
oyjmint freeradius # ruby sha512.rb "test"
"ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"
oyjmint freeradius #

No comments:

Post a Comment