Remove hashlib.pbkdf2_hmac as it's inconsistent (deez)

This commit is contained in:
Fierelier 2023-12-28 05:53:20 +01:00
parent b74431c63e
commit 5d01946d8f
2 changed files with 6 additions and 6 deletions

View File

@ -22,12 +22,12 @@ try:
from Cryptodome.Cipher import AES
except:
from Crypto.Cipher import AES
import hashlib
bufferSize = int(os.environ["fstream_aesbuffer"])
unbufferedStdout = os.fdopen(sys.stdout.fileno(),"wb",0) # Make unbuffered stdout
salt = b'\x85a`8\xa1n \xb6\x9aRU/\x0e\xdc*\xa3'
pw = hashlib.pbkdf2_hmac("sha256",os.environ["fstream_aespass"].encode("utf-8"), salt, 100000, 32)
pw = os.environ["fstream_aespass"].encode("utf-8")
while len(pw) < 32: pw = pw + pw
pw = pw[:32]
while True:
iv = sys.stdin.buffer.read(AES.block_size)

View File

@ -22,12 +22,12 @@ try:
from Cryptodome.Cipher import AES
except:
from Crypto.Cipher import AES
import hashlib
bufferSize = int(os.environ["fstream_aesbuffer"])
unbufferedStdout = os.fdopen(sys.stdout.fileno(),"wb",0) # Make unbuffered stdout
salt = b'\x85a`8\xa1n \xb6\x9aRU/\x0e\xdc*\xa3'
pw = hashlib.pbkdf2_hmac("sha256",os.environ["fstream_aespass"].encode("utf-8"), salt, 100000, 32)
pw = os.environ["fstream_aespass"].encode("utf-8")
while len(pw) < 32: pw = pw + pw
pw = pw[:32]
while True:
data = sys.stdin.buffer.read(bufferSize)