title: How to use CCCrypt() to encrypt a file?
body: <p>when I encrypt a file(doc, pdf, etc.), I use:</p>
  
  <pre><code>size_t bufferSize = dataLength + kCCBlockSizeAES128;    
  CCCrypt( kCCEncrypt, kCCAlgorithmAES128, kCCOptionPKCS7Padding,
                                   keyPtr, kCCKeySizeAES256,
                                   NULL /* initialization vector (optional) */,
                                   dataBytes, dataLength, /* input */
                                   buffer, bufferSize,/* output */
                                   &amp;numBytesEncrypted );
  </code></pre>
  
  <p>when decrypt, I use:</p>
  
  <pre><code>size_t bufferSize = dataLength + kCCBlockSizeAES128;
  CCCryptorStatus result = CCCrypt( kCCDecrypt, kCCAlgorithmAES128,    kCCOptionPKCS7Padding,
                                   keyPtr, kCCKeySizeAES256,
                                   NULL /* initialization vector (optional) */,
                                   dataBytes, dataLength,/* input */
                                   buffer, bufferSize,/* output */
                                   &amp;numBytesEncrypted );
  </code></pre>
  
  <p>But when decrypt, it returns error:kCCDecodeError = -4304.</p>
  
  <p>If I remove the param of kCCOptionPKCS7Padding when decrypt, there is no error. But the file cannot open either.</p>
  
  <p>So, could u tell me how to pass these params?</p>
  
  <p>thanks alot!</p>