title: CCCrypt difference between iOS5 and iOS6
body: <p>I have got a decryption/encryption method using <code>CCCrypt()</code> which worked really well on iOS5. Now I am working with the iOS6 SDK and never changed my code, but it seems that something is broken. I can still encrypt a string with a key and decrypt it, but if I use another key to decrypt the same string, the <code>CCCryptStatus</code> coming back from <code>CCCrypt()</code> is still <code>0(kCCSuccess)</code> - even when the decryption fails, because after that my NSData isn't filled. On iOS5 I got the error message -4303 which I could handle then. Any ideas what can be wrong now?</p>
  
  <p>My Code:</p>
  
  <pre><code>char keyPtr[kCCKeySizeAES256+1]; 
  bzero(keyPtr, sizeof(keyPtr)); // fill with zeroes (for padding)
  
  // fetch key data
  [key getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
  
  if (encryptOrDecrypt == kCCDecrypt)
  {
      data = [GTMBase64 decodeData:data];
  }
  
  NSUInteger dataLength = [data length];
  
  size_t bufferSize = dataLength + kCCBlockSizeAES128;
  
  void *buffer = malloc(bufferSize);
  
  size_t numBytesDecrypted = 0;
  CCCryptorStatus cryptStatus = CCCrypt(encryptOrDecrypt,
                                        kCCAlgorithmAES128,
                                        kCCOptionPKCS7Padding,
                                        keyPtr,
                                        kCCKeySizeAES256,
                                        NULL ,
                                        [data bytes], dataLength, 
                                        buffer,       bufferSize, 
                                        &amp;numBytesDecrypted);
  
  if (cryptStatus != kCCSuccess){
      // do something, but cryptStatus is always 0!
  }
  </code></pre>
  
  <p>EDIT:
  Tested it on iPad Simulator 5. When I make a decryption with another key the status I receive is -4303. Only in ios6 the status coming back is 0.</p>