This example shows the Elliptic Curve Diffie Hellman key exchange with ephemeral key created on ATECC608A.
- Debian 10 host
- Raspberry Pi device
- e.g. Zero
- Raspberry Pi OS
- Attached ATECC608A I2C module
- Personalized, locked and ready to use
apt update
apt install -y python3 python3-venv build-essentials
python3 -m venv
source venv/bin/activate
pip3 install wheel
pip3 install -r requirements.txt
- On device: Generate ephemeral key on ATECC608a via
python3 genkey_device.py
- Exchange
ec256-device.pub
with host - On host: Generate ephemeral key using python
python3 genkey_host.py
- Exchange
ec256-host.pub
with host - On device: Derive
ec256-device.key
viapython3 ecdh_device.py
- On host: Derive
ec256-host.key
viapython3 ecdh_host.py
- On host: Calculate
md5 ec256-host.key
- On device: Calculate
md5 ec256-device.key
- Compare md5 hashes and see that they match