Skip to content

[Community Poll] Recommended length for secrets #7323

Answered by james-d-elliott
sarpuser asked this question in Q&A
Discussion options

You must be logged in to vote

As we use AES256-GCM for most of our encryption the maximum entropy is 256bits. After 64 characters you start to see diminishing returns, and at about 128 characters you'll see rapidly diminishing returns. Theoretically there would be no benefit beyond about 512 characters or would be so immeasurable that it doesn't matter.

For HMAC signatures it is basically the same.

The length of the secret has no effect on encryption time however as the AES258-GCM algorithm is fixed-size. Thus we digest any user input through the SHA256 hashing algorithm to get the correct key length of effectively random bytes (provided the input was also effectively random).

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by sarpuser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants