views:

49

answers:

1

I am encrypting via the NSData AES128EncryptWithKey method and having problems decrypting it on the .Net side. I've read several posts that basically all say that my Salt and / or Initialization Vectors must be different and I suspect that my problem is related to that fact. However, I cannot find anything that says what the Salt used by the method is.

The AES128EncryptWithKey routine calls CCCrypt as follows:

CCCrypt(kCCEncrypt, kCCAlgorithmAES128, kCCOptionPKCS7Padding,
                                      keyPtr, kCCKeySizeAES128, 
                                      NULL /* initialization vector (optional) */,
                                      [self bytes], dataLength, /* input */
                                      buffer, bufferSize, /* output */
                                      &numBytesEncrypted);

So I see the initialization vector is NULL, but where is the Salt?

+1  A: 

I was confused by the simplicity of this Encryption method! AES does not have a Salt.

But I also found that .Net routines do not like a Null for the iv. A 16-byte array or 0's yes, but Null No.

Steve Reed Sr