Coder Social home page Coder Social logo

xipher's Introduction

xipher

npm version npm downloads bundle License

xipher is a simple wrapper around the subtle crypto API.

Thumbnail

Installation

pnpm add xipher

Usage

pbkdf2(password, keyLength)

Derive a key from a base password using pbkdf2.

import { pbkdf2 } from 'xipher'

// Generate a 32 bytes key from the password 'password'
const key = await pbkdf2('password', 32)

sha256(data)

Hash data using sha256.

import { sha256 } from 'xipher'

const hash = await sha256('...')

Security Considerations

You have read this section already pretty much everywhere.

Security is not a thing that is either there or not, it's a process.

Security

Ultimately, there is no algorithm to determine whether an encryption is secure, there is just a bunch of very smart folks trying to break it. Sure some pattern of attack emerges, but still, there is no life-equation that determines whether a algorithm is secure or not. As you might have already guess, if there is no algorithm to determine whether an encryption standard is secure, there is no algorithm to determine whether your specific implementation is secure.

Security Holes

So here's the rule, the word "secure" have no meaning, secure from what? secure when? secure how? Whiteout addressing those questions, the word "secure" is just a buzzword.

Ok then, what should you do?

This library uses the Web Crypto API, which is a well-tested and secure API. Certain functionality are just wrappers around that API, others are implemented by gluing together those functionalities.

License

MIT

xipher's People

Contributors

lucacicada avatar

Stargazers

 avatar

Watchers

 avatar

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.