How to: Using Cryptograpic Services ?

Madz

Well-known member
Joined
Jan 22, 2003
Messages
155
Hello

I want to use Cryptography in my software , for example my application is saving passwords to database and i want to decrypt that value before saving it to database how can i acomplish this task.
 
The System.Security.Cryptography namespace provides classes
for encrytion and hashing. Read all about it [mshelp=ms-help://MS.VSCC/MS.MSDNVS/Cpqstart/html/cpsmpnetsamples-howtocryptography.htm]here[/mshelp].
 
Thanks, last night i was trying to encrypt one file this is the code but i was unable to decrypt it.

C#:
public static void Main(string[] args)
{
    string sFile = "madz.txt";

    FileStream fso = File.Create(sFile);
    RijndaelManaged rm = new RijndaelManaged();
    CryptoStream cs = new CryptoStream (
        fso, rm.CreateEncryptor(), CryptoStreamMode.Write);

    StreamWriter swo = new StreamWriter(cs);
    swo.WriteLine("I Love you my Sweet Heart !");

    swo.Close();
    cs.Close();
    fso.Close();
}
 
Back
Top