module Bosh::Director::PasswordHelper

Constants

PASSWORD_LENGTH
SALT_MAX_LENGTH_IN_BYTES

SHA512 tolerates salt lengths from 8 to 16 bytes we found this by using the mkpasswd (from the whois package) on ubuntu linux

Public Instance Methods

sha512_hashed_password() click to toggle source
# File lib/bosh/director/password_helper.rb, line 12
def sha512_hashed_password
  salt = SecureRandom.hex(SALT_MAX_LENGTH_IN_BYTES / 2)
  password = SecureRandom.hex(PASSWORD_LENGTH)
  UnixCrypt::SHA512.build(password, salt)
end