views:

96

answers:

3

I'm writing a web application that allows anyone to register (using their OpenID). When a user registers, their OpenID is saved in a MySQL database.

My question is: In which format should I be storing a user's OpenID value?

If someone were to gain access to my database (I'm planning for the worst case scenario) - would it be an issue that the user's OpenID can be viewed unencrypted? Should i be encrypting it when it goes into storage?

A: 

This is one of those things that is up to personal taste, but MySQL do offer some encryption functions you might wish to take a look at.

http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html

kb
+10  A: 

There is no real benefit in protecting their open id: that's the whole point of it!

OpenID is made so that the "secure info" is not available at the intermediary sites where you use it - the only secure info is held at the OpenID Provider (the site where you actually enter your password).

A compromised database on your site means that the attacker will know who your users are, but nothing more, nothing less.

Computer Guru
Thanks for taking the time to answer.
Jon Reeks
You're most welcome, Jon! :)
Computer Guru
FWIW, there is a benefit to hiding the open ID. That's not to say it should be hashed in the database (that's a bit extravagant) but it shouldn't be considered "public" information that you freely display on the website (take this website, for example. You cannot determine my OpenID from it).
Noon Silk
@silky - agreed. I wouldn't consider a user's OpenID public. I wouldn't display it, I was thinking "OK if the worst happened and someone could view them, then what's the consequence..." Jon.
Jon Reeks
Treat it with the same respect/security you would an email address. Don't encrypt it, that's overkill... but don't flagrantly wave it around, either.
Computer Guru
A: 
In which format should I be storing a user's OpenID value?

Even when someone has access to the openid's stored in your database, this information will be of no use to him as it is only a url which asks for user authentication details when executed.

So you need not worry on that.

The openid providers will take care of that if the details entered are correct or not.

Gaurav Sharma