Crypthography helo

  • Thread starter Thread starter Alen Guroviæ
  • Start date Start date
A

Alen Guroviæ

hello people
here is example how to hash something
I want to set key for that but i don't know how??
Code works but how can i put secret key code and after that decrypt

sorry for my english :)
Sub Main()

Dim x_str As String = "Some text"

Dim x_message_data() As Byte = Encoding.Default.GetBytes(x_str)

Dim x_hash_code As HashAlgorithm = HashAlgorithm.Create("MD5")

Dim x_hash_message() As Byte = x_hash_code.ComputeHash(x_message_data)

Dim x As Byte

For Each x In x_hash_message

Console.Write(x)

Next

Console.ReadLine()

End Sub
 
Alen Guroviæ said:
here is example how to hash something
I want to set key for that but i don't know how??
Code works but how can i put secret key code and after that decrypt

Hash algorithms don't work that way - they're one way, not two way. You
don't decrypt the results.
 
Hello Alen,

You've asked this same question in three threads on two newsgroups with
different answers each time. Are you understanding the answers?

Creating a hash is not the same as encrypting. Hash algorithms are used for
non-repudiation (aka "signatures"), not for hiding information from prying
eyes.

Do not use a hashing algorithm. Use a private-key encryption algorithm like
TripleDES or AES.

--- Nick
 
Back
Top