Hashing isn’t encryption. Hashing is simply a method of converting any message of an arbitrary size to a fixed-length, deterministic outcome. Necessarily, hashing destroys information, meaning that any given hash actually represents and infinite number of possible inputs. So it is impossible to “reverse” a hash because you have no way of knowing whatever you get was the correct original image.
For your second question, public keys are used in a form of encryption known as asymmetric encryption. They rely on mathematical functions that are easy to perform one way, but not in reverse. The most common example is multiplication and factorization. Computers can easily multiply two numbers together, but if you give it a number and ask it to factorize it, there are currently no efficient algorithms to do it. Given our current understanding of math and available computing power, and the sizes of the numbers in question, you are better off just making random guesses.
Latest Answers