title: Crypto - Is SJCL (javascript) encryption compatible with OpenSSL?
body: <p>I am trying to decrypt some information that has been encrypted with the <em>SJCL (Stanford Javascript Crypto Library)</em>. An example page is at <a href="http://bitwiseshiftleft.github.io/sjcl/demo/" rel="nofollow">http://bitwiseshiftleft.github.io/sjcl/demo/</a>. </p>
  
  <p>If I encrypt some data, I have been unable to decrypt it using <em>OpenSSL (version 1.0.1f).</em> I have seen another question on stackoverflow asking about this - but that question and its answers didn't really help.</p>
  
  <p>For instance, encrypting with a password of 'password', and a random salt of '6515636B 82C5AC56' with 10000 iterations of a 256 bit key size gives a Key of 'D8CCAA75 3E2983F0 3657AB3C 8A68A85A 9E9F1CAC 43DAB645 489CDE58 0A9EBDAE', which is exactly what I get with OpenSSL. So far, so good.</p>
  
  <p>When I use SJCL with this key and an IV of '9F62544C 9D3FCAB2 DD0833DF 21CA80CF' to encrypt, say, the message 'mymessage', then I get the <em>ciphertext</em>:</p>
  
  <pre><code>{"iv":"n2JUTJ0/yrLdCDPfIcqAzw==",
  "v":1,
  "iter":10000,
  "ks":256,
  "ts":64,
  "mode":"ccm",
  "adata":"",
  "cipher":"aes",
  "salt":"ZRVja4LFrFY=",
  "ct":"FCuQWGYz3onE/lRt/7vCl5A="}
  </code></pre>
  
  <p>However, no matter how I modify or rewrite my <code>OpenSSL</code> C++ code, I cannot decrypt this data.
  I've googled and found a few code samples, but nothing that has actually worked.
  I'm aware that I need to use the <code>CCM</code> cipher mode in OpenSSL - but this mode is poorly documented.
  Can anyone post some OpenSSL code to successfully decrypt this data?</p>