Skip to content

Commit 77832cd

Browse files
committed
hardened Argon2id parameters
1 parent bc1bdba commit 77832cd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

zhesp2/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
}
1818

1919
# Argon2id default parameters
20-
ARGON2_TIME_COST = 3
21-
ARGON2_MEMORY_COST = 65536
22-
ARGON2_PARALLELISM = 2
20+
ARGON2_TIME_COST = 5
21+
ARGON2_MEMORY_COST = 131072
22+
ARGON2_PARALLELISM = 4
2323
ARGON2_HASH_LENGTH = 32
2424

2525
# File path for integrity flag

zhesp2/crypto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def generate_key(length: int = 32, print_key: bool = True) -> str:
2929
raw = secrets.token_bytes(length)
3030
b64 = base64.urlsafe_b64encode(raw).decode()
3131
if print_key:
32-
print(f"[+] Generated Key ({length * 8} bits):\\nBase64: {b64}\\nHex: {raw.hex()}\\n")
32+
print(f"[+] Generated Key ({length * 8} bits):\nBase64: {b64}\nHex: {raw.hex()}\n")
3333
return b64
3434

3535
def derive_key(password: str, salt: bytes, length: int = ARGON2_HASH_LENGTH,

0 commit comments

Comments
 (0)