.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Encryption & Decryption >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Password Encryption & Decryption

Posted By:Ramesh durai       Posted Date: August 20, 2010    Points: 10    Category: Encryption & Decryption    URL: http://www.dotnetspark.com  

Simply Pass Your text which one want encrypt as password and also pass text which one want Decrypt.
 


private string EncrDecr(string Str_Pwd)
{
    string Str_Pass = null;
    long Lng_Pos = 0;
    // For Iterating through each byte
    byte Byte_Data = 0;
    // For Reading Data
    byte Byte_DataC = 0;
    // For storing Complemented (or encrypted) Byte_Data
    int Int_I = 0;

    Lng_Pos = 1;
    for (Int_I = 0; Int_I <= Strings.Len(Str_Pwd) - 1; Int_I++)
    {
        Byte_Data = Strings.Asc(Strings.Mid(Str_Pwd, Lng_Pos, 1));
        Byte_DataC = !(Byte_Data);
        //Encryption of the Data
        if (!(Byte_DataC == 255))
        {
            Str_Pass = Str_Pass + Strings.Chr(Byte_DataC + 23);
            //Writing Encrypted Data
        }
        Lng_Pos = Lng_Pos + 1;
    }
    EncrDecr = Str_Pass;
}

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply

    Read also another Resources from the same Author

Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend