Wednesday, September 7, 2011

Windows Phone 7 – Quick Tip #31 – Safely Save Passwords in your WP7 App

Normally you save your application settings in Isolated Storage, this is pretty secure, but really isn’t the best approach for storing stuff you need to protect.  Although I guess anything is possible with enough time and computing horse power the Windows Phone 7.1 SDK provides a more secure mechanism to store things like passwords or application keys.  It’s called ProtectedData and provides a mechanism to takes byte arrays and encrypt them and turn them back into their original state.  This class is in the System.Security.Cryptography namespace.

This could be a simple way to use this to protect passwords in your application.

image

Just as a heads up if you try to use this in your XNA application, you’ll need to add the assembly mscorlib.extensions to your application.

-twb

No comments:

Post a Comment