LWN.net Logo

Encrypting users' web data with Grendel

By Jake Edge
January 27, 2010

Web sites that store personal information can be worrisome. Depending on the type of information stored, disclosure of the data can have effects ranging from embarrassment to financial loss. There are steps that web services (or "cloud" services in the parlance of our times) can take to reduce the danger of data disclosure. The Grendel encryption mechanism for sensitive data, which was recently released under the MIT license, is a reasonable approach to the problem—and one that can now be examined and possibly adopted by other web services.

Grendel comes from Wesabe, which is an online money management tool. That means that Wesabe stores some of the most sensitive information a user has, so focusing on security is important to Wesabe and its users. Unlike many other web services, though, Wesabe has been very candid about the steps it takes to safeguard its users' data. The release of Grendel is just another step along that path.

The basic idea behind Grendel is a REST-based API that a web service can use to implement an encrypted store for users' data. The encryption is done using OpenPGP, with keys being generated when the user is created. The private key is then encrypted using the user's password, so that it is only when a user is logged in that their data can be decrypted.

The interface is meant for the back-end, "behind the firewall", so the rest of the web application uses the API over a local or private network to retrieve whatever data has been stored by the user. Grendel is meant to reduce or eliminate sensitive data leaks to third parties, not to protect against malfeasance from web site operators. The recent RockYou breach is mentioned as an example of the kinds of leaks Grendel is meant to prevent.

The decryption key for the OpenPGP private key (i.e. the user's password) is only available to the application while the user is logged in. Once that session terminates (either through an explicit log out or a session time out), any attacker will be unable to access the data unless they can crack the password. So, even a complete compromise of the database contents will not easily allow access to the sensitive data.

In some ways, Grendel is an outgrowth of another technique that is used by Wesabe, called the "privacy wall". The wall makes it difficult for attackers to correlate users and their private information even if the database contents are exposed. Instead of using a user_id field to connect a user table to another table, the technique uses a cryptographic hash of the username and password as the key into the second table. That way, a particular user's data in the second table cannot be retrieved without the user's password, which is only available during the lifetime of their session.

There are some additional wrinkles, of course. If a user forgets their password, their data is essentially lost. This might be viewed by some as a weakness to the system, but from a security standpoint it makes a lot of sense. One way to handle that problem might be storing the key value (i.e. hash of username and password) encrypted with other information, such as the answer to security questions. However, security questions have risks of their own to consider.

There is nothing truly groundbreaking in these techniques, but there are certainly useful ideas embodied in them. While Grendel itself may not be of interest to other web services, due to its architecture or its Java implementation, it is heartening to see a web service that takes security seriously enough to explain its methods. It certainly stands in stark contrast to other services and their "trust us" security policies—something to consider when storing sensitive data on the web.


(Log in to post comments)

Encrypting users' web data with Grendel

Posted Jan 28, 2010 6:01 UTC (Thu) by grahame (subscriber, #5823) [Link]

I hacked up a little system to encrypt RSS / Atom feeds, then decrypt them again (via greasemonkey) in the browser when a web feed reader (eg. google reader) presents them back to the user.

http://code.google.com/p/aesulate/

It seems a related idea. I wanted to use Google's reader, but I didn't want to trust them to be able to read the feeds I'm pushing to them.

Encrypting users' web data with Grendel

Posted Jan 29, 2010 10:03 UTC (Fri) by bronson (subscriber, #4806) [Link]

"a cryptographic hash of the username and password as the key into the second table"

So... the user is unable to change his password? I can't imagine it's realistic to update all the rows that contain a user's key!

Encrypting users' web data with Grendel

Posted Jan 29, 2010 12:56 UTC (Fri) by quotemstr (subscriber, #45331) [Link]

Well, as David Wheeler said, "Any problem in computer science can be solved with another layer of indirection." :-)

Encrypting users' web data with Grendel

Posted Jan 29, 2010 11:55 UTC (Fri) by Liefting (subscriber, #8466) [Link]

...with keys being generated when the user is created...

I would think that a woman in delivery has other things to worry about than creating a key for a website of some sort for her baby.

Or have we all lost sight of reality so much that we now think that a user == a user account?

Encrypting users' web data with Grendel

Posted Jan 29, 2010 19:31 UTC (Fri) by jonabbey (subscriber, #2736) [Link]

Java is a barrier to use?

Encrypting users' web data with Grendel

Posted Feb 1, 2010 10:52 UTC (Mon) by alankila (subscriber, #47141) [Link]

Perhaps the community is still thought to harbor residual hate for java. *shrug*

I personally think that as far as professional development in Linux goes, Java offers the best tool support and the most mature software available. In that context, the idea of Java being a problem is ridiculous.

Encrypting users' web data with Grendel

Posted Feb 1, 2010 14:22 UTC (Mon) by jake (editor, #205) [Link]

> Java is a barrier to use?

Sorry if I wasn't clear here. All I meant was that, depending on what language/framework was used in the rest of the app, Java might not be a good fit for any particular web app. And the same goes for Grendel's architecture (REST-ful interface to back-end servers). No knock on either Java or the architecture was intended.

jake

password recovery

Posted Feb 8, 2010 9:21 UTC (Mon) by robbe (subscriber, #16131) [Link]

How about on account creation the answers to a few security question are
queried from the user. These are used to encrypt recovery information,
and the resulting bundle is *not* stored at the website, but presented as
a file to download and store for the user.

This means that if the user wants to recover a forgotten password he or
she needs to proof knowledge (not-that-secure security questions) *and*
ownership (of the file).

If the webpage could check for the continued presence of this "backup
file", that would be nice -- but I fear giving scripting this privilege
is a security problem.

Copyright © 2010, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds