@sir_koty/cypher
    TypeScript icon, indicating that this package has built-in type declarations

    2.1.1 • Public • Published

    CYPHER LIBRARY

    Base on JS encrypt library this library helps you to encrypt and decrypt huge data. The library works with rsa 2048 keys pairs

    Installation

    Use the npm package manager npm to install @sir_koty/cypher-library

    npm install @sir_koty/cypher-library

    Usage

    import { Cypher } from "@sir_koty/cypher-library";
     
    const public_key = `MY_SECRET_RSA_2048_PUBLIC_KEY`;
    const private_key = `MY_SECRET_RSA_2048_PRIVATE_KEY`;
     
    // Set rsa key (2048)
    Cypher.setPrivateKey(private_key);
    Cypher.setPublicKey(public_key);
     
    // Encryption
    const clearText = "Hello world .... MMMMM"; // You can put more than 214 characters
    const encrytedData = Cypher.encrypt(clearText); 
    console.log('encrypted data ', encryptedData); // [XXXXXX, ZZZZZZ];
     
    // Decryption
    const decryptedData = Cypher.decrypt(encrytedData);
    console.log('decrypted data ', decryptedData); // "Hello world .... MMMMM" (clearText)
     

    Demo

    #Stackblitz : https://stackblitz.com/edit/cypher-sample?file=src%2Fapp%2Fapp.component.ts
    

    version 2.0.3

    License

    MIT

    Install

    npm i @sir_koty/cypher

    DownloadsWeekly Downloads

    4

    Version

    2.1.1

    License

    ISC

    Unpacked Size

    22 kB

    Total Files

    14

    Last publish

    Collaborators

    • sir_koty