poco库 RSA加解密

Posted 早上起来洗澡

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了poco库 RSA加解密相关的知识,希望对你有一定的参考价值。

#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加解密的主要内容,如果未能解决你的问题,请参考以下文章