?? aes_test.cpp
字號:
#include <stdio.h>
#include <string.h>
#include "aes.h"
int main(void)
{
char in[]="I have had my best love before, but I did not treasure her. When I lost her, I fell regretful. It is the most painful matter in this world. If God can give me another chance, I will say 3 words to her --- I love you. If you have to give a time limit to this love, I hope it is 10 thousand years";
char out[295];
unsigned char key[]="1234567890123456";
int len;
len=strlen(in);
aes_ctx ectx;
aes_enc_key(key, 16, &ectx);
aes_enc_blk((unsigned char *)in, (unsigned char *)out, &ectx);
for (int i=0; i<294; i++)
{
printf("%c",in[i]);
}
printf("\n");
for (i=0; i<294; i++)
{
printf("%c ",out[i]);
}
printf("\n\n\n");
aes_dec_key(key, 16, &ectx);
aes_dec_blk((unsigned char *)out, (unsigned char *)in, &ectx);
for (i=0; i<294; i++)
{
printf("%2x",out[i]&0xff);
}
printf("\n");
for (i=0; i<294; i++)
{
printf("%c",in[i]);
}
printf("\n");
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -