SHA256

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

Hi,
Where can I find a short and simple example of how to use SHA256
encryption algorithm in vb.net ? I've heard it is possible, but SHA256
doesn't give much result in MSDN...

Thx
 
Cor,
Never heard of this place.. :)))
I was actually going to use SHA512, as I got it working. I found it
pretty straightforward to use it in fact. But maybe you have arguments
strong enough to convince me using this Rijndael algorithm(how the hell
do you pronounce this???) In which way is it better than SHA512 ? The
purpose of my encryption is for Password encryption.

Regards
 
Actually after reading a bit more about it, it's not what i want as
Rijndael encrypted password can be decrypted as well using a key. I
don't want to be able to read that password again, and once encrypted
it should remain encrypted.
I'll stick with SHA512 :)

Thx
 
:
: Hi,
:
: Where can I find a short and simple example of how to use
: SHA256 encryption algorithm in vb.net ? I've heard it is
: possible, but SHA256 doesn't give much result in MSDN...
:
: Thx


I was experimenting with something similar once. I wanted a one-way
encrypted string to store the password in a database. Here is the
function I came up with:


--------------------------------------------
Imports System.Security.Cryptography
Imports System.Text

Protected Shared Function SHA256_Encrypt(Txt As String) As String

Dim sha As New SHA256Managed()
Dim ae As New ASCIIEncoding()
Dim Hash() As Byte = sha.ComputeHash(ae.GetBytes(Txt))
Dim sb As New StringBuilder(Hash.Length * 2)
Dim ndx As Integer

For ndx = 0 To Hash.Length - 1
sb.Append(Right("0" & Hex(Hash(ndx)), 2))
Next
Return sb.ToString

End Function
 
Sam said:
Cor,
Never heard of this place.. :)))
I was actually going to use SHA512, as I got it working. I found it
pretty straightforward to use it in fact. But maybe you have arguments
strong enough to convince me using this Rijndael algorithm(how the hell
do you pronounce this???) In which way is it better than SHA512 ? The
purpose of my encryption is for Password encryption.

Rain Dial (or something close).

It is now more commonly know as AES and replaces the DES and Triple DES
algorithms. It is also the new standard by the NSA (so if its strong
enough for the US Government, it should be strong enough for most -
providing you keep your key safe).
 
it's not encrypted then -- it's hashed and you should know that it is
(theoretically) possible to have a collision (i.e. something else
generates the same value) -- the odds are low with SHA512, however
 
Actually after reading a bit more about it, it's not what i want as
Rijndael encrypted password can be decrypted as well using a key. I
don't want to be able to read that password again, and once encrypted
it should remain encrypted.
I'll stick with SHA512 :)

Thx
Some confusion here, SHA512 is not encryption but its a hashing algorithm
Blow fish AES DES and Triple DES is an encrytion technique.
 

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

Back
Top