using md5 but want sha-1

F

Frank

Hi,
I was reading that md5 is not that secure and that sha-1 or whilpool or
ripemd-160 were better solutions. I'm using asp.net and I want to encrypt the
password. Where can I find a sample code for that with sha-1. I can't seem to
find one.

Thanks
Francisco
 
D

Dominick Baier [DevelopMentor]

Hi,

first of all - SHA1 is a hashing algorithm - no encryption. Hashing is a
non-reversible process, which is fine for passwords.

The corresponding class is called SHA1Managed - i would recommend moving
to SHA256Managed if you can.

Both support a ComputeHash method that takes a byte[] and returns a byte[].

Especially for passwords i would recommend using PasswordDeriveBytes (1.1)
or Rfc2898DeriveBytes (2.0).

have a look at them in the docs - if you have further questions - feel free
to ask.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top