2018-06-05 10:43 PM
Hi am a beginner in the stm32f417 micro controller programming.Can anybody help me regarding how to implement cryptography in stm32f417vg micro controller.
2018-06-06 04:46 AM
ST has a Crypto library available.
http://www.st.com/en/embedded-software/stm32-cryp-lib.html
http://www.st.com/en/embedded-software/x-cube-cryptolib.html
Both the SPL and HAL software trees have example code
STM32F4xx_DSP_StdPeriph_Lib_V1.8.0\Project\STM32F4xx_StdPeriph_Examples\CRYP\CRYP_AES_CCM
STM32Cube_FW_F4_V1.21.0\Projects\STM324xG_EVAL\Examples\CRYP\CRYP_AES_DMA
2018-06-06 09:07 AM
thank you...
2018-06-07 04:21 AM
2018-06-12 03:07 AM
Hi all..
In stm32f4XX, whether CRYP periferal have any dependencies on RTOS
2018-06-12 08:44 AM
Well you'd need to serialize access to the hardware, I'd assume.
2018-06-13 02:42 AM
#include 'main.h'
#include 'stm32f4xx_hal.h'CRYP_HandleTypeDef hcryp;
void SystemClock_Config(void);
static void MX_GPIO_Init(void);static void MX_CRYP_Init(void);int main(void)
{ uint8_t Plain_Data[1] = {10}; uint8_t AEC_ECB_Encrypted_Data[1] = {0}; uint8_t AEC_ECB_Decrypted_Data[1] = {0};HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_CRYP_Init();
while (1) { // encrypt the data if(HAL_CRYP_AESECB_Encrypt(&hcryp,Plain_Data,sizeof(Plain_Data),AEC_ECB_Encrypted_Data,1000) != HAL_OK) HAL_NVIC_SystemReset(); // decrypt the encrypted data5 if(HAL_CRYP_AESECB_Decrypt(&hcryp,AEC_ECB_Encrypted_Data,sizeof(AEC_ECB_Encrypted_Data),AEC_ECB_Decrypted_Data,10) != HAL_OK) HAL_NVIC_SystemReset(); }}
am using the above code to encrypt and decrypt the data but when i do decryption of encrypted data am not getting original data.
2018-06-13 08:32 AM
I don't think working with one byte buffers is how this functions.
ST has AES examples, work with those.
2018-06-14 01:51 AM
yes,I tried with the example given by the ST but the encrypted data is not matching with expected result.