Socket
Socket
Sign inDemoInstall

hesabe-crypt

Package Overview
Dependencies
1
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hesabe-crypt

Encryption library for Hesabe Payment API 2.0


Version published
Weekly downloads
44
increased by91.3%
Maintainers
1
Install size
81.7 kB
Created
Weekly downloads
 

Readme

Source

hesabe-crypt

Encryption library for Hesabe Payment API 2.0

NPM Version

Install

npm i -S hesabe-crypt

Dependencies

A depency for this package aes-js will also get installed automatically and usage of that is shown below.

Usage

After installing this library you may import the Hesabe Crypt class.

import hesabeCrypt from "hesabe-crypt";

You need to import aes-js also.

import aesjs from "aes-js";

You need to have a secret and an iv code to use this package.

Before starting encryption, you need to convert your secret and iv in bytes mentioned below:

let secret = 'XXXXX'        // Secret provided by Hesabe
let ivCode = 'XXXXX'        // IV provided by Hesabe

key = aesjs.utils.utf8.toBytes(secret);
iv = aesjs.utils.utf8.toBytes(ivKey);

You first need to initialise an intance of hesabeCrypt class and pass the key and iv while doing it.

let instance = new hesabeCrypt(key, iv);

You can now call the methods of hesabeCrypt.

let text = 'XXXXX';           // Any random text
let encrypted = instance.encryptAes(text);

let decrypted = instance.decryptAes(encrypted);

Keywords

FAQs

Last updated on 09 Jun 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc