This repository contains example implementations of common cryptographic algorithms using MbedTLS (software-based) and OPTIGA Trust (hardware-based) security solutions.
The purpose is to demonstrate how to perform encryption, decryption, key exchange, and digital signatures using both software libraries and secure hardware modules.
aes_cbc.c
AES-CBC encryption/decryption using MbedTLS.aes_cbc_optiga.c
AES-CBC encryption/decryption using OPTIGA Trust hardware.aes_ecb.c
AES-ECB encryption/decryption using MbedTLS.aes_ecb_optiga.c
AES-ECB encryption/decryption using OPTIGA Trust hardware.
ecdh_mbedtls.c
ECDH key exchange using MbedTLS.ecdh_optiga.c
ECDH key exchange using OPTIGA Trust hardware.
ecdsa_mbedtls.c
ECDSA signing and verification using MbedTLS.ecdsa_optiga.c
ECDSA signing and verification using OPTIGA Trust hardware.
| Algorithm | Mode | MbedTLS (Software) | OPTIGA (Hardware) |
|---|---|---|---|
| AES | CBC | Yes (aes_cbc.c) |
Yes (aes_cbc_optiga.c) |
| AES | ECB | Yes (aes_ecb.c) |
Yes (aes_ecb_optiga.c) |
| ECDH | — | Yes (ecdh_mbedtls.c) |
Yes (ecdh_optiga.c) |
| ECDSA | — | Yes (ecdsa_mbedtls.c) |
Yes (ecdsa_optiga.c) |
-
Hardware
- Infineon OPTIGA Trust M / Trust X module (for OPTIGA examples)
- Compatible microcontroller board (e.g., PSoC 6)
-
Software
- MbedTLS library
- OPTIGA Trust host library
- C compiler and build environment (GCC, ARM GCC, etc.)
- Board SDK (e.g., ModusToolbox for PSoC)
-
Clone this repository:
git clone https://github.com/Deeksha-R-Kunder/Infineon.git cd Infineon-IoT -
Open the project in your IDE (e.g., ModusToolbox or Eclipse).
-
Select the .c file you want to test (e.g., ecdh_optiga.c).
-
Compile and flash to your board.
-
Open a serial terminal and observe the output.
MbedTLS Documentation: https://mbed-tls.readthedocs.io/projects/api/en/v3.5.2/
Infineon OPTIGA Trust: https://infineon.github.io/optiga-trust-m/
These examples are for educational purposes only. For production systems, always follow security best practices, use secure key storage, and validate library versions.