#include #include "config.h"#include #include #in..._esp8266 加密解密">
当前位置:   article > 正文

ESP8266&&32 AES加密、解密 (ECB方式)_esp8266 加密解密

esp8266 加密解密
#include <stdio.h>
#include "esp_system.h"
#include "mbedtls/aes.h"
#include <stddef.h>
#include <stdint.h>
#include "config.h"
#include <string.h>
#include <stdio.h>
#include "esp_system.h"

void app_main(void)
{
int ret = 0, i, j, u, mode;
unsigned int keybits;
unsigned char key[16]="123456789012345";
unsigned char inbuf[16]="123456789012345";
unsigned char outbuf[16]={0};
unsigned char buf[16]={0};
const unsigned char *aes_tests;
mbedtls_aes_context ctx;
//memset(key,0,16);

mbedtls_aes_init(&ctx);
for(int loop=0;loop<16;loop++)
     printf("%c",key[loop]);
keybits=128;
mode=1;
printf( "  AES-ECB-%3d (%s):\r\n ", keybits,
                            ( mode == MBEDTLS_AES_DECRYPT ) ? "dec" : "enc" );
//memset( buf, 0, 16 );


//ret = mbedtls_aes_setkey_dec( &ctx, key, keybits
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/176501
推荐阅读
相关标签