Crypto ++ AES解密如何? [英] Crypto++ AES Decrypt how to?
问题描述
下面没有noob指南crypto ++在那里。或者没有,我已经找到了。我想做的是解密我用另一个AES加密器生成的uchars数组。我从哪里开始?我有图书馆建立和链接盛大。我需要设置任何东西或者我只是调用我的数组上的函数(如果有什么函数)?
There are next to no noob guides to crypto++ out there. Or none that I've found anyway. What I want to do is decrypt an array of uchars I generate with another AES encrypter. Where would I start? I have the library built and linking grand. Do I need to set anything up or do I just call a function on my array (and if so what function) ?
我真的应该从一个人知道这东西。
I'd really appreshiate some help from someone who knows this stuff.
感谢
推荐答案
我不会说东西太多,但这里有一些测试代码,我放在一起加密/解密字符串与AES。将此扩展为使用其他数据不应太难。
I wouldn't say I "know my stuff" too much about this, but here's some test code I put together to encrypt/decrypt strings with AES. Extending this to use some other data shouldn't be too hard.
string output;
CTR_Mode<AES>::Encryption encrypt((const byte*)key,AES::DEFAULT_KEYLENGTH,(const byte*)iv);
StringSource(plaintext, true, new StreamTransformationFilter(encrypt, new StringSink(output)));
cout << "Encrypted: " << output << endl;
string res;
CTR_Mode<AES>::Decryption decrypt((const byte*)key,AES::DEFAULT_KEYLENGTH,(const byte*)iv);
StringSource(output, true, new StreamTransformationFilter(decrypt, new StringSink(res)));
cout << "Decrypted: " << res << endl;
在这个过程中,我发现Crypto ++测试程序中的源代码cryptest)是一个大的帮助。这是一个有点难读,但首先阅读它变得更容易,当你使用它。我还从维基百科( http://en.wikipedia.org)中获得了很多帮助,了解可用的块密码模式/ wiki / Block_cipher_modes_of_operation )。
While working on this, I found the source code in the Crypto++ test program (the VisualStudio project called "cryptest") to be a big help. It was a little tough to read at first, but it gets easier as you work with it. I also got a lot of help understanding the available block cipher modes from Wikipedia (http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation).
这篇关于Crypto ++ AES解密如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!