Skip to main content
21 votes

Is there a standard, or widely accepted convention, for magic constants in crypto software?

If you just need a constant to begin your algorithm, and the value of that constant isn't important, why not have a widely known convention to always use the digits of Pi or Phi or other well known ...
axapaxa's user avatar
  • 2,980
13 votes

Is there a standard, or widely accepted convention, for magic constants in crypto software?

If you just need a constant to begin your algorithm, and the value of that constant isn't important, why not have a widely known convention to always use the digits of Pi or Phi or other well known ...
Ella Rose's user avatar
  • 19.8k
10 votes

Is there a standard, or widely accepted convention, for magic constants in crypto software?

Ostensibly, there is a convention for constants. It's vanity. The criteria for such a constant is to disassociate the number from any possible influence it might have on the algorithm. Yes, high ...
Paul Uszak's user avatar
  • 15.7k
8 votes
Accepted

How constant value 0x63 in affine transformation is chosen or generated while AES Substitution Box is formed?

According to the Rijndael AES proposal (emphasis mine): We have chosen an affine mapping that has a very simple description per se, but a complicated algebraic expression if combined with the ‘...
Ilmari Karonen's user avatar
7 votes
Accepted

Origin of the SHA-224 initial hash value?

The SHA-224 initial values are the second 32 bits of the fractional parts of the square roots of the 9th through 16th primes (namely, 23 through 53), or in other words, $\lfloor 2^{64} \sqrt{p} \...
poncho's user avatar
  • 150k
4 votes
Accepted

How complex must round constants be to resist slide attacks?

It depends on the actual block cipher and is quite an open problem. For example, SCREAM, iSCREAM and Midori64 use such key schedule (i.e., its absense) with sparse round constants. They were broken ...
Fractalice's user avatar
  • 3,097
4 votes
Accepted

Amateur question: Constant two way cryptography

I don't know why do they change like this every time i run the exact same piece of code again and again. What you are actually doing here (under the hood) is most likely using a cryptographic system ...
SEJPM's user avatar
  • 46.3k
4 votes

Amateur question: Constant two way cryptography

Two reasons why cryptographic algorithm often behaves as you observe (non-deterministically): When the objective is to encipher some secret, it is necessary for security in many scenario. Otherwise, ...
fgrieu's user avatar
  • 144k
3 votes

Using non-standard constants for SHA-256

Those are "nothing up my sleeve" numbers, their values aren't central to the security of the algorithm. Nevertheless an intent to arbitrarily choose different and thus incompatible values probably ...
tialaramex's user avatar
3 votes

How is the MD2 hash function S-table constructed from Pi?

Based on mikeazo's pseudocode, here's a fully working program in Python 3 that will generate the S-table: ...
ryanc's user avatar
  • 171
3 votes
Accepted

Early propagation of carries in the BLAKE hash function

This is already covered by Ella's response, but in short the added nonlinearity at the start buys you very little in terms of security, compared to its cost in number of operations. It would be more ...
Samuel Neves's user avatar
  • 12.8k
3 votes

Nothing-up-my-sleeve numbers standard

A (probably weak) reason not to use a standard is that some nothing-up-my-sleeve numbers may serve some sort of purpose. As an example, you cannot change Salsa20's constants to anything, it must be ...
Modal Nest's user avatar
  • 1,463
3 votes

Explanation of the tables found in Kyber round1 code?

As you can see in the comment of the code, the tables have been computed using Pari/GP, which mean you could regenerate them using the same code. The details can be stitched together from this Kyber ...
Lery's user avatar
  • 7,759
2 votes

Nothing-up-my-sleeve numbers standard

The constants in cryptography that can be chosen arbitrarily are typically not likely to be good candidates for backdooring. The constants in cryptography that can be backdoored usually have ...
forest's user avatar
  • 15.4k
2 votes
Accepted

Where do the constants for SHA-1/2/3 come from?

Regarding the IVs and round constants of hash functions... The question for SHA1 and SHA2 families have already been answered. Rotational constants were chosen by the designers to make the hash ...
Richie Frame's user avatar
  • 13.2k
2 votes

Early propagation of carries in the BLAKE hash function

What are the benefits of guaranteeing early propagation of carries Addition without carries is equivalent to XOR. Consider the addition of the following two bit strings performed modulo $2^8$: ...
Ella Rose's user avatar
  • 19.8k

Only top scored, non community-wiki answers of a minimum length are eligible