What encryption algorithm does the iOS keychain use to protect data?
Asked Answered
O

4

17

After extensive googling I haven't managed to find an answer to this question1, which is surprising, since `security through obscurity' isn't really security at all...

Is there a reliable source of an answer to this question (such as a certification application for iOS, source code, or similar)?

1The only mention I could find was that it might use 3DES.

Ottinger answered 10/6, 2011 at 23:0 Comment(0)
R
15

According to this official Apple webpage :

Keychain items are encrypted using two different AES-256-GCM keys: a table key (metadata), and a per-row key (secret-key).

UPDATE: Update from May 2019. Encryption changed from 128 to 256.

Radiochemical answered 12/1, 2017 at 14:56 Comment(1)
Just a comment: this document seems to be regularly updated, so I think we can pretty much rely on it.Radiochemical
P
9

"Security through obscurity" means relying on obscurity to achieve security. It does not mean you are insecure just because you do not advertise your security mechanisms to the world.

Apple presumably wants the freedom to change the implementation of the keychain, so its encryption is not part of its specification because it does not need to be.

That said, I seriously doubt Apple uses 3DES, because they actually know what they are doing. I would give 10-to-1 odds they use AES.

An authoritative answer can probably only come from Apple or from someone who has disassembled their code.

Pruritus answered 10/6, 2011 at 23:10 Comment(0)
E
7

According to the keychain documentation Keychain services and other Mac OS X security APIs are built on the open source Common Data Security Architecture (CDSA) and its programming interface, Common Security Services Manager (CSSM).

More information on that here

The discussion thread here quotes from official apple documentation (currently defunkt) stating;

All the password data in the keychain is protected using the Triple Digital Encryption Standard (3DES).

I'll see if I can turn up anything more current / definitive.

UPDATE:

OK there is a copy of an official OSX document here that does confirm the 3DES, however I agree that the implementation is likely to be subject to change.

Whether this also applies to iOS would also require verification, however given the harmonisation of iOS and Lion, I suspect it is more likely than not.

Empirical answered 10/6, 2011 at 23:11 Comment(4)
Those documents describe the interface, not the implementation. They do not answer the question (and I do not believe Apple answers this question in any of their documentation).Pruritus
@Nemo, see updated answer with (albeit 3rd party copy of) official Apple document stating 3DES.Empirical
Nice find. But I would still give 10-to-1 odds that iOS uses AES. (There is no reason for the keychains to be compatible since you cannot move them between devices. And OS X is much older than iOS. And 3DES is no longer recommended for use by the U.S. government...)Pruritus
> OK there is a copy of an official OSX document here that does confirm the 3DES ===> Where's the key? Is it stored on the hard drive or in a hardware component like in a smart card somewhere?Delocalize
S
0

Every iOS device has a dedicated AES 256 crypto engine built into the DMA path between the flash storage and main system memory, making file encryption highly efficient.On A9 or later A-series processors, the flash storage subsystem is on an isolated bus that is only granted access to memory containing user data via the DMA crypto engine.

Simferopol answered 6/4, 2017 at 11:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.