Page 1
(STC) over NFC between an STM32 microcontroller and an Android™ smartphone. The ST25DV-I2C is a dynamic NFC tag IC able to communicate with NFC readers and smartphones, and also with a microcontroller through an I2C interface. The FTM feature allows to speed up the communication between these two interfaces.
Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere. Purpose and scope The "ST25DV-I2C Crypto Demo" runs on the ST25DV-I2C-DISCO kit, featuring a ST25DV-I2C tag connected to a STM32L476 device through the I2C bus. The ST25DV-I2C-DISCO kit represents an IOT sensor device, which is controlled by an Android™...
An Android smartphone with at least the version 6.0 (Android Marshmallow) Installation This demonstration requires to download the firmware (STSW-ST25DV003 on www.st.com) for the ST25DV-I2C- DISCO board and the Android executable (APK, STSW-ST25003 on www.st.com) to use on the Android phone. 1.4.1 ST25DV-I2C-DISCO kit setup The "ST25DV-I2C Crypto Demo"...
"Public key") and only accepts the forecoming connections with same smartphone credentials. Note: As these data are saved in the flash memory of the STM32, the ST25DV-I2C-DISCO firmware restore them after a reset. Once an "Authorized User" is set, the login (the name of the smartphone) is displayed, and the “key exchange”...
Disclaimer Figure 4. ST25DV-I2C-DISCO screen - denied access It is possible to set a new "Authorized User" by pushing the user button (blue) of the ST25DV-I2C-DISCO motherboard (any previously stored "Authorized User" is erased by the firmware). Disclaimer The Android application and the associated firmware are provided under the SLA0052 license agreement, available on www.st.com...
The ST25DV-I2C-DISCO board sends its ECC "Public key". If the ST25DV-I2C-DISCO kit has never been used before, it saves the "Login" and the "Public key" in static memory and consider this user to be the administrator "Authorized User" of the product. It means that the ST25DV-I2C-DISCO kit only accepts requests from this smartphone user.
DISCO during the keys exchange phase when the product has been used for the very first time. The ST25DV- I2C-DISCO board has saved this "Login name" and the corresponding "Public key" in its static memory. The ST25DV-I2C-DISCO sends a challenge to the Android phone to check if it really knows the "Private key" corresponding to this "Public key": The ST25DV-I2C-DISCO generates a random number, encrypts it with the AES session key and sends it to the Android phone.
UM2575 Encrypted data transfer The ST25DV-I2C-DISCO decrypts it and sends a SHA256 hash to prove that the decryption is correct. Figure 7. ST25DV-I2C-DISCO authentication over NFC Decrypt Encrypt Android phone ST25DV-I2C-DISCO This authentication protects from counterfeited products: a counterfeited product can contain a valid "Public key"...
Android and ST25DV-I2C-DISCO screens Android and ST25DV-I2C-DISCO screens Home screen Manually launch the application “ST25DV-I2C-Crypto Demo” or simply tap the ST25DV-I2C NFC tag, Android automatically launches the “ST25DV-I2C-Crypto Demo” application, if it is installed. Figure 8. "ST25DV-I2C Crypto Demo" - home screen When the application starts, it initializes the Android KeyStore and some cryptography elements.
Figure 9. "ST25DV-I2C-Crypto Demo" - secure transfer channel setup On the ST25DV-I2C-DISCO board, similar information is displayed to show what is the current security status, and which user is logged. Figure 10. ST25DV-I2C-DISCO screen when no user has been registered...
Once the STC is ready, click on “read and decrypt data” button to download some data from the ST25DV-I2C- DISCO. This data (an array of points) is generated by the firmware running on the ST25DV-I2C-DISCO board (it is not a real measurement) and is stored in the STM32L476 memory. This demonstration emulates the behaviour of a sensor regularly recording, for instance, the temperature and transferring this data to a smartphone through NFC.
The same graph is displayed on the ST25DV-I2C-DISCO board. Note: The shape of the curve can be changed, simply by touching the plot on the ST25DV-I2C-DISCO screen. The user then restarts the transfer to receive the new set of points.
UM2575 "ST25DV-I2C Crypto Demo" application screen Figure 14. "ST25DV-I2C Crypto Demo" - picture transfer Note: A progress bar is displayed during the download. On the Android phone, two progress bars are visible, a blue one and a light blue one.
Section 1.4.2 Android APK installation. After selecting the file, the new firmware is uploaded, encrypted to the ST25DV-I2C-DISCO board, by writing chunks to the ST25DV-I2C FTM buffer mailbox. The ST25DV-I2C-DISCO firmware checks the authenticity of the firmware chunks (thanks to the GMAC) and flashes them in the STM32L476 static memory.
Eavesdropper screen This screen has been added to show what someone sees when spying the NFC connection. It allows to see the encrypted data that are exchanged through NFC and what the ST25DV-I2C-DISCO gets after decryption. Figure 17. "ST25DV-I2C Crypto Demo" - eavesdropper The message sent is displayed as well on the screen of the ST25DV-I2C-DISCO board.
Keys overview Various cryptographic keys are used in the "ST25DV-I2C Crypto Demo". This screen has been added to help the user to understand the role of each of them. In the Android applications, click on a key to get information about it.
"ST25DV-I2C-Crypto Demo" - settings Role of each setting field: • Login: When setting up a connection with a ST25DV-I2C-DISCO board, the Android model name is used as "Login". This "Login" can be changed here. Note: A hacker may want to change the login name to usurp the identity of the authorized user. It is impossible because the ST25DV-I2C-DISCO board saves the "Login"...
UM2575 License screen • Use Addressed NFC command: Communication between the Android phone and the ST25DV-I2C-DISCO board is done through NFC Type 5. Two modes are available for NFC Type5 commands: – Addressed – Non-addressed When using addressed commands, the NFC Tag UID (on 8 bytes) is included in the command. This is safer because only the targeted tag processes the command but the communication is slower due to those extra bytes to send for every packet exchanged.
Page 23
ST’s terms and conditions of sale in place at the time of order acknowledgement. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers’...
Need help?
Do you have a question about the ST25DV-I2C and is the answer not in the manual?
Questions and answers