C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Encryption »

Password Encryption - the Simple Way


Posted Date: 03 Apr 2008    Resource Type: Code Snippets    Category: Encryption
Author: Raju.MMember Level: Gold    
Rating: 1 out of 5Points: 5



The code sample can be used in web pages to encrypt a password.

The GetEncryptedPassword converts the plain text input to cipher text, in cryptography terminologies. To our use, is the static FormsAuthentication.HashPasswordForStoringInConfigFile() function that takes the plainText and also the algorithm that should be used to encrypt the password.

In this example we use the SHA1 algorithm. Technically, the SHA1 algorithm is a hash algorithm and hence returns only a hash of the plaintext. A hashing algorithm one whose input size is not-fixed, but output's size is fixed.


public string GetEncryptedPassword(string plainText)
{
return FormsAuthentication.HashPasswordForStoringInConfigFile(plainText, "SHA1");
}



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Hashing passwords with SHA1 algorithm  .  Encrypting using SHA1 algorithm  .  Encrypting Plaintext using SHA1 algorithm  .  Encrypting Passwords with FormsAuthentication class  .  Encrypting passwords using SHA1 algorithm  .  Encrypting Passwords  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Salted-MD5 Encryption
Previous Resource: How to encrypt a string using c#
Return to Discussion Resource Index
Post New Resource
Category: Encryption


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use