Guest User

Untitled

a guest
Aug 28th, 2014
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.33 KB | None | 0 0
  1. require 'digest'
  2. require 'benchmark'
  3.  
  4. sha256 = Digest::SHA256.new
  5. salt = "Super Random Salt!!!"
  6. message = "This is my password!"
  7.  
  8. [1, 50, 500, 5000, 5000, 50000].each {|rounds|
  9.     puts "Running #{rounds} times:"
  10.     puts Benchmark.measure {
  11.       rounds.times do
  12.         message = sha256.digest(message+salt)
  13.       end
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment