@vocdoni/encryption
TypeScript icon, indicating that this package has built-in type declarations

1.14.1 • Public • Published

@vocdoni/encryption

@vocdoni/encryption contains encryption helpers for the dvote-js library

Installation

Use npm to install @vocdoni/encryption.

npm install @vocdoni/encryption

Usage

Asymmetric

import { Asymmetric } from "@vocdoni/encryption"

// See also: Asymmetric.encryptBytes, Asymmetric.encryptRaw
const encrypted = Asymmetric.encryptString("super secret", publicKey)
const decrypted = Asymmetric.decryptString(encrypted, privateKey)

console.log(decrypted)
// Prints "super secret

Symmetric

import { Asymmetric } from "@vocdoni/encryption"

// See also: Symmetric.encryptBytes, Symmetric.encryptRaw
const encrypted = Symmetric.encryptString("super secret", "my-passphrase")
const decrypted = Symmetric.decryptString(encrypted, "my-passphrase")

console.log(decrypted)
// Prints "super secret

Testing

To execute library tests just run

npm run test

/@vocdoni/encryption/

    Package Sidebar

    Install

    npm i @vocdoni/encryption

    Weekly Downloads

    924

    Version

    1.14.1

    License

    GPL-3.0-or-later

    Unpacked Size

    83.9 kB

    Total Files

    20

    Last publish

    Collaborators

    • jordipainan
    • elboletaire
    • emmdim
    • marcvelmer