Skip to content

Salt size #8

@hakavlad

Description

@hakavlad

Always use a random 128-bit or 256-bit salt

The typical salt size is 128 bits, but 256-bit is also fine for further reassurance that the salt won’t repeat.

generate 256-bit random values for IDs, salts, etc: this reduces the chances of a collision into the realm of not having anything to worry about. By contrast, random 128-bit values will collide after 2^64 due to the birthday paradox.

I just want to express my humble disagreement. 128 bits is a lot, even taking into account the birthday paradox. Salt is not the kind of thing that gets bruteforced out on a quantum computer. Making salt larger than 128 bits is just as pointless as making symmetric keys larger than 256 bits. I agree with the creators of primitives who limit the salt size to 128 bits.

Just a reminder that

2^64 = 1.8e19 // 18 quintillions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions