Hash Function is a function which has a huge role in making a System Secure as it converts normal data given to it as an irregular value of fixed length. We can imagine it to be a Shaker in our homes.
When we put data into this function it outputs an irregular value. The Irregular value it outputs is known as “Hash Value”.Hash Values are simply number but are often written in Hexadecimal. Computers manage values as Binary. Hash value is also a data and are often managed in Binary.
Whirlpool Hash Function
Whirlpool is a cryptographic hash function created by Vincent Rijmen and Paulo S.L.M. Barreto. It was first published in 2000 and revised in 2001 and 2003. It was derived form square and Advanced Encryption Standard. It is a block cipher hash function and designed after square block cipher. It takes less than
2^256 bits length input and convert it in 512 bit hash. The first version of whirlpool is called Whirlpool-0 and changed to Whirlpool-T after it’s first revision in 2001 . In this version the S-box is changed and become easier to use in hardware. In 2002 a vulnerability was founded in the Whirlpool-0’s diffusion matrix which was removed by changing the matrix and the name was also changed from Whirlpool-T to Whirlpool.
Every block cipher in whirlpool is a 8*8 matrix. The state of the function changes in ever round by using four operations:
|Mix Rows(MR)||It is a right multiplication of each row by an 8*8 matrix.|
|Substitute Bytes(SB)||It is a simple table lookup and gives nonlinear mapping.|
|Add Round Key(AK)||In this the 512 bits of the round key is goes through XOR with 512 bit of current state.|
|Shift Columns(SC)||In this except the first column of current state are cyclically downward shifted.|
Hash Value is calculated by using the formula:
State = MR*AK*SC*SB(State)
Install whirlpool library using
pip install whirlpool
The hashed value is
The hashed value is
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- RIPEMD Hash Function
- MD5 hash in Python
- Generating hash id's using uuid3() and uuid5() in Python
- Python | hash() method
- Python 3.6 dictionary implementation using hash tables
- Python Program to print hollow half diamond hash pattern
- Full domain Hashing with variable Hash size in Python
- Python - Call function from another function
- Wand function() function in Python
- Returning a function from a function - Python
- wxPython - GetField() function function in wx.StatusBar
- How to write an empty function in Python - pass statement?
- Function Decorators in Python | Set 1 (Introduction)
- Vulnerability in input() function – Python 2.x
- Function Annotations in Python
- Sorted() function in Python
- Ways to sort list of dictionaries by values in Python - Using lambda function
- Python Numbers | choice() function
- Python | askopenfile() function in Tkinter
- Python | Binding function in Tkinter
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.