Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can iOS really support AES 256?

I have read the header of CommonCryptor.h, and only I can find kCCAlgorithmAES128

But there are a few answer in SO stating it can, e.g.

AES Encryption for an NSString on the iPhone

Anyone can answer?

like image 789
Howard Avatar asked Mar 08 '12 11:03

Howard


People also ask

Does Apple use AES?

iOS devices have benefitted from hardware encryption for nearly a decade now, and Apple uses AES-256, which is what banks use for transactions. When data is encrypted no matter the state, and the key is generated and stored on-device, it is called end-to-end encryption.

Is AES 256 still secure?

Out of 128-bit, 192-bit, and 256-bit AES encryption, 256-bit AES encryption is technically the most secure because of its key length size. Some go as far as to label 256-bit AES encryption overkill because it, based on some estimations, would take trillions of years to crack using a brute-force attack.

What is AES in iOS?

A container for Advanced Encryption Standard (AES) ciphers. iOS 13.0+ iPadOS 13.0+ macOS 10.15+ Mac Catalyst 13.0+ tvOS 13.0+ watchOS 6.0+

What type of encryption does iOS use?

iOS and iPadOS devices use a file encryption methodology called Data Protection, whereas the data on an Intel-based Mac is protected with a volume encryption technology called FileVault.


2 Answers

You can always use OpenSSL on iPhone, and that does support AES 256.

That being said, kCCAlgorithmAES128 means a block length of 128, not key length. According to this example code (found in this answer) you simply need to use kCCKeySizeAES256 for the keyLength parameter to get support for 256 bit keys.

like image 59
DarkDust Avatar answered Oct 05 '22 18:10

DarkDust


Recently I discovered a category of NSData (also NSString) which implements AES en-/decryption. Maybe this is helpful to crypt any kind of data:

Adding methods to NSData and NSString using categories to provide AES256 encryption on iOS

But it seems to have an implementation issue, which makes it incompatible with openSSL.

--

Another useful like might be Properly encrypting with AES with CommonCrypto. To support 256 bit keys just change the kCCKeySizeAES128 to 256.

--

Last but not least this tread looks promising: Decode OpenSSL AES256 string in iOS

like image 21
dom Avatar answered Oct 05 '22 19:10

dom