From 9a117817f7f55d56590035c18aa7cccd507a2bec Mon Sep 17 00:00:00 2001 From: ItHertzSoGood <60296901+ItHertzSoGood@users.noreply.github.com> Date: Fri, 4 Sep 2020 14:32:53 -0700 Subject: [PATCH] Changed random to secrets for cryptographic security --- keyctl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyctl.py b/keyctl.py index 202941e..10538a0 100644 --- a/keyctl.py +++ b/keyctl.py @@ -8,12 +8,12 @@ Command-line utility for easy management of the uploadkeys file. from pathlib import Path import argparse import logging -import random +import secrets import string 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