Closed starsoccer closed 2 months ago
I believe this is a limitation with bcrypt's 'GenerateFromPassword' function which has a max limit of 72 bits.
From the docs it states: ''' GenerateFromPassword does not accept passwords longer than 72 bytes, which is the longest password bcrypt will operate on.'''
May be worth reviewing something like argon2id to allow longer passwords?
Other reading:
Bcrypt is outdated
OWASP Password Storage Cheat Sheet recommends
Argon2id is a no-brainer today (well, until the next best solutions arrive :)) and has a native implementation in Go
Note: I would not say that this issue is a "bug", but rather an improvement (this is to address the bug
label
Well if changing to not use bcrypt is not an option, another option is to just hash the password before passing to bcrypt and then using that hash as the actual input. This seems to be common too.
Describe the bug
It seems currently passwords are limited to 72 bytes for no clear reason. Instead passwords of any length should be allowed or atleast 128+
Steps to reproduce
The version of Memos you're using.
stable
Screenshots or additional context
No response