-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[PS-2251] Implement argon2 kdf #4468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e05752c
Implement argon2
quexten 2a937d0
Remove argon2 webassembly warning
quexten e3a5808
Replace magic numbers by enum
quexten c037c40
move packages
kspearrin fa59dea
cleanup call to argon2
kspearrin 03bf54f
update call to node argon2
kspearrin 5395062
Merge branch 'master' into feature/argon2-kdf
kspearrin 96dd369
don't need wasm-eval
kspearrin 9537c5c
revert config changes
kspearrin 2f55f93
Update libs/common/src/enums/kdfType.ts
kspearrin edea0f4
Update kdfType.ts
kspearrin dbca1e5
Merge branch 'master' into feature/argon2-kdf
kspearrin b2a22c2
apply DEFAULT_PBKDF2_ITERATIONS
kspearrin e3d92ea
checkIfWasmSupported
kspearrin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,41 +32,79 @@ <h1>{{ "encKeySettings" | i18n }}</h1> | |
> | ||
<i class="bwi bwi-question-circle" aria-hidden="true"></i> | ||
</a> | ||
<select id="kdf" name="Kdf" [(ngModel)]="kdf" class="form-control" required> | ||
<select | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need to remove this to a config PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. |
||
id="kdf" | ||
name="Kdf" | ||
[(ngModel)]="kdf" | ||
(ngModelChange)="onChangeKdf($event)" | ||
class="form-control" | ||
required | ||
> | ||
<option *ngFor="let o of kdfOptions" [ngValue]="o.value">{{ o.name }}</option> | ||
</select> | ||
</div> | ||
</div> | ||
<div class="col-6"> | ||
<div class="form-group mb-0"> | ||
<label for="kdfIterations">{{ "kdfIterations" | i18n }}</label> | ||
<a | ||
class="ml-auto" | ||
href="https://bitwarden.com/help/what-encryption-is-used/#pbkdf2" | ||
target="_blank" | ||
rel="noopener" | ||
appA11yTitle="{{ 'learnMore' | i18n }}" | ||
> | ||
<i class="bwi bwi-question-circle" aria-hidden="true"></i> | ||
</a> | ||
<input | ||
id="kdfIterations" | ||
type="number" | ||
min="5000" | ||
max="2000000" | ||
name="KdfIterations" | ||
class="form-control" | ||
[(ngModel)]="kdfIterations" | ||
required | ||
/> | ||
<ng-container *ngIf="kdf == kdfType.PBKDF2_SHA256"> | ||
<label for="kdfIterations">{{ "kdfIterations" | i18n }}</label> | ||
<a | ||
class="ml-auto" | ||
href="https://bitwarden.com/help/what-encryption-is-used/#pbkdf2" | ||
target="_blank" | ||
rel="noopener" | ||
appA11yTitle="{{ 'learnMore' | i18n }}" | ||
> | ||
<i class="bwi bwi-question-circle" aria-hidden="true"></i> | ||
</a> | ||
<input | ||
id="kdfIterations" | ||
type="number" | ||
min="5000" | ||
max="2000000" | ||
name="KdfIterations" | ||
class="form-control" | ||
[(ngModel)]="kdfIterations" | ||
required | ||
/> | ||
</ng-container> | ||
<ng-container *ngIf="kdf == kdfType.Argon2id"> | ||
<label for="kdfIterations">KDF Iterations</label> | ||
<a | ||
class="ml-auto" | ||
href="https://bitwarden.com/help/what-encryption-is-used/#argon2" | ||
target="_blank" | ||
rel="noopener" | ||
appA11yTitle="{{ 'learnMore' | i18n }}" | ||
> | ||
<i class="bwi bwi-question-circle" aria-hidden="true"></i> | ||
</a> | ||
<input | ||
id="iterations" | ||
type="number" | ||
min="1" | ||
max="1024" | ||
name="Iterations" | ||
class="form-control mb-3" | ||
[(ngModel)]="kdfIterations" | ||
required | ||
/> | ||
</ng-container> | ||
</div> | ||
</div> | ||
<div class="col-12"> | ||
<div class="form-group"> | ||
<div class="small form-text text-muted"> | ||
<p>{{ "kdfIterationsDesc" | i18n: (recommendedKdfIterations | number) }}</p> | ||
<strong>{{ "warning" | i18n }}</strong | ||
>: {{ "kdfIterationsWarning" | i18n: (50000 | number) }} | ||
<ng-container *ngIf="kdf == kdfType.PBKDF2_SHA256"> | ||
<p>{{ "kdfIterationsDesc" | i18n: (recommendedPBKDF2Iterations | number) }}</p> | ||
<strong>{{ "warning" | i18n }}</strong | ||
>: {{ "kdfIterationsWarning" | i18n: (50000 | number) }} | ||
</ng-container> | ||
<ng-container *ngIf="kdf == kdfType.Argon2id"> | ||
<p> | ||
{{ "argon2MemoryDesc" | i18n }} | ||
</p> | ||
</ng-container> | ||
</div> | ||
</div> | ||
</div> | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
export enum KdfType { | ||
PBKDF2_SHA256 = 0, | ||
Argon2id = 1, | ||
} | ||
|
||
export const DEFAULT_ARGON2_MEMORY = 16; | ||
export const DEFAULT_ARGON2_PARALLELISM = 2; | ||
export const DEFAULT_ARGON2_ITERATIONS = 2; | ||
kspearrin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
export const DEFAULT_KDF_TYPE = KdfType.PBKDF2_SHA256; | ||
export const DEFAULT_KDF_ITERATIONS = 350000; | ||
export const DEFAULT_PBKDF2_ITERATIONS = 350000; | ||
export const SEND_KDF_ITERATIONS = 100000; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.