JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q88475F
  • License MIT

Secret encrypter for keys, api-keys and envs

Package Exports

  • @cartago-git/keyer
  • @cartago-git/keyer/src/index.ts

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@cartago-git/keyer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Keyer

This app is just a library to encrypt and decrypt texts and any other variables with a salt.

To install

npm i @cartago-git/keyer

CLI Basic

  • keyer --version or -v

  • keyer --help or -h

To use command

Just use the command keyer to autoscript.

As default: It will get the .env file from root and create a new folder keyer when encrypt with a file encrypted-hash.txt

If you want change env or hash file just pass --env-file or -ef for file to encrypt; --hash-file or -hf for hash as arguments.

Example: keyer --env-file='folder/.env' --hash-file='folder/hash.txt'

To use methods

For Example:

import {encrypt, decrypt, encryptAny, decriptAny}

const salt = "This is just a secret salt that you must hide for others";
const apiKey = 'api_false_example_to_show'

// To get the encrypted Hash
const apiKeyHash = encrypt({
    toEncrypt: apiKey,
    secretSalt: salt
})

// to get decrypt the Hash
const apiKeyDecrypted = decrypt({
    toDecrypt: apiKeyHash,
    secretSalt: salt
})

// NOTE - With an object or other var kind
const objectToEncrypt = {
    name: 'Joe',
    prename: 'Doe',
    age: 30
}

// To get the encrypted Hash
const objectHash = encryptAny({
    toEncrypt: objectToEncrypt,
    secretSalt: salt
})

// to get decrypt Hash
const objectDecrypted({
    toDecrypt: objectHash,
    secretSalt: salt
})

console.log({apiKeyHash, apiKeyDecrypted, objectHash, objectDecrypted})

Optional

Every function has a showLog prop in true, just put it to false if doesnt want the encrypt log

encrypt({
    toEncrypt: apiKey,
    secretSalt: salt,
    showLog: false
})