2.3.0 • Published 9 months ago

@ibnlanre/cipher v2.3.0

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

@ibnlanre/cipher

TypeScript code style: prettier version

for AES encryption or decryption

Install

To use, you'll need to install Node and Yarn or npm

  • NPM

    npm i @ibnlanre/cipher
  • YARN

    yarn add @ibnlanre/cipher

Import

  • ES6 Import

    import Cipher from "@ibnlanre/cipher";
  • NodeJS Require

    const Cipher = require("@ibnlanre/cipher").default;

Usage

  • Instantiate

    const encryption_key = Cipher.generateRandomKey(256);
    const initialization_vector = Cipher.generateRandomKey(128);
    
    const cipher = new Cipher({
      initialization_vector,
      algorithm: "aes-256-cbc",
      output_decoding: "base64",
      input_encoding: "utf-8",
      encryption_key,
    });
  • Destructure

    const { encrypt, decrypt } = cipher;
  • Utilize

    const formData = { example: "fooBar" };
    const encryptedData = encrypt(formData);
    const decryptedData = decrypt(encryptedData);

Maintainers

2.3.0

9 months ago

2.2.1

9 months ago

2.2.0

9 months ago

2.1.1

9 months ago

2.2.3

9 months ago

2.2.2

9 months ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago