Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bsnyder74/02d3182e42313bc7304ce23512935b1a to your computer and use it in GitHub Desktop.
Save bsnyder74/02d3182e42313bc7304ce23512935b1a to your computer and use it in GitHub Desktop.
Generate SHA512 encrypted password in ruby suitable for shadow password.
require 'digest/sha2'
password = "pass@123"
salt = rand(36**8).to_s(36)
shadow_hash = password.crypt("$6$" + salt)
@dylan-tock
Copy link

👍 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment