首页 > 其他 > 详细

poco库 RSA加解密

时间:2017-05-20 11:46:06      阅读:560      评论:0      收藏:0      [点我收藏+]

#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;

 

poco库 RSA加解密

原文:http://www.cnblogs.com/xuandi/p/6881698.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!