Giter Club home page Giter Club logo

xcykrix / cryptocipher Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 62.21 MB

[Library] Simplified Node.js Encryption, Hashing, and HMAC. Featuring security & policy by design to ensure strong standards for development of your services.

Home Page: https://www.npmjs.org/cryptocipher

License: MIT License

JavaScript 0.82% TypeScript 98.55% Shell 0.63%
aes cipher cryptography cryptography-library decryption encryption hashing hashing-library no-dependencies nodejs sha typescript

cryptocipher's Introduction

🌐Socials

Discord xCykrix LinkedIn Reddit Twitch Twitter

📊Statistics



🏆Trophies

✍️Random Dev Quote


💰You can help me by Donating

PayPal

cryptocipher's People

Contributors

dependabot[bot] avatar xcykrix avatar

Watchers

 avatar

cryptocipher's Issues

[FEATURE] Deprecate `fetch()` in favor of strongly typed functions.

Is your feature request related to a problem? Please describe.
When JavaScript is attempting to parse the typings of CryptoCipher, it fails to find correct typings for functions that can return multiple types of classes.

Describe the solution you'd like to see.
Deprecate: fetch()
Implement: fetchCipher() fetchHasher() fetchHMAC() etc.

[FEATURE] README and Wiki Improvements

Is your feature request related to a problem? Please describe.
N/A

Describe the solution you'd like
Add better examples to the README

Describe alternatives you've considered
N/A

Additional context

const { getCipher } = require('cryptocipher')

async function main () {
  const driver = getCipher('aes256')

  const encrypted = await driver.encrypt({
    key: '12312312312312311231231231231231',
    content: 'hello world'
  })
  console.info(encrypted)
  /*
  {
    content: '&7MUiLET-k=MmFX]/e56ab59568c98460ee8812cc1a51477b',
    aad: 'EUCH9&Px_@'
  }
  */

  const decrypted = await driver.decrypt({
    key: '12312312312312311231231231231231',
    content: encrypted.content,
    aad: encrypted.aad, // required if provided by encrypted
    tag: encrypted.tag // required if provided by encrypted
  })
  console.info(decrypted)
  /*
  {
    content: 'hello world'
  }
  */
}
main()
const { getHasher } = require('cryptocipher')

async function main () {
  const driver = getHasher('sha256')

  const digest_1 = await driver.digest({
    content: 'hello world',
    digest: 'hex' // or base64, latin1
  })
  console.info(digest_1)
  /*
  {
    content: 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'
  }
  */

  const digest_2 = await driver.digest({
    content: 'hello world',
    digest: 'hex', // or base64, latin1
    iter: 300 // self iterate 300 times (passwords!)
  })
  console.info(digest_2)
  /*
  {
    content: 'd20ce3fe12c1b938ccd5346227cd5452cef7d345aff379300685f32ab56b753e'
  }
  */
}

main()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.