当前位置: 首页 > news >正文

进贤网站建设广告发布

进贤网站建设,广告发布,永久的海外域名,建网站多少钱建个网站需要怎么做前提准备条件 需要安装openssl需要安装openssl-dev需要配置CMakeLists.txt文件集体内容可以参考我提供的相关参考链接 AES_file.h #include openssl/aes.h #include iostream #include fstream #include cstring#define RELEASE_ARRAY(P) if…前提准备条件 需要安装openssl需要安装openssl-dev需要配置CMakeLists.txt文件集体内容可以参考我提供的相关参考链接 AES_file.h #include openssl/aes.h #include iostream #include fstream #include cstring#define RELEASE_ARRAY(P) if (P) \ { \delete[] P; \P NULL; \ }class AES{ public:// AES文件加密函数 ///int TestAesEncryptFile(std::string original_backup_file_path, std::string backup_dir_path, std::string password){int encrypt_chunk_size 16;std::ifstream original_backup_file(original_backup_file_path.c_str(), std::ios::binary);std::ofstream backup_dir(backup_dir_path, std::ios::binary);if (!original_backup_file){std::cout Can not open original_backup_file file. std::endl;return 1;}if (!backup_dir){std::cout Can not open backup_dir_path file. std::endl;return 1;}//用指定密钥对一段内存进行加密结果放在outbuffer中unsigned char aes_keybuf[32];memset(aes_keybuf, 0, sizeof(aes_keybuf));strcpy((char *)aes_keybuf, password.c_str());AES_KEY aeskey;AES_set_encrypt_key(aes_keybuf, 256, aeskey);char *in_data new char[encrypt_chunk_size 1];char *out_data new char[encrypt_chunk_size 1];while (!original_backup_file.eof()){original_backup_file.read(in_data, encrypt_chunk_size);if (original_backup_file.gcount() encrypt_chunk_size){backup_dir.write(in_data, original_backup_file.gcount());}else{AES_encrypt((const unsigned char *)in_data, (unsigned char *)out_data, aeskey);backup_dir.write(out_data, original_backup_file.gcount());}};backup_dir.close();original_backup_file.close();RELEASE_ARRAY(in_data);RELEASE_ARRAY(out_data);return 0;}// AES文件解密函数 //int TestAesDecryptFile(std::string in_file_path, std::string out_file_path, std::string password){int encrypt_chunk_size 16;std::ifstream original_backup_file(in_file_path.c_str(), std::ios::binary);std::ofstream backup_dir(out_file_path, std::ios::binary);if (!original_backup_file){std::cout Can not open original_backup_file file. std::endl;return 1;}if (!backup_dir){std::cout Can not open backup_dir file. std::endl;return 1;}//用指定密钥对一段内存进行加密结果放在outbuffer中unsigned char aes_keybuf[32];memset(aes_keybuf, 0, sizeof(aes_keybuf));strcpy((char *)aes_keybuf, password.c_str());AES_KEY aeskey;AES_set_decrypt_key(aes_keybuf, 256, aeskey);char *in_data new char[encrypt_chunk_size 1];char *out_data new char[encrypt_chunk_size 1];while (!original_backup_file.eof()){original_backup_file.read(in_data, encrypt_chunk_size);if (original_backup_file.gcount() encrypt_chunk_size){backup_dir.write(in_data, original_backup_file.gcount());}else{AES_decrypt((unsigned char *)in_data, (unsigned char *)out_data, aeskey);backup_dir.write(out_data, original_backup_file.gcount());}};backup_dir.close();original_backup_file.close();RELEASE_ARRAY(in_data);RELEASE_ARRAY(out_data);return 0;} };main.cpp #include iostream #include load_or_save_db.h #include include/AES_file.hint main() {time_t t1, t2, t3, t4;t1 time(nullptr);printf(加解密起始时间 %s\n, ctime(t1));std::string password xcdf123456;AES aes;// 数据开始加密aes.TestAesEncryptFile(/home/gsc/Projects/1.txt, /home/gsc/Projects/2.txt, password);t2 time(nullptr);printf(AES256加密成功!\n);printf(加密用时: %ld秒\n, (t2 - t1));t3 time(NULL);// 数据开始解密aes.TestAesDecryptFile(/home/gsc/Projects/2.txt, /home/gsc/Projects/3.txt, password);t4 time(NULL);printf(AES256解密成功!\n);printf(解密用时: %lld秒\n, (t4 - t3));return 0; }参考链接 C: 基于OpenSSL的AES256加解密测试clion中链接openssl库
http://wiki.neutronadmin.com/news/180701/

相关文章:

  • 网站建设哈尔滨网站建设1整人网站建设
  • 主题字体wordpressseo引流什么意思
  • 什么网站做护工红杉树装饰公司怎么样
  • 网站阴影机房网络建设方案
  • 做外贸哪些网站好可以免费做调查问卷的网站
  • 网站建设考试多选题宁波 小程序开发公司
  • 做做网站下载2023亲子网 网站正在建设中
  • 浙江建设信息港网站查询营销网课
  • 打开山东城市建设职业学院网站西安网站开发培训价格
  • 电气网站设计工艺品做网站
  • 绿色网站设计手机移动端网站怎么做
  • 网站建设技能描述安徽省建设厅八大员报名网站
  • 计算机考试模拟网站怎么做儿童编程哪家培训机构好
  • 建设 网站工作汇报海城建设网站
  • 青岛信息推广网站王占山 同济大学
  • 北京网站设计技术云南网站建设公司哪家好
  • 牡丹江百姓信息网广告公司seo是什么职位
  • 重庆网站建设哪家有网站界面版式
  • 网站是空间备案新能源汽车价格补贴
  • 驻马店市住房和城乡建设局网站.net网站服务器
  • 电影网站如何建设佛山网站建设no.1
  • 苏宁网站优化与推广在线书店网站怎么做
  • 传媒公司可以做网站么做公司官网需要哪些数据
  • 东莞网站建设规范美食网页设计免费模板
  • 零遁nas做网站dz怎么做视频网站
  • 源码网站模板台州专业做网站
  • 资源下载网站建设网站开发维护前景
  • 网站和app设计区别wordpress如何设置外网访问
  • 企业网站报告册设计模板有域名了怎么建立网站
  • 网站建设基本情况境外企业网站推广