没有合适的资源?快使用搜索试试~ 我知道了~
AES C语言实现代码
4星 · 超过85%的资源 需积分: 50 17 下载量 191 浏览量
2014-04-01
09:25:27
上传
评论 1
收藏 5KB TXT 举报
温馨提示
试读
5页
AES C语言实现代码 亲测可用,要用赶紧下 分数低 业界良心
资源推荐
资源详情
资源评论
#pragma comment (lib, "tomcrypt.lib")
#include "stdafx.h"
#include "time.h"
#include <stdio.h>
#include <tchar.h>
#include <wchar.h>
#include <tomcrypt.h>
#include <math.h>
int _tmain(int argc, _TCHAR* argv[])
{
int error = 0;//返回值
int index = 0;//加解密器索引
unsigned char key[16] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};//对称密钥
//unsigned char key[24] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17};
//unsigned char key[32] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f};
symmetric_ECB ecbAES = {0};//对称加解密内部结构
FILE *filePlainText = 0,*fileCipherText = 0,*decryptFile = 0;//文件
unsigned char ct[16] = {0},pt[16] = {0};//加解密数据块
size_t len = 0;//长度
clock_t a,b;
//注册加解密器
if(-1 == register_cipher(&aes_desc)){
printf(_T("register_cipher(&aes_desc) failed"));
return (-1);
}
//查找对应索引
index = find_cipher("aes");
if(index == -1){
#include "stdafx.h"
#include "time.h"
#include <stdio.h>
#include <tchar.h>
#include <wchar.h>
#include <tomcrypt.h>
#include <math.h>
int _tmain(int argc, _TCHAR* argv[])
{
int error = 0;//返回值
int index = 0;//加解密器索引
unsigned char key[16] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};//对称密钥
//unsigned char key[24] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17};
//unsigned char key[32] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f};
symmetric_ECB ecbAES = {0};//对称加解密内部结构
FILE *filePlainText = 0,*fileCipherText = 0,*decryptFile = 0;//文件
unsigned char ct[16] = {0},pt[16] = {0};//加解密数据块
size_t len = 0;//长度
clock_t a,b;
//注册加解密器
if(-1 == register_cipher(&aes_desc)){
printf(_T("register_cipher(&aes_desc) failed"));
return (-1);
}
//查找对应索引
index = find_cipher("aes");
if(index == -1){
资源评论
- yuedragon19922014-06-23还挺好的,但不能直接运行好像
- umbrellalala2014-06-04嗯,挺好用的~
wangpengfeiplokm
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功