Re: Keychain best practice
Christiaan Hofman <[email protected]> Fri, 10 Dec 2010 16:37:04 +0100
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
On Dec 10, 2010, at 15:40, jerry porter wrote: > Hello, > > First of all, I would not store anything moderately important in the keychain > like SSN's or passwords. > > We hired a forensics company to test an app I wrote for my company and they > broke the keychain in a matter of moments. > > I used AES Encryption to secure my passwords etc, and then stored them in user > defaults. > > Jerry Porter > Isn't that for the user to decide? For most users these passwords won't be nearly as important as most (internet) passwords that are already regularly saved in the keychain. Moreover, the user is asked before saving a password by default. Without explicit permission from the user passwords won't be saved automatically, and the user can easily turn off any interaction with the keychain if he want so. So I'd say this should not be a serious security issue, while offering a great convenience to my users. Unless you say that Apple should not provide Keychain Access at all. Christiaan > > - - - > When told the reason for daylight saving time the old Indian said ... > > > "Only a white man would believe that you could cut a foot off the top of a > blanket and sew it to the bottom of a blanket and have a longer blanket." > - - - > - - - > Seen on a T-shirt: "Remember you are unique and special... Just like everyone > else" > - - - > > > > ----- Original Message ---- > From: Christiaan Hofman <[email protected]> > To: MacOSX-Dev List <[email protected]> > Sent: Fri, December 10, 2010 8:23:38 AM > Subject: Keychain best practice > > I have an app that can open encrypted documents. To make it easier for the user, > the app can save passwords for these documents in the keychain, using the > Keychain Services API. My question here is about how to best create the password > items for these documents. > > First if all, these documents have an unique ID, which can be be seen before > decryption. I want to use this ID to identify the item in the keychain, rather > than e.g. the path to the file, as the filename can easily be changed by the > user without changing the file contents. > > > Also, I have red the docs, and know how to create and find keychain items, > including (slightly) more advanced features like custom attributes, and have > done so successfully. So that's not really what my question is about. > > My question is more about: what should I use for the various attributes, such as > service, account, and perhaps label, description and comment? > > Currently I am using the user name as the kSecAccountItemAttr and "MyApp - > <document ID>" for the kSecServiceItemAttr. I am also setting the > kSecCommentAttr to the file's path so the user can see which file is associated > to the item in Keychain Access.app (for instance if he wants to manage them). > That does work well, but I wonder whether this is the correct way to do it. > > > For instance, I could also use some description like "MyApp Document Passwords" > for kSecServiceItemAttr and the document ID for kSecAccountItemAttr. Or perhaps > the other way around. > > > Also, could it be acceptable/useful to use a custom kSecDescriptionItemAttr of > kSecDLabelItemAttr? I was thinking of a description something like "<Type> > document password" and for the label perhaps the file path or the document > displayName. Does this make sense? > > thanks, > Christiaan > > > _______________________________________________ > MacOSX-dev mailing list > [email protected] > http://www.omnigroup.com/mailman/listinfo/macosx-dev > > > >