WallShadow wrote:Welcome to HTS barney,
First off, a hash algorithm isn't an encryption algorithm. An encryption algorithm indicates a corresponding decryption algorithm, while a hash algorithm is not supposed to have any decryption algorithm or else it is weak.
Second, if you want a good hash algorithm, make sure it generates large, and very different keys. If you input a string once and then once more with just one letter different, it should give you radically different results. It should also have no collision of hashes (i.e. there shouldn't be 2 different strings with the same hash). As for operations, XOR is good, but it is easily reversible. An operation that I see used in nearly all good hashes these days is addition modulo 256.
When you're finished, feel free to post it up for review.
- WallShadow <3
not_essence2 wrote:Oh God. You're going to want a calculator for that.
Here's how modular addition (modulo) works:
For example, in normally taught math, 2+5=7.
However, in modulo 7, 2+5=0.
Here's how it works: x+y=z (modulo w). You first add x and y to get what z is. Then, divide it by w, and get the remainder. That's what the sum is. So for example, my previous example: 2+5 (modulo 7)
Would equal: 7 (modulo 7)
7/7=1 Remainder 0
So therefore 2+5 (modulo 7) equals 0.
The real concept, however, is that modulo 7 (often abbreviated as mod, not modulo) is basically like a clock with the numbers 0-6. When you add 2 numbers, it goes around the clock: 2+5 is starting from 2 on the clock then going 5 forward (3,4,5,6,7). When you get to 7, you basically went all around the clock, and so you really go from 6 to 0, not 6 to 7. So therefore 2+5 (modulo 7) is 0.
This is also why modular addition is used in hashes so much. If you get the modulo 7 sum of something like 2+5, which is 0, the original operation could've been 2+5, 6+1, 2+3+4+5, etc. If those numbers are the numerical values of the message you're hashing, it would be impossible to get the original message as there are an infinite amount of combinations, which is why they use modular addition in hashes so much.
However, it should obviously be more complicated than a simple modulo, as there would be WAY too many colliding hashes.
barneystinson19 wrote:WallShadow wrote:Welcome to HTS barney,
First off, a hash algorithm isn't an encryption algorithm. An encryption algorithm indicates a corresponding decryption algorithm, while a hash algorithm is not supposed to have any decryption algorithm or else it is weak.
Second, if you want a good hash algorithm, make sure it generates large, and very different keys. If you input a string once and then once more with just one letter different, it should give you radically different results. It should also have no collision of hashes (i.e. there shouldn't be 2 different strings with the same hash). As for operations, XOR is good, but it is easily reversible. An operation that I see used in nearly all good hashes these days is addition modulo 256.
When you're finished, feel free to post it up for review.
- WallShadow <3
Thank you and thanks for your suggestion
Sorry for my mistake It's a hash algorithm
How addition modulo 256 works exactly? I'm searching about it but I can't understand very well because my english is my foreign language. Can you explain it simply please? Thank you Btw I'll post it when it's finish
agent_232 wrote:
...
I have a unique algorithm. So far no one has cracked the code. Would anyone like to see if they can crack it?
Users browsing this forum: No registered users and 0 guests