diff --git a/paramecio/citoplasma/keyutils.py b/paramecio/citoplasma/keyutils.py new file mode 100644 index 0000000..2ffe7bf --- /dev/null +++ b/paramecio/citoplasma/keyutils.py @@ -0,0 +1,6 @@ +from hashlib import sha512 +from os import urandom + +def create_key_encrypt(n=10): + + return sha512(urandom(n)).hexdigest() diff --git a/paramecio/modules/admin/index.py b/paramecio/modules/admin/index.py index 8f36bb1..518d6ca 100644 --- a/paramecio/modules/admin/index.py +++ b/paramecio/modules/admin/index.py @@ -17,16 +17,12 @@ from importlib import import_module, reload from bottle import redirect from collections import OrderedDict from time import time -from hashlib import sha512 -from os import urandom, path +from paramecio.citoplasma.keyutils import create_key_encrypt +from os import path #from citoplasma.login import LoginClass # Check login -def create_key_encrypt(): - - return sha512(urandom(10)).hexdigest() - key_encrypt=create_key_encrypt() module_admin=path.dirname(__file__)