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

Function encrypt_security_data

keepercommander/security_audit.py:27–37  ·  view source on GitHub ↗
(params, data)

Source from the content-addressed store, hash-verified

25 else utils.password_score(password) or has_passkey(record) and 100 or 0
26
27def encrypt_security_data(params, data):
28 if params.forbid_rsa and not params.enterprise_ec_key:
29 raise Exception('Enterprise ECC public key is not available')
30
31 if not params.forbid_rsa and not params.enterprise_rsa_key:
32 raise Exception('Enterprise RSA public key is not available')
33
34 data = json.dumps(data).encode('utf8')
35 pubkey = params.enterprise_ec_key if params.forbid_rsa else params.enterprise_rsa_key
36 encrypt_fn = crypto.encrypt_ec if params.forbid_rsa else crypto.encrypt_rsa
37 return encrypt_fn(data, pubkey)
38
39def prep_security_data(params, record):
40 get_bw_obj = lambda rec: next(

Callers 1

prep_security_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected