Posted On 29.06.1951
Anyone with an interest in bitcoin will have heard the phrase ‘cryptographic hash function’ at some time or other. But what exactly does it mean, bitcoin commands how is it connected to cryptocurrency?
Hash functions are an essential part of, not only of the bitcoin protocol, but of information security as a whole. In the following article we’ll take a look at some simple examples of how they work, with a simple demonstration, too. In the abstract, a hash function is a mathematical process that takes input data of any size, performs an operation on it, and returns output data of a fixed size. A common use of this kind of hash function is to store passwords.
When you create a user account with any web service which requires a password, the password is run through a hash function, and the hash digest of the message is stored. This means that if a hacker is able to access the database containing the stored hashes, they will not be able to immediately compromise all user accounts because there is no easy way to find the password which produced any given hash. Simple hash functions in Python You can experiment with hash values using Python, a programming language installed on Mac and Linux operating systems by default. This tutorial will assume you’re using some version of either OS X or Linux, as using Python on Windows is more complicated. First, open a terminal, type python and hit ENTER. This will put you into the Python REPL, an environment where you can try out Python commands directly as opposed to writing a programme in a separate file. And press ENTER to see the hash digest of that string.