Last active
January 31, 2021 13:17
-
-
Save neil-sabol/2b40ee8d178a9ee8b97fe6345c549ffc to your computer and use it in GitHub Desktop.
See https://blog.neilsabol.site/post/yubikey-personalization-tool-yubico-powershell-command-cli-program-random-static-password-commandline/#closing-thoughts. This snippet uses the ykpersonalize (YubiKey Personalization Tool) command to generate a new static password on the Yubikey.
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
# Create an alias for ykpersonalize pointing the the location it is downloaded to | |
set-alias ykpersonalize "$env:localappdata\Programs\Yubico\bin\ykpersonalize.exe" | |
# Generate a random hex (AES key) to serve as entropy (randomness source) for ykpersonalize | |
$RandomHex = (((32)|%{((1..$_)|%{('{0:X}' -f (random(16)))})}) -Join "").ToLower() | |
# Run ykpersonalize to generate a random static password in Yubikey's config slot 2 | |
ykpersonalize -2 -a"$RandomHex" -ostatic-ticket -oshort-ticket -ostrong-pw1 -ostrong-pw2 -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment