From dbb0bbb91c6e80f7331fdd5e89d9e02c889f2241 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 18 Jan 2023 13:20:14 -0500 Subject: [PATCH] adjust default kdf iterations to 350k (#4482) * adjust default kdf iterations to 350k * update test --- libs/common/spec/services/export.service.spec.ts | 4 ++-- libs/common/src/enums/kdfType.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/common/spec/services/export.service.spec.ts b/libs/common/spec/services/export.service.spec.ts index 92dbd16883..78abf47a7e 100644 --- a/libs/common/spec/services/export.service.spec.ts +++ b/libs/common/spec/services/export.service.spec.ts @@ -7,7 +7,7 @@ import { CryptoService } from "@bitwarden/common/abstractions/crypto.service"; import { CryptoFunctionService } from "@bitwarden/common/abstractions/cryptoFunction.service"; import { FolderService } from "@bitwarden/common/abstractions/folder/folder.service.abstraction"; import { CipherType } from "@bitwarden/common/enums/cipherType"; -import { KdfType } from "@bitwarden/common/enums/kdfType"; +import { KdfType, DEFAULT_KDF_ITERATIONS } from "@bitwarden/common/enums/kdfType"; import { Utils } from "@bitwarden/common/misc/utils"; import { Cipher } from "@bitwarden/common/models/domain/cipher"; import { EncString } from "@bitwarden/common/models/domain/enc-string"; @@ -232,7 +232,7 @@ describe("ExportService", () => { }); it("specifies kdfIterations", () => { - expect(exportObject.kdfIterations).toEqual(100000); + expect(exportObject.kdfIterations).toEqual(DEFAULT_KDF_ITERATIONS); }); it("has kdfType", () => { diff --git a/libs/common/src/enums/kdfType.ts b/libs/common/src/enums/kdfType.ts index cc7fa7e0dc..488010b1d2 100644 --- a/libs/common/src/enums/kdfType.ts +++ b/libs/common/src/enums/kdfType.ts @@ -3,5 +3,5 @@ export enum KdfType { } export const DEFAULT_KDF_TYPE = KdfType.PBKDF2_SHA256; -export const DEFAULT_KDF_ITERATIONS = 100000; +export const DEFAULT_KDF_ITERATIONS = 350000; export const SEND_KDF_ITERATIONS = 100000;