Question Making your own hash function

Joined
Jun 11, 2016
Messages
16
Location
Sweden
Programming Experience
1-3
In my last thread i had a "algorithm" that i had created using pure vb.net, but the only thing i did there was combining multiple algorithms together. I wanna create my own instead. I have tested this piece of code:
Dim byted As Byte() = System.Text.Encoding.UTF8.GetBytes(sPassword)
Dim sb As New StringBuilder
For Each b As Byte In byted
sb.Append(b.ToString("x2").ToUpper)
Next
Return sb.ToString()
and everyone time i change something in the str the bytes also change, now can i take this as my advantage?, Because when i get the md5 hash of a string i also use this piece of code but with the md5cryptoserviceprovider.
 
The idea behind hashing is that a small change in the input generates a large and ostensibly unpredictable change in the output. Your code doesn't do that, thus it's a not a good algorithm. Do some tests with existing hash functions and see what happens to the output when you change one character or byte in your input. Your algorithm produces a direct relationship between characters in the output and characters in the input so it's useless for security because it would extremely easy for anyone to reverse engineer.
 
Back
Top