Change from crypto++ to botan #4371
-
I want to migrate my crypto++ code to Botan Currently crypto++ is very outdated in relation to new methodologies, botan seems very up to date and has daily updates I would like some information and tips on the best way I can convert my code Does Botan support Zlib like crypto++? for example I am working with a byte array and in crypto++ I use CryptoPP::ZlibDecompressor dec;
CryptoPP::ArraySource ar(src, sLen, true, new CryptoPP::Redirector(dec));
decompressor.Get(psrc, static_cast<size_t>(maxr)); I'm also encrypting a byte array, as they are bytes of files compressed in zlib, as far as I've tested, I can't increase the size of the bytes of files compressed in zlib, if I'm wrong, please let me know What way does botan use to encrypt without using AEAD_Mode just normal AES? I have following code to decrypt: std::vector<uint8_t> decData;
CryptoPP::CTR_Mode<CryptoPP::AES>::Decryption dec;
dec.SetKeyWithIV(MyKey.data(), MyKey.size(), MyIV.data());
decData.resize(srcLen);
CryptoPP::ArraySource arraySrc(src, srcLen, true,
new CryptoPP::StreamTransformationFilter(dec,
new CryptoPP::ArraySink(decData.data(), decData.size())
)
);
return decData; In the botan to clear the memory, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Yes, but unlike Crypto++ zlib is based on the 3rd party
So for AES in counter mode your snippet would look something like this (untested)
Correct |
Beta Was this translation helpful? Give feedback.
-
@randombit Thanks for support Is there an AES-256/CTR mode? Where can I find a list of existing options? |
Beta Was this translation helpful? Give feedback.
-
Code converted, thanks for the infos |
Beta Was this translation helpful? Give feedback.
Yes, but unlike Crypto++ zlib is based on the 3rd party
zlib
library rather than being implemented directly. So you must enable support at build time (--with-zlib
), almost all distros/packagers use this option. You can see an example of usage in the command line utilitySo for AES in counter mode your snippet would look something like this (untested)