【发布时间】:2020-05-25 00:36:14
【问题描述】:
我目前正在为 c++ 的 crypto++ 库苦苦挣扎。我想要的只是获取密码的填充输入。我有以下 sn-p 来加密字符串“plain”:
CryptoPP::StringSource(plain, true, new CryptoPP::StreamTransformationFilter(e, new CryptoPP::StringSink(cipher), CryptoPP::BlockPaddingSchemeDef::DEFAULT_PADDING));
其中 e 是一个密码:
CryptoPP::CBC_Mode<CryptoPP::SPECK128 >::Encryption e;
我可以用下面的sn-p输出密文:
CryptoPP::StringSource(cipher, true, new CryptoPP::HexEncoder(new CryptoPP::FileSink(std::cout)));
我需要的是获得字符串“plain”的填充版本。有没有人可以提示我使用 StreamTransformationFilter 来获取填充输入字符串的输出?
【问题讨论】:
标签: c++ encryption cryptography crypto++