findmy.util.crypto ================== .. py:module:: findmy.util.crypto .. autoapi-nested-parse:: Pure-python NIST P-224 Elliptic Curve cryptography. Used for some Apple algorithms. Attributes ---------- .. autoapisummary:: findmy.util.crypto.P224_N Functions --------- .. autoapisummary:: findmy.util.crypto.encrypt_password findmy.util.crypto.decrypt_spd_aes_cbc findmy.util.crypto.x963_kdf findmy.util.crypto.bytes_to_int findmy.util.crypto.derive_ps_key Module Contents --------------- .. py:data:: P224_N :value: 26959946667150639794667015087019625940457807714424391721682722368061 .. py:function:: encrypt_password(password: str, salt: bytes, iterations: int, protocol: str) -> bytes Encrypt password using PBKDF2-HMAC. .. py:function:: decrypt_spd_aes_cbc(session_key: bytes, data: bytes) -> bytes Decrypt SPD data using SRP session key. .. py:function:: x963_kdf(value: bytes, si: bytes, length: int) -> bytes Single pass of X9.63 KDF with SHA1. .. py:function:: bytes_to_int(value: bytes) -> int Convert bytes in big-endian format to int. .. py:function:: derive_ps_key(privkey: bytes, sk: bytes) -> bytes Derive a primary or secondary key used by an accessory. :param privkey: Private key generated during pairing :param sk: Current secret key for this time period. Use SKN to derive the primary key, SKS for secondary.