1.1.4 • Published 9 months ago

encrypt-decrypt-api v1.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

encryption with Private key

const {encrypt,decrypt}= require("encrypt-decrypt-api")

let PrivateKey="my-private-key"; // user defined

const encrypted = encrypt({ firstName: "test" },PrivateKey);

const deciphertext = decrypt("U2FsdGVkX1/3fLFzthsfPEqpuB+SrTY6XapIoiDI8xc=",PrivateKey)


---------FRONTEND---------------

import {encrypt,decrypt} from "encrypt-decrypt-api"

const encrypted = encrypt({ firstName: "test" }, PrivateKey);

const deciphertext = decrypt(encrypted, PrivateKey);

encryption with public and Private key

const {encrypt,decrypt,generateKeyFiles,encryptString,decryptString}= require("encrypt-decrypt-api")

let keys = generateKeyFiles(); // public key and private key

const encrypted = encryptString({ firstName: "test" }, keys.publicKey);

const deciphertext = decryptString(encrypted, keys.privateKey);
1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.0

9 months ago

1.0.0-SNAPSHOT

5 years ago