In this article, I will be covering <strong>One-Way Functions.</strong>

Company Mentioned

This is the first article of the series that I have planned to write explaining the Cryptography behind Blockchain.

In this article, I will be covering One-Way Functions.

To understand the need for one-way functions, let me first help you understand Two-Way functions.

Two-Way Functions

Let us assume that we have a function f(x)=y. Whenever we give input as “x”, we get an output “y”.

Now let us look at the following table:

If we observe the above Input and Output values, by close observation we find that output is always the square of the input, i.e y=x*x. Or f(x)=x*x.

Now, let us say that the function generates an output as “121”. Since I know the function, I can easily tell that the input would have been “11”. Functions wherein we can determine the input with the help of its output are known as Two-way functions.

As much as we have enjoyed cracking this function we should realize that if we incorporate them in the Systems or Application Design, any hacker can crack open the application with a simple brute force attack.

This particular vulnerability of Two-way functions led to the adoption of One-way functions.

One-Way Functions

Let us consider the SHA256 of the following numbers.

If you observe the above three outputs, they do not follow a pattern. Thus, there is no way we can identify the input of the function. When these functions are used in applications, it is not an easy task for a hacker to penetrate into the application. Such functions are known as One-Way Functions.

The following quote was my motivation to write this article:

“Technology is applied science. Science is the study of nature. Mathematics is the language of nature. Philosophy is the root of mathematics. All tightly interrelated.”~Naval Ravikant

In the upcoming articles of this series, I will be explaining Hashing Algorithms and how they are incorporated in Blockchain Design. Stay tuned for the updates! Thank you for reading my article.

If you have any questions, please feel free to send me anemail. You can also contact me viaLinkedin. You can also follow me onTwitter.

In order to get started with Blockchain read myarticlepublished onHackernoon