Last updated 17 days ago
Low Caps Hub uses exactly the same encryption algorithm as Bitcoin - unbreakable SHA-256. That's why, we strongly recommend to protect your private keys via it.
Function, which is using to encryption with SHA-256:
def encrypt_data(data, passphrase): salt = os.urandom(16) kdf = PBKDF2HMAC( algorithm=hashes.SHA256(), length=32, salt=salt, iterations=100000, backend=default_backend() ) key = kdf.derive(passphrase.encode()) nonce = os.urandom(12) cipher = Cipher(algorithms.AES(key), modes.GCM(nonce), backend=default_backend()) encryptor = cipher.encryptor() ciphertext = encryptor.update(data) + encryptor.finalize() return salt + nonce + encryptor.tag + ciphertext