Changed random to secrets for cryptographic security
This commit is contained in:
parent
c9cd6469a9
commit
9a117817f7
@ -8,12 +8,12 @@ Command-line utility for easy management of the uploadkeys file.
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
import random
|
import secrets
|
||||||
import string
|
import string
|
||||||
|
|
||||||
|
|
||||||
def genkey(length):
|
def genkey(length):
|
||||||
key = ''.join(random.choice(string.ascii_letters + string.digits) for x in range(length))
|
key = ''.join(secrets.choice(string.ascii_letters + string.digits) for x in range(length))
|
||||||
return key
|
return key
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user