how does decryption differ from reversing a hash algorithm?

209 views

I am struggling to understand how one is fast enough to underly the entire internet and how the other is so slow as to be functionally impossible.

As an expansion, since the public key is known, how then is the encrypted message irreversible?

In: 4

8 Answers

Anonymous 0 Comments

Because cryptographic hash function uses a mathematical function that is a one-way function. That is easy in one direction but hard in the other. Easy mean fast for a computer to calculate, hard means it is slow for a computer to calculate.

Encryption does not include functions like that or more exactly it does not include them without you knowing part of the input that makes it simple to do. That information is derived from the encryption key. _

One example of that is multiplication and factoring. Taking two prime numbers the multiplying them is very easy to do. But finding what is the two prime factors of a number is not easy to do. You have to remember for things like public-key encryption were talking about products that can be 2048 bits that is 616 decimal digits.

The best way we know to find the factors is to test with all possible prime factors and see if it works out. This is an enormous number of possible prime numbers to test.

But if you have one of the prime numbers calculating the other with division is not hard at all. This is not exactly how the calculation is done in public-key encryption like RSA but it all boils down to finding prime factors of large numbers is hard,

https://en.wikipedia.org/wiki/RSA_(cryptosystem)

In a way, you can think of a hash function and the message is use to generate the encryption key, the message is then encrypted with that key and the key is forgotten. This is not how it is done but give some idea of the diffrence.

A hash function often includes the parts where multiple input can result in the same input.

Let’s say that we hash four-digit numbers by splitting them apart into two numbers and adding and using the two last digits. 5569 become 55+69= 124 =24. If you have 24 how do you go back to 5569? There are lots of other numbers that give 24 as the result 0024, 0123, 1014, 5668 etc So going backward results in multiple possible inputs.

The result is that the practical way to find the input that results in a specific hash value is to just test multiple inputs and find a message that results in that hash.

You are viewing 1 out of 8 answers, click here to view all answers.