# Hardware Mobile Wallet

**URL:** <http://forum.zenon.org/t/hardware-mobile-wallet/1755>\
**Category:** ╰ Network\
**Created:** [January 11, 2024, 10:38pm UTC](http://forum.zenon.org/t/hardware-mobile-wallet/1755 "2024-01-11T22:38:18Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![DrBlaze\_21](http://forum.zenon.org/letter_avatar_proxy/v4/letter/d/ea5d25/32.png) [@DrBlaze\_21](http://forum.zenon.org/u/DrBlaze_21)\
**Post date:** [January 11, 2024, 10:38pm UTC](http://forum.zenon.org/t/hardware-mobile-wallet/1755/1 "2024-01-11T22:38:18Z")

</div>

# Best-in-class mobile security for the Syrius Mobile Wallet

## Hardware level security

Leveraging [Android Strongbox](https://developer.android.com/privacy-and-security/keystore#HardwareSecurityModule) and [Apple Secure Enclave](https://support.apple.com/guide/security/secure-enclave-sec59b0b31ff/web), I’ve started to design a system that is secure against a wide range of attacks.

The Strongbox and the Secure Enclave are hardware implementations physically separated from the main processor and are designed to withstand powerful adversaries that gain root control over the OS. They store private keys that never leave the chip (device) and can be used to perform certain cryptographic operations.

## Cryptography

Unfortunately, both the Strongbox and the Secure Enclave currently don’t support Zenon’s `Ed25519` signature scheme. They only have support for `ECDSA`, namely NIST P-256 over the `secp256r1` curve.

Fortunately, we can use Elliptic-curve Diffie–Hellman or `ECDH` to encrypt a secret using the public key and decrypt it using the corresponding private key.

Here are the operations that will provide hardware level security for the Zenon wallet:

- Generate 2 keypairs inside the Secure Enclave for the [shared secret](https://crypto.stackexchange.com/questions/21169/how-does-ecdh-arrive-on-a-shared-secret)
- Ask the user for a PIN/passphrase
- Use a Key Derivation Function (`KDF`) over the PIN/passphrase such as `Argon2` (already used in Zenon)
- Encrypt the user’s PIN/passphrase with the shared secret using `AES-256-GCM` (already used in Zenon)
- Generate a strong, random password for the Zenon `keystore`
- Encrypt the password using the user provided PIN/passphrase
- Encrypt the `keystore` using the strong password generated earlier
- Authenticate the secure enclave operations using biometric hardware (TouchID/FaceID)

The whole idea is to never expose the PIN/passphrase that is needed to decrypt the password, which in turn is needed to decrypt the `keystore` (wallet) in the device’s memory.

[Popular hardware wallets such as Ledger or Trezor use the same security chips](https://www.coolwallet.io/blog/hardware-wallet-secure-element-complete-guide/) found in flagship Android or iOS smartphones.

[Samsung S3FV9RR chip](https://semiconductor.samsung.com/news-events/news/samsung-elevates-data-protection-for-mobile-data-with-new-security-chip-solution/): CC EAL 6+  
[Apple Secure Enclave processor](https://support.apple.com/guide/certifications/secure-enclave-processor-security-apc3a7433eb89/web): N/A

---

_[View the full topic](http://forum.zenon.org/t/hardware-mobile-wallet/1755)._
