Cryptography series: sponge function



Sponge function is a function used in cryptography. It receives an input of a certain length, and then outputs an output of a certain length, which contains a finite number of internal states.

Because of the powerful function of the sponge function, it can be used to model and implement many cryptographic primitives, including password hashing, message authentication code, generating mask, stream password, pseudo-random number generator, etc.

This article will explain the structure of the sponge function.

Structure of Sponge Function

Let's first look at the structure diagram of a sponge function:

This function is divided into two parts, the left part is called the absorption part, and the right part is called the output part. One sucks and the other sucks, like a sponge, so it is called a sponge function.

P represents the input string, and Z represents the output string.

A sponge function consists of three parts, namely state, function f and padding function.

The state is the r+c part of the above figure, r is called Bitrate , and c is called Capacity .

P is divided into n parts, and each part will be XORed with Bitrate. If the length of P is not an integer multiple of Bitrate, it needs to be filled with the Pad function.

In each round, the result of the XOR operation between Bitrate and P is taken as the latest Bitrate, and then a new state is generated, and then this state is replaced by f(state).

The function f is a mapping from n {0,1} to n {0,1}.

It goes on one round after another until all P's are involved in the calculation.

The output part is to perform the f operation on the final generated state, and each operation takes the Bitrate part as the output to obtain the final output.

Sponge function application

Because of the excellent characteristics of sponge function, it is used in many ways. For example, the implementation algorithm Keccak of SHA-3 is the sponge function used.

By replacing f and multiple rounds of permutation, the sponge function can generate a very secure cryptographic algorithm, so it has been widely used.

This article has been included in

The most popular interpretation, the most profound dry goods, the most concise tutorial, and many tips you don't know are waiting for you to discover!

Welcome to pay attention to my official account: "Program those things", know technology, know you better!

阅读 290

Spring,区块链,密码学,分布式,多线程等教程 欢迎关注我的公众号:程序那些事,更多精彩等着您!


734 声望
409 粉丝
0 条评论


734 声望
409 粉丝