Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 15th, 2004, 08:52 AM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default SHA1 Encryption/Decryption help

Hi:

Can someone help me in decrypting a string that has been encrypted in the manner below?:

=== Start Encryption ===
public static byte[] EncryptPassword(string password)
{
    UnicodeEncoding encoding = new UnicodeEncoding();
    byte[] hashBytes = encoding.GetBytes( password );

    // compute SHA-1 hash.
    SHA1 sha1 = new SHA1CryptoServiceProvider();
    byte[] cryptPassword = sha1.ComputeHash ( hashBytes );

    return cryptPassword;
}
=== End Encryption ===


Reply With Quote
  #2 (permalink)  
Old April 15th, 2004, 04:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Can't be done.

SHA1 is a hashing algorithm, the whole point of which is to provide a one-way hash of an input string (byte array, actually).

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
Reply With Quote
  #3 (permalink)  
Old April 16th, 2004, 03:12 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Please don't cross post. Most of us monitor more than one forum category and we'll see your question. See this thread.
Reply With Quote
Reply


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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Encryption/Decryption with rijndael ?!? vbmo Classic ASP Basics 3 November 17th, 2009 04:14 AM
Encryption/Decryption Problem param99 SQL Server 2000 4 December 14th, 2006 05:20 AM
Encryption and Decryption kvanchi General .NET 1 February 2nd, 2005 02:04 PM
Encryption and Decryption kvanchi General .NET 2 January 24th, 2005 02:52 PM
SHA1 Encryption/Decryption help kakko72 VS.NET 2002/2003 7 November 15th, 2004 07:20 PM



All times are GMT -4. The time now is 11:56 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.