Return to iWEBTOOL

Go Back   iWEBTOOL Talk > The Web and your Website > Web Development
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
Welcome to iWEBTOOL Talk, where you talk about webmaster-related stuff.
 
Discuss topics which interest you.
With over thousands of threads (topics), we're sure you'll find something that'll interest you.
Ask for help whenever you need it.
We have thousands of members who are available to help you if you need it.
It's absolutely FREE!

 1  Register           2  Browse the board           3  Discuss whatever may interest you!
 


Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 07-05-2007, 12:26 PM   #1
hanusoftware
Newcomer
 
hanusoftware's Avatar
 
Join Date: Jun 2007
Posts: 6
hanusoftware is on a distinguished road
Default Code to encrypt the Password or any string

/// <summary>

/// Thsi method retrieve the string to encrypt from the Presentation Layer

/// And return the Encrypted String

/// </summary>

/// <param name="str"></param>

/// <returns></returns>

public string encryptPassword(string strText)

{

return Encrypt(strText, "&%#@?,:*");

}

/// <summary>

/// This method retrieve the encrypted string to decrypt from the Presentation Layer

/// And return the decrypted string

/// </summary>

/// <param name="str"></param>

/// <returns></returns>

public string decryptPassword(string str)

{

return Decrypt(str, "&%#@?,:*");

}

/// <summary>

/// This method has been used to get the Encrypetd string for the

/// passed string

/// </summary>

/// <param name="strText"></param>

/// <param name="strEncrypt"></param>

/// <returns></returns>

private string Encrypt(string strText, string strEncrypt)

{

byte[] byKey = new byte[20];

byte[] dv ={ 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };

try

{

byKey = System.Text.Encoding.UTF8.GetBytes(strEncrypt.Subs tring(0, 8));

DESCryptoServiceProvider des = new DESCryptoServiceProvider();

byte[] inputArray = System.Text.Encoding.UTF8.GetBytes(strText);

MemoryStream ms = new MemoryStream();

CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(byKey, dv), CryptoStreamMode.Write);

cs.Write(inputArray, 0, inputArray.Length);

cs.FlushFinalBlock();

return Convert.ToBase64String(ms.ToArray());

}

catch (Exception ex)

{

throw ex;

}

}

/// <summary>

/// This method has been used to Decrypt the Encrypted String

/// </summary>

/// <param name="strText"></param>

/// http://www.hanusoftware.com

/// <param name="strEncrypt"></param>

/// <returns></returns>

private string Decrypt(string strText, string strEncrypt)

{

byte[] bKey = new byte[20];

byte[] IV = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };

try

{

bKey = System.Text.Encoding.UTF8.GetBytes(strEncrypt.Subs tring(0, 8));

DESCryptoServiceProvider des = new DESCryptoServiceProvider();

Byte[] inputByteArray = inputByteArray = Convert.FromBase64String(strText);

MemoryStream ms = new MemoryStream();

CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(bKey, IV), CryptoStreamMode.Write);

cs.Write(inputByteArray, 0, inputByteArray.Length);

cs.FlushFinalBlock();

System.Text.Encoding encoding = System.Text.Encoding.UTF8;

return encoding.GetString(ms.ToArray());

}

catch (Exception ex)

{

throw ex;

}

}


http://www.hanusofware.com
hanusoftware is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
SEO Checklist
Get yourself better ranking with
our "Do-it-Yourself" SEO Checklist.
Click Here
Old 07-06-2007, 08:42 AM   #2
koitech
Smurf
 
koitech's Avatar
 
Join Date: Jun 2007
Posts: 28
koitech is on a distinguished road
Default Re: Code to encrypt the Password or any string

well this is very strange and difficult to understand code.
I know about a very simple method used in php.
Its called MD6 / MD5
you can just encrypt the password using MD6(password)

you just need to write one line.and you are done.so which will you prefeR?
__________________
MarbleHost.com - reliable web hosting service
koitech is offline  
Old 07-06-2007, 09:23 AM   #3
SolutionP
Member
 
SolutionP's Avatar
 
Join Date: Jan 2007
Posts: 142
SolutionP will become famous soon enough
Default Re: Code to encrypt the Password or any string

By the way, do you know any tools to unencript winRAR password?
SolutionP is offline  
Old 07-27-2007, 08:53 PM   #4
brunsol
Newcomer
 
brunsol's Avatar
 
Join Date: Jul 2007
Posts: 1
brunsol is on a distinguished road
Default Re: Code to encrypt the Password or any string

http://www.kevlardisk.org does decrypt md5 passwords.
brunsol is offline  
Old 08-04-2007, 07:48 PM   #5
trichnosis
Senior Member
 
trichnosis's Avatar
 
Join Date: Jan 2007
Posts: 452
trichnosis will become famous soon enough
Send a message via MSN to trichnosis
Default Re: Code to encrypt the Password or any string

it looks good . thanks for it
__________________
Türkçe Bilgi |
Hobiler | Satranç | 2
trichnosis is offline  
Old 08-06-2007, 02:37 PM   #6
Zaiaku
Newcomer
 
Zaiaku's Avatar
 
Join Date: Aug 2007
Location: www.zaiaku.com
Posts: 17
Zaiaku is on a distinguished road
Default Re: Code to encrypt the Password or any string

I needed the md5 password decoder thanks!
__________________
If you need free hosting PM me with your needs.
Zaiaku | PM Mix | shinzaiaku
Zaiaku is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
Webmaster Tools Webmaster Tools Click Here
Closed Thread

(Threads which have no activity for more than 30 days are automatically closed.)



Quick Reply
Message:

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
encrypt and decrypt query string hanusoftware Programming 0 06-07-2007 07:21 AM
Changing my password williamvanasse219@hotmail MSN 4 03-29-2007 03:53 PM
Help removing Bios password artmark General Talk 10 03-22-2007 12:42 AM
Query String pakadtrader JavaScript 3 01-28-2007 10:11 AM


All times are GMT. The time now is 03:25 AM.


Powered by vBulletin v3.6.7 © 2008, Jelsoft Enterprises Ltd. SEO by vBSEO © 2006, Crawlability, Inc.