How to use the fs-json-store-encryption-adapter.EncryptionAdapter function in fs-json-store-encryption-adapter

To help you get started, we’ve selected a few fs-json-store-encryption-adapter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vladimiry / ElectronMail / src / electron-main / database / serialization.ts View on Github external
constructor(input: { key: Buffer, preset: EncryptionAdapterBundle.KeyBasedPreset }) {"constructor()");

        const encryptionAdapter = new EncryptionAdapterBundle.EncryptionAdapter(input); = async (data: Buffer) => {
  `read() buffer.length: ${data.length}`);

            const {header: {serialization}} = persistencePartsUtil.split(data);
            const decryptedData = await;

            if (serialization && serialization.type === "msgpack") {
                this.logger.verbose(`"msgpack.decode" start`);
                const decoded = msgpack.decode(decryptedData) as FsDb;
                this.logger.verbose(`"msgpack.decode" end`);
                return decoded;

            const readableStream = bufferToStream(decryptedData);
github vladimiry / ElectronMail / src / electron-main / util.ts View on Github external
export async function buildSettingsAdapter(
    {configStore}: Context,
    password: string,
): Promise {
    return new EncryptionAdapter(
        {password, preset: (await configStore.readExisting()).encryptionPreset},
        {keyDerivationCache: true, keyDerivationCacheLimit: 3},


Encryption adapter for the "fs-json-store" module

Latest version published 2 years ago

Package Health Score

42 / 100
Full package analysis