-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use a shared salt instead of an empty one
- Loading branch information
1 parent
e6004fd
commit e67adad
Showing
7 changed files
with
69 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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
14 changes: 14 additions & 0 deletions
14
packages/profile-sync-controller/src/shared/encryption/constants.ts
This file contains 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Nonce/Key Sizes | ||
export const ALGORITHM_NONCE_SIZE = 12; // 12 bytes | ||
export const ALGORITHM_KEY_SIZE = 16; // 16 bytes | ||
|
||
// Scrypt settings | ||
// see: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#scrypt | ||
export const SCRYPT_SALT_SIZE = 16; // 16 bytes | ||
export const SCRYPT_N = 2 ** 17; // CPU/memory cost parameter (must be a power of 2, > 1) | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
export const SCRYPT_r = 8; // Block size parameter | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
export const SCRYPT_p = 1; // Parallelization parameter | ||
|
||
export const SHARED_SALT = new Uint8Array([...Array(SCRYPT_SALT_SIZE).keys()]); |
This file contains 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