2025-03-27 11:40 PM
Hi everyone,
I am working on an STM32F412RB-based project where I need to secure data stored on an SD card while maintaining fast accessibility. However, I have very limited flash memory available (only 40 KB free), so I need a lightweight encryption method that does not consume too many resources.
MCU: STM32F412RB
SD Card Interface: SDIO
File System: FATFS
Encryption: None implemented yet
Remaining Flash Memory: 40 KB
What are some efficient lightweight encryption methods for securing SD card data on STM32 with minimal resource usage?
Does the STM32F412RB have any hardware-accelerated encryption support that I can utilize?
Would a simple XOR-based encryption be sufficient for basic security, or is there a better lightweight alternative?
Are there any recommended STM32 libraries for secure but fast data storage on SD cards?
I would appreciate any insights or experiences regarding this. Thank you!
2025-04-28 6:06 AM
Hello @Sujith
Do you mean STM32F412RG or STM32F412RE ? there is no STM32F412RB part number in the STM32F412 series.
Would a simple XOR-based encryption be sufficient for basic security ..... ? no refer to question 1.
"Are there any recommended STM32 libraries for secure but fast data storage on SD cards?" The STM32 X-Cube-CryptoLIB is secure as explained above.
Note: the question seems be generated using GenAI !! Do not ask questions looking like autogenerated otherwise they will be filtered by the system.
Best regards
2025-04-28 6:30 AM - edited 2025-04-28 6:38 AM
@Sujith wrote:3. Would a simple XOR-based encryption be sufficient for basic security, or is there a better lightweight alternative?
That depends entirely on what you define as "basic security".
@Sujith wrote:4. Are there any recommended STM32 libraries for secure but fast data storage on SD cards?
As @CMYL said, the STM32F412RG or STM32F412RE has no HW crypto accelerator - so you would just be using standard, general software - not specific to STM32.
Also not specific to SD-Cards.
@Sujith wrote:5. Is there any available code or a GitHub link that I can refer to?
GitHub has a search facility; eg, https://github.com/search?q=lightweight%20encryption&type=repositories
2025-04-28 6:48 AM
@Andrew Neil wrote:That depends entirely on what you define as "basic security".
The US National Institute of Standards and Technology (NIST) offers some definitions here; eg,
"Security commensurate with the risk and the magnitude of harm resulting from the loss, misuse, or unauthorized access to or modification of information"
See also:
and more: https://www.google.com/search?q=how+secure+is+%22secure+enough%22