Switch to 128 bit security level
This commit is contained in:
parent
4bc207967d
commit
1b7dbe2a4f
|
@ -110,8 +110,8 @@ def auth_hash(client_pubkey, server_pubkey):
|
||||||
server_pubkey_hash = sha512(enc_len(len(server_pubkey)) + server_pubkey)
|
server_pubkey_hash = sha512(enc_len(len(server_pubkey)) + server_pubkey)
|
||||||
combined_hash = sha512(client_pubkey_hash + server_pubkey_hash)
|
combined_hash = sha512(client_pubkey_hash + server_pubkey_hash)
|
||||||
|
|
||||||
truncated_hash = combined_hash[:32]
|
truncated_hash = combined_hash[:16]
|
||||||
hash_check = sha512(truncated_hash)[:5]
|
hash_check = sha512(truncated_hash)[:4]
|
||||||
return truncated_hash + hash_check
|
return truncated_hash + hash_check
|
||||||
|
|
||||||
def chunk(sliceable, length):
|
def chunk(sliceable, length):
|
||||||
|
@ -120,7 +120,7 @@ def chunk(sliceable, length):
|
||||||
|
|
||||||
def format_hash(hash_bytes):
|
def format_hash(hash_bytes):
|
||||||
hash_base32 = base64.b32encode(hash_bytes).decode().lower().replace('=', '')
|
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)
|
return '-'.join(chunked_base32)
|
||||||
|
|
||||||
def verify(client_pubkey, server_pubkey):
|
def verify(client_pubkey, server_pubkey):
|
||||||
|
|
Loading…
Reference in New Issue