crypto_iv_cypher

1.1.7 • Public • Published

crypto_iv_cypher

Crypto IV Cypher.

Installation

Use the package manager [npm] to install crypto_iv_cypher.

npm install crypto-iv-cypher

Usage

const cypher = require('crypto_iv_cypher');


let secret = 'secret';
let iv = cypher.generateIV();
let secretData = 'Hello World, please encrypt me!';
// random 16 bytes => hex <string>


// Call Examples:
cypher.encryptData(secret, iv, secretData).then(encrypted => {
    // 'aes-256-cbc' cipher => hex <string>
    // return encrypted hex string
});

cypher.decryptData(secret,iv,encrypted).then(result => {
    // return result string
})

// Async examples:
const encrypt = async (secret, iv, data) => {
    let encrypted = await cypher.encryptData(secret, iv, data);
    return encrypted;
}

const decrypt = async(secret, iv, encrypted) => {
    let decrypted = await cypher.decryptData(secret,iv,encrypted);
    return decrypted;
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

Readme

Keywords

Package Sidebar

Install

npm i crypto_iv_cypher

Weekly Downloads

9

Version

1.1.7

License

ISC

Unpacked Size

4.31 kB

Total Files

4

Last publish

Collaborators

  • helixious