Crypthography helo

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alen Guroviæ

    #1

    Crypthography helo

    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.Defaul t.GetBytes(x_st r)

    Dim x_hash_code As HashAlgorithm = HashAlgorithm.C reate("MD5")

    Dim x_hash_message( ) As Byte = x_hash_code.Com puteHash(x_mess age_data)

    Dim x As Byte

    For Each x In x_hash_message

    Console.Write(x )

    Next

    Console.ReadLin e()

    End Sub


  • Jon Skeet [C# MVP]

    #2
    Re: Crypthography helo

    Alen Guroviæ <ivana.gurovic@ zg.htnet.hr> wrote:[color=blue]
    > 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[/color]

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

    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    • Nick Malik

      #3
      Re: Crypthography helo

      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

      "Alen Guroviæ" <ivana.gurovic@ zg.htnet.hr> wrote in message
      news:cgsucf$htc $1@ls219.htnet. hr...[color=blue]
      > 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.Defaul t.GetBytes(x_st r)
      >
      > Dim x_hash_code As HashAlgorithm = HashAlgorithm.C reate("MD5")
      >
      > Dim x_hash_message( ) As Byte = x_hash_code.Com puteHash(x_mess age_data)
      >
      > Dim x As Byte
      >
      > For Each x In x_hash_message
      >
      > Console.Write(x )
      >
      > Next
      >
      > Console.ReadLin e()
      >
      > End Sub
      >
      >[/color]


      Comment

      Working...