Questions tagged [keccak]

A cryptographic hash algorithm which uses a sponge construction. Use this tag for questions which relate to the use and implementation of the Keccak sponge function family in general. For questions which relate specifically to the SHA-3 family of hash functions, use the sha-3 tag instead. SHA-3 is powered by Keccak, but the two terms are not the same.

Keccak is a cryptographic hash algorithm which uses a sponge construction. An input message is "absorbed" into the sponge state, and then the hash result is "squeezed" out of the sponge state. The state is subjected to permutations after each block of data has been read into and out of the sponge. By repeatedly squeezing the sponge, Keccak allows output of an arbitrary length.

Details of the algorithm can be found at the Keccak sponge function family homepage.

Keccak was submitted as a candidate for the NIST (National Institute of Standards and Technology) SHA-3 Competition, and was selected as the winner in October of 2012.

Keccak powers the SHA-3 family of hash functions, but SHA-3 is just a subset of the possible Keccak applications. It is important not to confuse the two terms Keccak and SHA-3. While SHA-3 specifies exact settings for each of its functions, the Keccak sponge family permits a large variety of configurations. The parameters which define a Keccak sponge construction are:

bitrate: the maximum number of bits which can be absorbed or squeezed before the state will be permuted.

capacity: the number of bits within the sponge state which are not directly modified by an absorption and not directly read by a squeeze, but which do play a part in the permutation of the state.

domain suffix: an optional sequence of bits which will be appended to the end of the original message, before padding is applied. The domain suffix allows differentiation between different Keccak applications (such as SHA3, SHAKE, RawSHAKE, etc).

output length: the length in bits of the hash result which will be generated.

The sum of the bitrate and the capacity give the "width" of the permutation state, and this width must be one of: 25, 50, 100, 200, 400, 800, 1600. The bitrate, capacity, and output length must each be greater than zero. Beyond that, Keccak is very flexible.

66 questions
0
votes
1 answer

make: *** No rule to make target 'generic64/libkeccak.a'

I downloaded some post quantum algorithms from NIST and tested them. Some codes need to use Keccak package, so I downloaded it. When I tried to "make generic64/libkeccak.a", I got an error message: make: *** No rule to make target…
0
votes
0 answers

Keccak-f Round constants Hex to binary is not a single bit

I'm implementing the Keccak-f ι step using javascript, the formula is as follow: # ι step A[0,0] = A[0,0] xor RC RC is an array of round constants in Hex and A[0,0] is a single bit in Binary The problem occurs on the following line A[0,0] = 0,…
Ivy Lyu
  • 15
  • 4
0
votes
1 answer

Keccak on react-native

I trying the ethereumjs-util in react-native , first ethUtil.privateToPublic work fine, then when use ethUtil.publicToAddress will getting this error TypeError: Cannot read property 'call' of undefined , I trace the error actually come from…
FeelRightz
  • 2,777
  • 2
  • 38
  • 73
0
votes
1 answer

Get correct Kekkak256 of an uploaded file in NodeJS

I am using keccak256 npm module to calculate the hash of an uploaded file. I verify the correctness and I see that the given hash does not correspond to the ones compared on some online hash calculators (such as: this or this or this ). The code I…
shogitai
  • 1,823
  • 1
  • 23
  • 50
0
votes
2 answers

How to get keccak256 hash in Solidity

I just got started with solidity, I have used truffle to compile and deploy the code to ganache, everything works as I expect, I can call the other functions in the code, but there are certain functions that only the owner can access, the code…
user9109285
0
votes
1 answer

Why sha3 in different python's modules gives different result?

I am realized that default hashlib.sha3_256 hasher does not calculates hashes like other solution, for instance, other python's modules. Below, for instance, I comparing hashlib and sha3 implementation of sha2_256 algorithm on Python…
Alex G.P.
  • 9,609
  • 6
  • 46
  • 81
0
votes
1 answer

Using Keccak Library in a C++ project

I am trying to use the Keccak Code Package in a project, especially the SHAKE128 extendable ouput hash function. I have followed their instructions to compile the library, and I have obtained two folders, one is libkeccak.a and is full of .o files,…
Raphael D.
  • 778
  • 2
  • 7
  • 18
0
votes
1 answer

Keccak SHA-3-512: Missed a detail

I just want to use SHA-3-512. So I used the KeccakCodePackage. I read the specification and used them.To check my result I use the following Online-Hash-Website. My result for "Some Data"…
Citrullin
  • 2,269
  • 14
  • 29
0
votes
0 answers

Best way to select an array value using a hash? Same value must be selected each time for the same hash

Say I have a regular Javascript array of around 500 words ie var words = ['apple', 'banana', cherry'... and a Keccak256 (SHA-3) hash that is generated then stored. I need to use the hash to select a value in the array. Every time the same hash is…
Chris
  • 68
  • 8
0
votes
1 answer

Keccak output wrong

I am trying to run Keccak 224 with this official library. Unfortunately I get a wrong hash from the function. I doubt that it is the fault of the library, rather I do something wrong. This is what I am trying: unsigned char input[] = "abc",…
Peter Winzer
  • 165
  • 7
0
votes
1 answer

PRNG for hash-based authentication

I'm trying to implement hash-based authentication using the 'tree-chaining' structure described in http://www.springer.com/us/book/9783540887010 or https://www.imperialviolet.org/2013/07/18/hashsig.html For this I'd need a (deterministic) PRNG…
Kris
  • 61
  • 3
0
votes
1 answer

Gas apple syntax error

I try to convert this assembly file : https://github.com/gvanas/KeccakCodePackage/blob/master/SnP/KeccakF-1600/OptimizedAsmX86-64/KeccakF-1600-x86-64-gas.s into apple syntax. (old syntax) I replace .eq by #define, .global by .globl, remove .type,…
Stephane
  • 391
  • 1
  • 2
  • 13
0
votes
1 answer

I have no idea what could possibly be bugged

So I'm trying to write my own "keccaksum" program, except running for i in {1..50}; do ./keccaksum 256 test.o; done outputs 4d4cc035e544cd4837b45550094dd3c419e380af3b0c74109c00053c7ed82040 test.o most of the time…
incertia
  • 11
  • 5
0
votes
1 answer

CryptoJS SHA3 does not pass any Keccak test vectors?

I am trying to get CryptoJS to pass some known answer tests for Keccak, however it appears to be giving me the incorrect digest hashes. Click the "Known-answer and Monte Carlo test results" link on the Keccak downloads page, or go straight to the…
0
votes
1 answer

convert from byte to word

after spending quite some time trying to understand the function of this method, I still couldn't figure what does it do. As I understand, stateAsBytes should contain hex strings like "\xA1\X32\X89\XB2", what does stateAsWords[i%5][i/5] |= (unsigned…
Blake
  • 7,367
  • 19
  • 54
  • 80