diff --git a/src/importers/bitwardenJsonImporter.ts b/src/importers/bitwardenJsonImporter.ts index 13c26b6c0d..195708c082 100644 --- a/src/importers/bitwardenJsonImporter.ts +++ b/src/importers/bitwardenJsonImporter.ts @@ -38,8 +38,9 @@ export class BitwardenJsonImporter extends BaseImporter implements Importer { private async parseEncrypted() { if (this.results.encKeyValidation_DO_NOT_EDIT != null) { + const orgKey = await this.cryptoService.getOrgKey(this.organizationId); const encKeyValidation = new EncString(this.results.encKeyValidation_DO_NOT_EDIT); - const encKeyValidationDecrypt = await this.cryptoService.decryptToUtf8(encKeyValidation); + const encKeyValidationDecrypt = await this.cryptoService.decryptToUtf8(encKeyValidation, orgKey); if (encKeyValidationDecrypt === null) { this.result.success = false; this.result.errorMessage = this.i18nService.t('importEncKeyError'); diff --git a/src/services/export.service.ts b/src/services/export.service.ts index a8b2071526..7afb69881f 100644 --- a/src/services/export.service.ts +++ b/src/services/export.service.ts @@ -289,8 +289,12 @@ export class ExportService implements ExportServiceAbstraction { await Promise.all(promises); + const orgKey = await this.cryptoService.getOrgKey(organizationId); + const encKeyValidation = await this.cryptoService.encrypt(Utils.newGuid(), orgKey); + const jsonDoc: any = { encrypted: true, + encKeyValidation_DO_NOT_EDIT: encKeyValidation.encryptedString, collections: [], items: [], };