473,383 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Decrypt a HMACSHA1 encrypted password?

Here is my question. I am encrypting user login passwords using HMACSHA1 and I would like to know how to decrypt the passwords for displaying to managers and when emailing the password to the user if they forget. Here is the code to encrypt but does anyone know how to decrypt using HMACSHA1?

Expand|Select|Wrap|Line Numbers
  1. byte[] byteKey = Encoding.UTF8.GetBytes(strEncrKey);
  2. string regitPWD = this.txtEncrypRaw.Text;
  3. HMACSHA1 hmac = new HMACSHA1(byteKey);
  4.  
  5. byte[] bytePWD = Encoding.UTF8.GetBytes(regitPWD);
  6. byte[] byteHash = hmac.ComputeHash(bytePWD);
  7. this.txtEncrypted.Text = Convert.ToBase64String(byteHash);
Thank you in advance

Matthew
Mar 31 '09 #1
1 6923
tlhintoq
3,525 Expert 2GB
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Mar 31 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Gidi | last post by:
Hi, Is there Buid-In fuction in C# that Encrypt and Decrypt strings? i have a textbox which i'm writing into file, and i want to encrypt it before writing, i'm not looking for something fancy,...
7
by: Dica | last post by:
i've used the sample code from msdn to create an encyption/decryption assembly as found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp i'm...
7
by: Vishal | last post by:
Hello, I used this article (http://aspnet.4guysfromrolla.com/articles/103002- 1.2.aspx) to encrypt my password. Now I need to decrypt the password again to a string. Is that possible, if so...
1
by: Peter | last post by:
Has anyone made a simple tripple des encryption function? I'm looking for a function to pass a string into with a password and generate an encrypted output. That's it. IE. Public Function...
4
by: hohans | last post by:
Hi all, I have an encryption class that encrypts and decrypts password using TripleDESCryptoServiceProvider. It was written originally in framework 1.0 and been working fine. And those...
0
by: Hannibal111111 | last post by:
I found this code on a site for doing string encryption/decryption. The string will encrypt fine, but I get this error when I try to decrypt. Any idea why? I posted the code below. The error...
2
by: Bernard Dhooghe | last post by:
The information center writes: "Encryption Algorithm: The internal encryption algorithm used is RC2 block cipher with padding, the 128-bit secret key is derived from the password using a MD2...
1
by: MimiMi | last post by:
I'm trying to decrypt a byte array in java that was encrypted in C#. I don't get any error messages, just a result that's completely not what I was hoping for. I think I am using the same type of...
6
by: cnivas | last post by:
Hai All, Good Evening, I'm doing a small application using python and MySQL in APPLE MACINTOSH OPERATING SYSTEM. I want to to store the password in encrypted form in the database. While...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.