Created
May 14, 2016 13:25
-
-
Save bsnyder74/02d3182e42313bc7304ce23512935b1a to your computer and use it in GitHub Desktop.
Generate SHA512 encrypted password in ruby suitable for shadow password.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest/sha2' | |
password = "pass@123" | |
salt = rand(36**8).to_s(36) | |
shadow_hash = password.crypt("$6$" + salt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍 Thanks!