@getanthill/sec
TypeScript icon, indicating that this package has built-in type declarations

0.7.0 • Public • Published

getanthill Security Layer

pipeline Quality Gate Status

Coverage Vulnerabilities Security Rating

Getting Started

First, you need install the package:

npm install -S @getanthill/sec

Then, your client can follow the steps to register or signin a user to your app, then activate MFA validation.

// 1. Signin part:
const tokens = auth.getTokens(email, password);

// 2. MFA Setup part: (only on registration)
// Master key generation #keep-it-secret-keep-it-safe
const masterKey = otp.generateMasterKey();
// Secret key generation from Master key
const secretKey = otp.generateSecretFromMaster(masterKey);

// Validate MFA:
const isValid = otp.verify('123456', secretKey);

// Create the store:
const store = new Store(tokens.encryption, secretKey);

// Manage your data as always:
store.data = { hello: 'world' }; // Always encrypted data

Roadmap

/@getanthill/sec/

    Package Sidebar

    Install

    npm i @getanthill/sec

    Weekly Downloads

    647

    Version

    0.7.0

    License

    MIT

    Unpacked Size

    570 kB

    Total Files

    59

    Last publish

    Collaborators

    • jeremylvln-teale
    • charujanthavendran
    • charlelieboussaud
    • gilles.rasigade