Module: Bosh::Director::PasswordHelper

Included in:
VmCreator
Defined in:
lib/bosh/director/password_helper.rb

Constant Summary collapse

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

16
PASSWORD_LENGTH =
30

Instance Method Summary collapse

Instance Method Details

#sha512_hashed_passwordObject



12
13
14
15
16
# 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