Skip to content

Conversation

@29decibel
Copy link

@29decibel 29decibel commented Jan 30, 2023

Based on PR and adopting ideas from Gitlab's PBKDF2 implementation.

Key change is to the Pbkdf2 encryptor class to build salt and stretches into the hash, same strategy with Bcrypt. So this change would allow us to change iterations count in the future without breaking existing hashed passwords using Pbkdf2

@29decibel 29decibel force-pushed the mike/pbkdf2 branch 5 times, most recently from eeceb56 to 72ea687 Compare January 30, 2023 17:37
@29decibel 29decibel marked this pull request as ready for review January 30, 2023 17:55
@29decibel 29decibel requested review from a team, f1sherman and tneems January 30, 2023 18:08
module Encryptors
# https://en.wikipedia.org/wiki/PBKDF2
# Adapted from https://gitlab.com/gitlab-org/gitlab/-/blob/373f088e755f678478b8dd1627fab908d2641b21/vendor/gems/devise-pbkdf2-encryptable/lib/devise/pbkdf2_encryptable/encryptors/pbkdf2_sha512.rb
class Pbkdf2 < Base
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my primary discomfort with this is the potential for a name with devise encryptable clash if/when the original PR gets merged. Maybe change the class name to something like Pbkdf2Hash?

@29decibel 29decibel closed this Feb 6, 2023
@29decibel
Copy link
Author

Close this in favor of #2

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants