Skip to content

Commit

Permalink
Reduced security on ProtectedCache. (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Utar94 authored Oct 19, 2023
1 parent babfe93 commit 7f771eb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ internal record ProtectedCache<T>
public ProtectedCache(T value, string password)
{
_value = value;
_pbkdf2 = new(password);

/* NOTE(fpion): OWASP recommends 600000 iterations when using SHA-256. This is a security risk
* since the Portal uses 600000 iterations. The result is that Wishes is less secure than the
* Portal, which simplifies the job of an attack who would like to try keys. */
_pbkdf2 = new(password, iterations: 10000);
}

public T? GetValue(string password) => _pbkdf2.IsMatch(password) ? _value : default;
Expand Down

0 comments on commit 7f771eb

Please sign in to comment.