title: encrypt-decrypt single block with AES and Crypto++
body: <p>I need to encrypt single block of AES. I cant use any modes like CBC and other. Every example what i have seen use streaming modes.</p>
  
  <p>EDIT:
  ok, i did it in the next manner, but i really dislike this try.</p>
  
  <pre><code>void dec(const byte *key, const byte* xblock, const byte *cipher, byte *plain) {
      AESDecryption d;
  
      try {
          const NameValuePairs &amp;nvp = MakeParameters("", 0);
          d.UncheckedSetKey(key, 16, nvp);
          d.ProcessAndXorBlock(cipher, xblock, plain);
      }
      catch(...) {}
  }
  </code></pre>