I am using an open-source encryption library in my iOS app, in the description it states that it is AES 256-bit encryption. Does this mean that ONLY the key size is AES 256-bit?
What puzzles me is that the Key Size is 256, but the algorithm and block size are 128. So which type of encryption is the library using and why are they different?
#define FBENCRYPT_ALGORITHM kCCAlgorithmAES128
#define FBENCRYPT_BLOCK_SIZE kCCBlockSizeAES128
#define FBENCRYPT_KEY_SIZE kCCKeySizeAES256
These constants are declared in CommonCryptor.h, which includes helpful comments.
AES is a block cipher that uses 128 bit blocks irrespective of key size. Consequently,
kCCAlgorithmAES128is just “longhand” for AES generally.So, the code indicates that it’s using standard AES with a 256 bit encryption key.