Created
September 27, 2021 18:56
-
-
Save acdimalev/719d4bf7bca58f4343aef8dd629f9c14 to your computer and use it in GitHub Desktop.
randopass
This file contains 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
#!/usr/bin/env python3 | |
import crypt, random, sys | |
(_, nick) = sys.argv | |
password = '{:016x}'.format(random.randrange(256 ** 8)) | |
crypted = crypt.crypt(password) | |
passwd_entry = ':'.join([nick, crypted]) | |
sys.stderr.write(password + '\n') | |
sys.stdout.write(passwd_entry + '\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment