Add AES-GCM encryption to your own JavaScript or TypeScript project. @lockisecurity/crypto-core uses the browser-native WebCrypto API with zero external dependencies — the same engine that powers the Locki extension.
$ npm install @lockisecurity/crypto-coreimport { decrypt, encrypt, generateAESKeyHex } from '@lockisecurity/crypto-core';
const key = await generateAESKeyHex(256);
const sealed = await encrypt('db-password', key); // "[LOCKI:v2:…]"
const plain = await decrypt(sealed, key);Generate cryptographically secure keys and encrypt or decrypt any string with AES-128-GCM or AES-256-GCM — the same algorithm used by Locki.
Built entirely on the WebCrypto API. No third-party cryptography libraries, no native bindings — just the runtime you already have.
Ships with complete type definitions. Works out of the box with TypeScript projects — no additional @types packages needed.
Encrypted output is fully compatible with the Locki extension format. Data encrypted in your app can be decrypted in Locki and vice versa.
Generate AES keys of any supported length directly in the browser or Node.js environment using the WebCrypto key generation API.