If you use kSecAttr for the username, it will be encrypted.
The attributes associated with the keychain element depend on the element class; the classes of objects most used by applications ... are Internet passwords and shared passwords. As you would expect, Internet passwords include attributes for objects such as a security domain, protocol type, and path. Passwords or other secrets stored as keychain elements are encrypted.
(see "Keychain Structure" )
As you use kSecAttrAccount , which can only be used with the kSecClassInternetPassword and kSecClassGenericPassword (see @kSecAttrAccount Keyword Reference ), the account name will be encrypted.
schmubob
source share