From 730879731494b476f76b725fec930f4656d82e9f Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Fri, 27 Sep 2024 16:15:14 +1000 Subject: [PATCH] removing cryptography --- Dockerfile.debian | 2 +- install/install_dependencies.debian.sh | 2 +- server/crypto_utils.py | 36 -------------------------- 3 files changed, 2 insertions(+), 38 deletions(-) diff --git a/Dockerfile.debian b/Dockerfile.debian index 25ff50c6..128c26d7 100755 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -43,7 +43,7 @@ RUN phpenmod -v 8.2 sqlite3 RUN apt-get install -y python3-venv RUN python3 -m venv myenv -RUN /bin/bash -c "source myenv/bin/activate && update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && pip3 install tplink-omada-client pycryptodome requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet python-nmap dnspython cryptography librouteros " +RUN /bin/bash -c "source myenv/bin/activate && update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && pip3 install tplink-omada-client pycryptodome requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet python-nmap dnspython librouteros " # Create a buildtimestamp.txt to later check if a new version was released RUN date +%s > ${INSTALL_DIR}/front/buildtimestamp.txt diff --git a/install/install_dependencies.debian.sh b/install/install_dependencies.debian.sh index e5d43293..664e9ee5 100755 --- a/install/install_dependencies.debian.sh +++ b/install/install_dependencies.debian.sh @@ -30,5 +30,5 @@ source myenv/bin/activate update-alternatives --install /usr/bin/python python /usr/bin/python3 10 # install packages thru pip3 -pip3 install netifaces tplink-omada-client pycryptodome requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet python-nmap dnspython librouteros cryptography +pip3 install netifaces tplink-omada-client pycryptodome requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet python-nmap dnspython librouteros diff --git a/server/crypto_utils.py b/server/crypto_utils.py index 5a6bfd48..c50431ea 100755 --- a/server/crypto_utils.py +++ b/server/crypto_utils.py @@ -1,45 +1,9 @@ -# from cryptography.fernet import Fernet from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad import base64 import hashlib -# FERET - Requires C compiler------------------------------------------------------------------------- - -# def prepare_key(encryption_key): -# if(len(encryption_key) < 32): -# encryption_key = (int((32 / len(encryption_key)))+1 )*encryption_key - -# key_bytearray = bytearray(encryption_key[:32], 'ASCII') - -# return base64.urlsafe_b64encode(key_bytearray) - - -# def encrypt_data(data, encryption_key): - -# fernet = Fernet(prepare_key(encryption_key)) - -# # then use the Fernet class instance -# # to encrypt the string string must -# # be encoded to byte string before encryption -# encrypted_data = fernet.encrypt(data.encode()) -# return encrypted_data - -# def decrypt_data(data, encryption_key): - - -# fernet = Fernet(prepare_key(encryption_key)) - -# # decrypt the encrypted string with the -# # Fernet instance of the key, -# # that was used for encrypting the string -# # encoded byte string is returned by decrypt method, -# # so decode it to string with decode methods -# decrypted_data = fernet.decrypt(data).decode() -# return decrypted_data - - # SIMPLE CRYPT - requeres C compiler ------------------------------------------------------------------------- # def prepare_key(encryption_key):