MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / decrypt_ec

Function decrypt_ec

keepercommander/crypto.py:149–155  ·  view source on GitHub ↗
(data, ec_private_key)

Source from the content-addressed store, hash-verified

147
148
149def decrypt_ec(data, ec_private_key):
150 ephemeral_public_key = load_ec_public_key(data[:65])
151 shared_secret = ec_private_key.exchange(ec.ECDH(), ephemeral_public_key)
152 digest = Hash(SHA256(), backend=_CRYPTO_BACKEND)
153 digest.update(shared_secret)
154 encryption_key = digest.finalize()
155 return decrypt_aes_v2(data[65:], encryption_key)
156
157
158def derive_key_v1(password, salt, iterations):

Callers

nothing calls this directly

Calls 4

load_ec_public_keyFunction · 0.85
decrypt_aes_v2Function · 0.85
exchangeMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected