August 11, 2009

Apple today released Safari 4.0.3 via Software Update and direct download. Not ones to be caught sleeping on the job, our crack team of ninja developers have countered with 1Password 2.9.23, an update that makes it compatible with the new version of Safari.

You can nab the 1Password 2.9.23 (or newer) update with the "Check for Updates..." option, found under 1Password's application menu.

June 08, 2009

Well that didn't take long: we released a beta on Monday afternoon to support Apple's officially shipping version of Safari 4. I step away to eat dinner, take the dogs to the park, and play some Left 4 Dead, and suddenly I see our developer ninjas have finished polishing 1Password 2.9.19.

The headlining feature of our new version (available via the built-in Check for Updates feature) is, of course, support for Safari 4 on Mac OS X 10.4 Tiger and 10.5 Leopard (sorry, 10.6 Snow Leopard is still in the works). But that's not all: we managed to add better rules for matching domains like k12.sc.us, as well as drag-and-drop Dock icon support for importing .appshelf files.

For users of Camino nightly builds, we had to disable support to avoid some crashes. Sorry guys.

Lastly, a tip just in case the 1Password button disappears from Safari 4's toolbar after upgrading 1Password. We've heard a couple rare reports of this happening, but the fix is easy: quit Safari, then open 1Password and go to the Preferences > Browsers section. Uncheck Safari, then check it again. Restart Safari and the 1Password button should return.

Update: 1Password 2.9.19 beta 3 is out with support for Safari 4. You can use Check for Updates to grab it, but keep in mind: it's a beta. If you aren't used to downloading these, check out the simple instructions in the final paragraph below.

As you may already know, Apple released the final, shipping version of Safari 4 today during its inaugural WWDC '09 keynote. You can install it, but be warned: the 1Password plug-in does not work in the officially shipping version of Safari 4 (it works fine in the Safari 4 beta though), so you will (very temporarily) be without your 1Password data if you install Safari 4 right now.

For a workaround, you can, of course, opt to hold off on installing Safari 4 until we can ship at least a beta update. Since we know you probably won't wait, you can keep 1Password running in the Dock, always waiting for a quick manual copy and paste of your login info.

Naturally, we are already hard at work on updating 1Password for Safari 4. If you just gotta install the new Safari as soon as possible, open the Updates panel in 1Password's preferences and enable checking for betas. We hope to have beta support for Safari 4 by this evening (note: hope). Otherwise, if all goes well, an official update should be out (note: should) by tomorrow.

March 05, 2009

Why you should migrate your 1Password data to the Agile keychain format now

There is a lot of confusion, misconception, and mystery about the OS X keychain in general and I want to take the time in this post to clear some of those up as well as talk about 1Password's interaction with OS X formatted keychains. When I was at Macworld Expo in January, I had several people come up to the booth and ask "how is this different than the built in keychain?" and it is a question we get a lot. The problem with answering that question is that there are varying opinions and ideas as to what OS X keychains are and exactly what they do. So I would ask "what do you think the keychain does?" and I got a lot of different answers, several "I don't really know" responses, and some pretty defensive postures to the question and I learned it is not the best question to ask. However, it really is at the root of the issue around this topic. So I want to start with a simple example of what happens when you save your mail account password in the default keychain and expand from there.

You add a new POP/IMAP/MobileMe mail account in Apple Mail and it has an option of saving it in the keychain so that you do not have to type it in every time you want to check your mail. This is a good thing. However, let's explore what really happens here a little deeper and talk about the tools used to do so.

First, there is the keychain itself. The keychain is a file located in your user folder. Specifically, you click on your home folder, double click on Library, and you will see a folder named Keychains. Double click on this folder and you will see all the keychains for this user account. Each user account has a different set of keychains although system wide keychains are allowed and are stored outside the user account folder structure. In many cases, you will see only one keychain and it will be named login.keychain. You can have as many keychains as you want to create but only one keychain at a time can be designated as the default keychain. You cannot tell which one is the default keychain by looking in the folder so I'll talk about this later. What is important to note though is that the keychains are only files. The file contains data formatted in a special way as defined by Apple's keychain specification documentation. The format is actually open source and can be inspected by anyone. You can think of these as database files. Files that contain your data in a defined format. What is most important to note though is that by themselves, these file do absolutely nothing.

#1 Keychains files do not DO anything - They are simple database files - They contain the data

You can think of this the same way as photos, MP3s, and videos you have stored on your Mac. The files themselves do not do anything but hold the data. You need to load iPhoto, iTunes, and Quicktime in order to view or play these files. This leads us to Keychain Access.

Keychain Access is an application provided by Apple that allows you to view and edit the contents of a .keychain file. Keychain Access understands the special format of a keychain file and can read and write to the contents of this file the same way that iPhoto can read picture files and allow you to edit and save them. When you load the Keychain Access utility you will see a screen similar to this:

In the upper left pane is a list of the all the keychains. The one that is listed as bold is the default keychain. Normally this will be the login.keychain. This is important to note for the next part but keep that in mind for now. The pane below lists the type of items that Apple has defined in the keychain format and include cerificates, keys, passwords, and secure notes. The largest pane to the right shows the list of all the items stored within the keychain. I have highlighted the mail passwords I have stored for some Gmail accounts that I used in Apple Mail. I can examine the contents of an item by double clicking on it. Doing so will open a window that looks like this:

This shows all the fields that are available for a password type in a keychain. You'll notice that it contains fields for a title, URL, notes, and password. The password field is actually concealed and requires you to check the box next to Show password in order to view it and here's a fairly unknown secret: it is the only field that is encrypted. That is right, if you were to examine the contents of the keychain file with a text editor you could see the other fields plainly. However, the password field is encrypted and you would not be able to see the password in plain text. This will be a fairly important point that I will talked about when we get to how 1Password uses keychain. If you click on the Access Control tab at near the top of the window you will see something similar to this:

The keychain format allows for Access Control Lists on a per item basis. ACLs determine what what applications are allowed to access an item. This prevents applications from accessing passwords that do not belong to it. In the example above you will see that Apple Mail and Keychain Access are the only applications allowed to access this entry. At the top of this window are options for allowing access to this item. For example, if Safari tried to access this item you would be prompted to allow access since the Confirm option is enabled. (Confirm is the default setting for all items) The important part here is that Keychain Access is the means to view and edit the information in a keychain. Although you can manually add items to a keychain, they can only be used by applications that are allowed to read them. Keychain Access doesn't actually use any of the passwords and although it can display the data it too needs permission to view the encrypted data.

#2 Keychain Access is a means to view and edit data stored in a keychain file but does not make use of the data

So how do we get all these password into a keychain file? If we needed to manually create one of these entries every time we wanted to use a new password it would be cumbersome. Of course we never do that because our applications do it for us. When we created the Gmail account in Apple Mail it stored the password in the default keychain because it has been programmed to do so. The coders who created Apple Mail had to create a special section of code for interfacing with a keychain and to store their data in the keychain. You'll notice that in the iTunes store you always have to type in your password because iTunes did not program in the ability to store that password in your default keychain. It is up to applications to store passwords in the keychain. The keychain file itself does not do it as it is just a database file. Keychain Access does not do it unless you manually create an entry and even if you did then the application would need to have been programmed to read it from the file. Since you can have more than one keychain and applications do not want to figure out which keychain it needs to go saved in they normally query the system for the default keychain and store them in that keychain.

#3 Applications store passwords in keychain files

So to wrap up our mail example:

1. Apple Mail saves the password in the default keychain
2. The keychain file contains this data and the ACL allows Apple Mail to read it without prompting you
3. You can view, edit, or delete this item using Keychain Access

Hopefully this sheds some light on the relationships between the different components involved, but I want to talk about one more real life example. The Safari browser has a feature named auto-fill for password management. How it is works is it automatically remembers passwords for sites you visit, saves them in the default keychain, and then restores them automatically when you return to the site. This sounds wonderful and if it actually worked everywhere then 1Password would be less useful. Of course it doesn't handle multiple logins for the same site, separate logins for different sub-domains, and has many other limitations which drove us to develop 1Password. The only point I want to make is that in relation to web passwords it is the Safari application itself that is storing passwords in the default keychain when auto-fill is enabled. The keychain file itself is still just a database file and Keychain Access has no role in this. :)

#4 Safari stores passwords in the default keychain when you use it auto-fill feature

Now I want to talk about how this relates to 1Password. When 1Password was first created we decided that instead of creating our own database file for storing on the data, we could just create a separate keychain file and store our data in that file. After all, keychains are just database files. The advantage to this was that all the code to do this is already published and Cocoa (the OS X development tool) already included all the framework for reading, writing, and manipulating keychain entries. So 1Password created a 1Password.keychain file that was separate of the default keychain and was only used by 1Password. You could use Keychain Access to view the information but the only applications allowed to access the entries in the 1Password keychain were 1Password and the browsers that made use of the entries.

