1
是否有可能在Poco Crypto中使用AES128设置加密填充?我无法找到任何选项。在Poco Crypto中设置加密填充
std::string Crypto::Encrypt(const std::string &input, const std::string &key)
{
Poco::Crypto::Cipher::ByteVec iv { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
Poco::Crypto::Cipher::ByteVec key2 {key.begin(), key.end()};
Poco::Crypto::Cipher::Ptr pCipher = Poco::Crypto::CipherFactory::defaultFactory()
.createCipher(Poco::Crypto::CipherKey("aes128", key2, iv));
std::string output = pCipher->encryptString(input);
return std::move(output);
}
简单的OpenSSL我有这个选项:
EVP_CIPHER_CTX *ctx;
EVP_CIPHER_CTX_set_padding(ctx, 0)