Skip to content

Crypto utilities for ReactJs and Web Browsers (Digest, AES, HMAC, RSA, RSA Digital Signature)

License

Notifications You must be signed in to change notification settings

telkomdev/crypsi.js

Repository files navigation

CrypsiJs (Crypto utilities for React and Web Browsers)

CrypsiJs CI

Install

$ npm i crypsi.js

Usage Reactjs

import { digest } from 'crypsi.js';

const handleSubmit = async (e) => {
    console.log(await digest.sha256('wuriyanto')); // 7da544fa170151239b9886c0c905736fe3e8b07e68aefaba0633272aee47af87
};

Usage Browser globals

Please adjust the version @0.0.0 based on https://github.com/telkomdev/crypsi.js/releases

<head>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/crypsi.min.js"></script>
</head>

Now crypsi will be available in the global object

<script>
    crypsi.digest.sha256('wuriyanto').then(function(res) {
        console.log(res); // 7da544fa170151239b9886c0c905736fe3e8b07e68aefaba0633272aee47af87
    });
</script>

CrypsiJs is compatible with each other with the following server side libraries

Features

  • Asymmetric encryption with RSA
  • Generate RSA private and public key
  • Digital Signature with RSA private and public key using PSS
  • Symmetric encryption with AES
  • Message authentication code with HMAC
  • Generate Hash with Common DIGEST Algorithm