#5 1Password uses a separate keychain that is independent of the default keychain

However, as shown above the number of fields was limited and only the password field was encrypted. We wanted 1Password to be able to store more information and we wanted it to be encrypted. The way we handled this was by "stuffing" the password field. We gathered all the fields we used and all the additional information and we encapsulated them in JavaScript Object Notation (JSON) and then basically made this entire object the password. You can read more about JSON here. JSON starts an object with a { symbol so if you were to examine a 1Password item with Keychain Access you would only see the { since it only displays one line at a time. Apple allowed for but did not really consider multi-line passwords with Keychain Access. If you press the down arrow you will be able to scroll through all the data that 1Password is stuffing in the password field. This is also why you should never edit the password field in the 1Password.keychain using Keychain Access. This stuffing method allows us to create many more fields for an item as well as insuring that this data will be encrypted.

#6 1Password extends the OS X keychain format by stuffing a lot of extra information in the password fields

Another advantage of using the OS X keychain format was that .Mac/MobileMe syncing was available so we didn't have to worry about developing a sync engine. The OS X keychain served us well but after using it for a very long time we learned a lot more about its limitations and quirks. For example, .Mac/MobileMe keychain syncing has a serious issue that causes the encrypted data to become corrupt. To date Apple has provided no explanation or fix for this. You can read about this in this forum thread. When we created the 1Password Touch application we also learned that adding an application to the Leoapard firewall causes it to re-confirm the ACLS on all the items in the keychain associated with that application. This may be fine for our mail example where there are only a couple of entries but when you have 500 items it is unacceptable. We also started thinking about how we would ever be able to support file attachments to items at some point in the future and came to the realization that the limitations and problems with the OS X format were too great and that we need to migrate to a new format. We developed the Agile keychain format to take the strengths of the OS X keychain format forward while leaving the limitations and problems behind. You can read more about the design here. We've spent a lot of time developing it has it has been very well tested and received at this point and encourage everyone to switch to the new format. We have an article describing how to do this here.

The last point I want to address in this post is in regards to some users' being hesitant to switch to the new format. Some of this is founded in different ideas about how keychains work and I hope I have addressed that above. Others are concerned about being able to move backwards if they ever decide to stop using 1Password and have the notion that the 1Password.keychain can be used by other applications. I want to clear that up a bit but I first want to state that we have no intention of ever locking anyone's data into 1Password. This is why we have export options including a generic CSV file that can be read an interpreted by tons of applications. You can always get your data out of 1Password. However, what you cannot do is use a 1Password.keychain to go back to using Safari's auto-fill feature with it. Although the 1Password.keychain file is a standard OS X keychain that can be accessed with Keychain Access, the data stuffing in the password field that I mentioned above means that most applications wouldn't know what to do with the JSON data even if they had permission to read it. Not to mention that Safari's auto-fill only stores domain names and not full URLs for its entries. So there is not a path backwards using the 1Password.keychain file. You would need to export the data and import elsewhere and you can do this with the Agile keychain format too. Clinging to the old format doesn't buy you anything but the potential to experience issues like those described above.

#8 There are no advantages to using the OS X keychain format for your data - Only disadvantages compared to the new format

In summary, if you have not already done so, please migrate your 1Password data from the OS X keychain format to the Agile keychain format. You'll be glad you avoided any issues described above and you'll be ready for future features in 1Password.

February 25, 2009

Apple surprised a lot of people by releasing a public beta of Safari 4 yesterday. Soon after upgrading, many 1Password users found that their beloved 1Password was nowhere to be found in Safari. Ever the agile company, we sprang into action. Within a few short hours, we released a beta version of 1Password that included support for the Safari 4 beta.

Today, we released 1Password 2.9.9. This is the latest stable release and includes twenty improvements and bug fixes, including support for Safari 4. You can download the latest version of 1Password by choosing 1Password > Check for Updates in the menu bar or by visiting our downloads page.

June 13, 2007

The beta version of Safari 3.0 was announced by Steve Jobs at WWDC on Monday. The interest to the new version of Safari was so high that within the first hour of being announced by Apple's CEO, Agile Web Solutions received hundreds of messages from 1Passwd users clamoring for integration with their favorite browser.

Given Steve's amazing sales pitch of Safari and these speed numbers, it is not surprising the demand was so high.