Are account names (kSecAttrAccount) encrypted in iOS keychain?
Asked Answered
P

1

8

Apple's GenericKeychain example saves a username and password in the iOS keychain. It does this using kSecAttrAccount for the username, and kSecValueData for the password.

Are all data items placed in the keychain encrypted, so including the kSecAttrAccount/username in this example?

I'm asking because I don't want account names to be exposed.

Phebe answered 19/5, 2013 at 20:1 Comment(3)
Have you looked in the app document folder?Orange
Yes, I've looked @Undo, but it's not very clear. I don't want to guess with things like the keychain.Phebe
Have you found an answer for this?Dude
M
6

If you use kSecAttr for the username it will be encrypted.

The attributes associated with a keychain item depend on the class of the item; the item classes most used by applications ... are Internet passwords and generic passwords. As you might expect, Internet passwords include attributes for such things as security domain, protocol type, and path. The passwords or other secrets stored as keychain items are encrypted.

(see "Structure of a Keychain")

As you use kSecAttrAccount, which can only be used with the classes kSecClassInternetPassword and kSecClassGenericPassword (see Keychain Services Reference @ kSecAttrAccount), the account name will be encrypted.

Mochun answered 10/7, 2013 at 15:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.