-
大小: 143KB文件类型: .rar金币: 2下载: 0 次发布日期: 2021-06-15
- 语言: 其他
- 标签: 指纹认证 加密 AES-256-CBC
资源简介
指纹认证插件:中控指纹采集器,浏览器版本IE9及以上,插件与页面交互数据采用了AES-256-CBC加密

代码片段和文件信息
#include se64.h>
#include
#include
#include
#include
#include “AESCryption.h“
using namespace CryptoPP;
#pragma comment(lib “cryptlib.lib“ )
AESCryption::AESCryption(void)
{
}
AESCryption::~AESCryption(void)
{
}
std::string AESCryption::encrypt(std::string plaintext std::string key std::string iv)
{
std::string ciphertext = ““;
try{
CBC_Mode< AES >::Encryption encryptor;
encryptor.SetKeyWithIV((const byte *)key.c_str() CryptoPP::AES::MAX_KEYLENGTH (const byte *)iv.data());
CryptoPP::StringSource ss((const byte *)plaintext.c_str() plaintext.length() true
new CryptoPP::StreamTransformationFilter(encryptor new CryptoPP::StringSink(ciphertext) CryptoPP::StreamTransformationFilter::DEFAULT_PADDING));
}
catch (Exception e)
{
std::cout << e.GetErrorType() << “ “ << e.GetWhat() << std::endl;
}
return ciphertext;
}
std::string AESCryption::decrypt(std::string ciphertext std::string key byte *iv)
{
std::string plaintext = ““;
if (!iv)
{
iv = new byte[AES::BLOCKSIZE];
memset(iv 0 AES::BLOCKSIZE);
}
try{
CBC_Mode< AES >::Decryption decryptor;
decryptor.SetKeyWithIV((const byte*)key.c_str() CryptoPP::AES::MAX_KEYLENGTH (const byte*)iv);
CryptoPP::StringSource ss((const byte*)ciphertext.c_str() ciphertext.length() true
new CryptoPP::StreamTransformationFilter(decryptor new CryptoPP::StringSink(plaintext) CryptoPP::StreamTransformationFilter::NO_PADDING));
}
catch (Exception e)
{
time_t ltime = time(NULL);
plaintext = ““;
}
char fname[32] = { 0 };
time_t ltime = time(NULL);
return plaintext;
}
std::string AESCryption::base64Encode(std::string data)
{
std::string data64 = ““;
try
{
StringSource((byte *)data.c_str() data.size() true new base64Encoder(new StringSink(data64)));
}
catch (Exception e)
{
std::cout << e.GetErrorType() << “ “ << e.GetWhat() << std::endl;
}
return data64;
}
std::string AESCryption::base64Decode(std::string data64)
{
std::string data = ““;
try
{
StringSource((byte *)data64.c_str() data64.size() true new base64Decoder(new StringSink(data)));
}
catch (Exception e)
{
std::cout << e.GetErrorType() << “ “ << e.GetWhat() << std::endl;
}
return data;
}
std::string AESCryption::hmacEncode(std::string info std::string key)
{
std::string mac = ““ encoder = ““ derived = ““;
try{
HMAC hmac((const byte*)key.data() key.size());
StringSource(info true new HashFilter(hmac new StringSink(mac)));
}
catch (const CryptoPP::Exception& e){
std::cerr << e.what() << std::endl;
}
encoder.clear();
StringSource(mac true new StringSink(encoder));
transform(encoder.begin() encoder.end() encoder.begin() ::tolower);
std::cout << “sign:“ << encoder.c_str();
return encoder; //return HMAC
}
std::string AESCryption::urlDecode(std::string urlCode)
{
std::string data = ““;
int
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4765 2018-01-24 17:13 fingerprint\AESCryption.cpp
文件 646 2018-01-16 17:57 fingerprint\AESCryption.h
文件 182 2018-01-24 14:35 fingerprint\Chrome\chromepackage\manifest.json
文件 2292 2018-01-24 14:35 fingerprint\CMakeLists.txt
文件 1964 2018-01-16 16:12 fingerprint\Factory.cpp
文件 4647 2018-01-16 16:12 fingerprint\fingerprint.cpp
文件 2232 2018-01-16 16:12 fingerprint\fingerprint.h
文件 6564 2018-01-23 09:35 fingerprint\fingerprintAPI.cpp
文件 5043 2018-01-23 09:35 fingerprint\fingerprintAPI.h
文件 11862 2018-01-24 17:26 fingerprint\helper.cpp
文件 3470 2018-01-19 12:51 fingerprint\helper.h
文件 1089 2018-01-24 10:27 fingerprint\Logger.cpp
文件 338 2018-01-19 14:35 fingerprint\Logger.h
文件 2270 2018-01-24 14:35 fingerprint\Mac\bundle_template\Info.plist
文件 151 2018-01-24 14:35 fingerprint\Mac\bundle_template\InfoPlist.strings
文件 360 2018-01-24 14:35 fingerprint\Mac\bundle_template\Localized.r
文件 437 2018-01-24 14:35 fingerprint\Mac\bundle_template\remove.sh
文件 728 2018-01-24 14:35 fingerprint\Mac\distribution.xm
文件 837 2018-01-24 14:35 fingerprint\Mac\dmgdesign.applesc
文件 119961 2018-01-24 14:35 fingerprint\Mac\dmg_template\.background\background.png
文件 0 2018-01-24 14:35 fingerprint\Mac\dmg_template\.background\PLACE_BACKGROUND_PICTURE_HERE.txt
文件 0 2018-01-24 14:35 fingerprint\Mac\dmg_template\README.txt
文件 2930 2018-01-24 14:35 fingerprint\Mac\installer.cmake
文件 2731 2018-01-24 14:35 fingerprint\Mac\pkgInstaller.cmake
文件 1186 2018-01-24 14:35 fingerprint\Mac\projectDef.cmake
文件 821 2018-01-24 14:35 fingerprint\Mac\sc
文件 3873 2018-01-24 14:35 fingerprint\PluginConfig.cmake
文件 3243 2018-01-24 14:35 fingerprint\Win\projectDef.cmake
文件 205 2018-01-24 14:35 fingerprint\Win\WiX\fingerprint.ddf
文件 131 2018-01-24 14:35 fingerprint\Win\WiX\fingerprint.inf
............此处省略20个文件信息
相关资源
- 易语言极速文本加密解密模块V3.1模块
- 易语言加解密例程源码易语言生成随
- 易语言加密记事本简单例程源码
- 希尔密码加密、解密和破密
- PNG加密解密工具73383
- m1卡 ic卡可选择扇区初始化加密软件
- Zprotect专业版(无限制) 一机一码E
- 加密软件漏洞评测系统 V8.9
- C 大整数RSA加密
- [免费]安全加密软件U盘加密,文件加
- 加密cad图形的lisp文件
- 透明加密源码及说明
- Openssl给文件传输加密
- 3des加解密_C 实现
- ESAM相关文章集合
- RSA AES DES ECC加密算法源码
- 密码学课程设计:DES加密解密算法的
- C 标准文档(已加密)
- 破解QQ空间相册加密查看
- 威盾PHP加密专家——php代码加密软件
- 管家婆加密狗工具dogtools
- 提供几个加密算法的源码
- 非常好用的硬盘加密软件-个人密盘
- 基于89C51计算机锁定加密键盘设计
- U盘防拷贝系统破小孩
- 易语言叮小当动态加密算法源码
- 易语言文本加密成数字源码
- 易语言RC4加密解密源码
- 易语言字节集加密解密对比源码
- 易语言椭圆曲线算法加密文件源码
评论
共有 条评论