标签:crypto exp end poco encrypt cout rsa val lov
#include "poco/Crypto/Cipher.h"
#include "poco/Crypto/CipherFactory.h"
#include "Poco/Crypto/RSAKey.h"
using Poco::Crypto::Cipher;
using Poco::Crypto::CipherFactory;
using Poco::Crypto::RSAKey;
Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(RSAKey(RSAKey::KL_1024, RSAKey::EXP_SMALL));
std::string val("I love karen!");
std::string enc = pCipher->encryptString(val);
std::string dec = pCipher->decryptString(enc);
std::cout << "加密后:" << enc << std::endl;
std::cout << "解密后:" << dec << std::endl;
标签:crypto exp end poco encrypt cout rsa val lov
原文地址:http://www.cnblogs.com/xuandi/p/6881698.html