64231

Crypto++ AES Decrypt how to?

Question:

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.

Thanks

Answer1:

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;

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 (<a href="http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation" rel="nofollow">http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation</a>).

Answer2:

Here's a couple of resources from a Google search:

<a href="http://www.bitvise.com/users-guide.html" rel="nofollow">http://www.bitvise.com/users-guide.html</a>

<a href="http://andreyvit.livejournal.com/37576.html" rel="nofollow">http://andreyvit.livejournal.com/37576.html</a>

Recommend

  • Extending the User Interface in Outlook 2010 to add to the Right Click menu
  • Securely storing (encrypting) data in an ASP.Net application
  • Is PascalScript compatible with Delphi XE5 to create Android/iOS/Windows applications?
  • Maven use Encrypted passwords in POM
  • Spring Security bcrypt encoding login is not working
  • Is it mandatory to have a doGet or doPost method?
  • Avoid Inheriting Super Class Tests in ScalaTest
  • several dataProvider per one Test in TestNG
  • How to access meteor package name inside package?
  • How to get latest version of a artifact on Bintray using JSONP
  • How to specify input and output paths from cmd.exe for a PowerShell script?
  • Tell Git to stop prompting me for conflicts when none really exist?
  • What does 'Language neutral' mean with regard to MAKELANGID?
  • Deserializing XML into class C#
  • vba code to select only visible cells in specific column except heading
  • When should I choose bucket sort over other sorting algorithms?
  • Function pointer “assignment from incompatible pointer type” only when using vararg ellipsis
  • Warning: Can't call setState (or forceUpdate) on an unmounted component
  • AT Commands to Send SMS not working in Windows 8.1
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • Windows forms listbox.selecteditem displaying “System.Data.DataRowView” instead of actual value
  • InvalidAuthenticityToken between subdomains when logging in with Rails app
  • KeystoneJS: Relationships in Admin UI not updating
  • trying to dynamically update Highchart column chart but series undefined
  • embed rChart in Markdown
  • How to get Windows thread pool to call class member function?
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • apache spark aggregate function using min value
  • python draw pie shapes with colour filled
  • Sorting a 2D array using the second column C++
  • How to get NHibernate ISession to cache entity not retrieved by primary key
  • costura.fody for a dll that references another dll
  • Observable and ngFor in Angular 2
  • How to Embed XSL into XML
  • How can I use `wmic` in a Windows PE script?
  • UserPrincipal.Current returns apppool on IIS
  • Unable to use reactive element in my shiny app
  • Conditional In-Line CSS for IE and Others?
  • java string with new operator and a literal
  • How do I use LINQ to get all the Items that have a particular SubItem?