Skip to content

Auth: Reduce bcrypt cost for faster login on small devices #3718

Closed

Description

@lastzero

As a user of a small device like a NAS or a Raspberry Pi, I would like the cost of the bcrypt password to be lower so that logging in does not take a very long time (or even timeout).

The default password cost (2^number of rounds) of most implementations is 11 and the current cost in PhotoPrism is 14, so we reduce it to 121, which is still more secure than what most other applications use:

Cost Iterations
8 256 iterations
9 512 iterations
10 1,024 iterations
11 2,048 iterations
12 4,096 iterations
13 8,192 iterations
14 16,384 iterations
15 32,768 iterations
16 65,536 iterations

Footnotes

  1. Developers can change this value in internal/entity/password.go to use a higher/lower cost in custom builds, depending on their needs. ↩

Activity

  1. self-assigned this
    on Sep 12, 2023
  2. moved this to Development 🐝 in Roadmap 🚀✨on Sep 12, 2023
  3. changed the title [-]Auth: Reduce bcrypt password cost for faster login on small devices[/-] [+]Auth: Reduce bcrypt cost for faster login on small devices[/+] on Sep 12, 2023
  4. moved this from Development 🐝 to Preview 🐳 in Roadmap 🚀✨on Sep 12, 2023
  5. added
    testedChanges have been tested successfully
    releasedAvailable in a stable release
    and removed
    please-testReady for manual testing & feedback
    on Sep 20, 2023
  6. moved this from Preview 🐳 to Released 🌈 in Roadmap 🚀✨on Sep 24, 2023
  7. maxime1992 commented on Oct 6, 2023

    @maxime1992

    I've seen this week that Laravel Php framework have advise people to increase the default (10 rounds) to 12. So having it to 12 here as well sounds sensible to me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

performancePerformance OptimizationreleasedAvailable in a stable releasesecurityImpact on server or browser securitytestedChanges have been tested successfully

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions