Switch to 128 bit security level

This commit is contained in:
Juhani Krekelä 2020-01-05 13:12:10 +02:00
parent 4bc207967d
commit 1b7dbe2a4f
1 changed files with 3 additions and 3 deletions

View File

@ -110,8 +110,8 @@ def auth_hash(client_pubkey, server_pubkey):
server_pubkey_hash = sha512(enc_len(len(server_pubkey)) + server_pubkey)
combined_hash = sha512(client_pubkey_hash + server_pubkey_hash)
truncated_hash = combined_hash[:32]
hash_check = sha512(truncated_hash)[:5]
truncated_hash = combined_hash[:16]
hash_check = sha512(truncated_hash)[:4]
return truncated_hash + hash_check
def chunk(sliceable, length):
@ -120,7 +120,7 @@ def chunk(sliceable, length):
def format_hash(hash_bytes):
hash_base32 = base64.b32encode(hash_bytes).decode().lower().replace('=', '')
chunked_base32 = chunk(hash_base32, 5)
chunked_base32 = chunk(hash_base32, 4)
return '-'.join(chunked_base32)
def verify(client_pubkey, server_pubkey):