Exercise 2: Encrypt a password with a hash
In this exercise you will use hashing to encrypt passwords and store them in an XML file.
First step
To hit the BugSmak.sln project, the default installation path should be C:\Program Files\Microsoft Enterprise Library January Ex02\begin, and compiled.
Second Step review application
1. Select Debug | The Start without Debugging menu command runs the application.
2. The application allows you to manage user names and passwords in an XML file. Add a new user Elmo, click on the New User button, enter the username Elmo, leave the default password P@ssw0rd, and click the OK button.
3. Click the Save button to save the changes made to the Userstore.config file.
4. Closes the application.
5. In Solution Manager, open the Userstore.config file, and you can see that the password exists in plaintext.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="userStore"
type="UserStore.Configuration.UserSettings, UserStore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</configSections>
<userStore>
<users>
<add name="Elmo" password="P@ssw0rd" />
<add name="Zoe" password="P@ssw0rd" />
</users>
</userStore>
</configuration>