Skip to content

Commit

Permalink
Merge pull request #50 from danielberkompas/sha256-security
Browse files Browse the repository at this point in the history
πŸ”’ Use 600,000 iterations in PBKDF2 SHA256
  • Loading branch information
danielberkompas committed Apr 6, 2024
2 parents 43fa129 + a450aca commit 350d43f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/cloak_ecto/types/pbkdf2.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if Code.ensure_loaded?(:pbkdf2) do
config :my_app, MyApp.Hashed.PBKDF2,
algorithm: :sha256,
iterations: 10_000,
iterations: 600_000,
secret: "secret",
size: 64
Expand All @@ -57,7 +57,7 @@ if Code.ensure_loaded?(:pbkdf2) do
def init(config) do
config = Keyword.merge(config, [
algorithm: :sha256,
iterations: 10_000,
iterations: 600_000,
secret: System.get_env("PBKDF2_SECRET")
])
Expand Down Expand Up @@ -135,7 +135,7 @@ if Code.ensure_loaded?(:pbkdf2) do

@impl Cloak.Ecto.PBKDF2
def init(config) do
defaults = [algorithm: :sha256, iterations: 10_000, size: 32]
defaults = [algorithm: :sha256, iterations: 600_000, size: 32]

{:ok, defaults |> Keyword.merge(config)}
end
Expand Down

0 comments on commit 350d43f

Please sign in to comment.