Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

encryption-kit

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

encryption-kit

encryption-kit

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

encrypt-kit Usage

npm

npm install encryption-kit

JsSm4Client Encryption and Decryption tool

Encapsulates JsSm4,

Configuration parameter key : secret key

  • Encryption method

  • @param plaintext

  • encryptData( plaintext:string): string

  • Decryption method

  • @param ciphertext

  • decryptData(ciphertext:string): string

// introduction

import {JsSm4Client} from 'encryption-kit'

let jsSm4Client = new JsSm4Client('youKey')

let a = "1232123"

console.log(jsSm4Client.decryptData(jsSm4Client.encryptData(a))); // 1232123

2 RsaClient rsa encryption, decryption

Encapsulates RsaClient,

Configuration parameter key : secret key

  • Encryption method

  • @param plaintext

  • encryptData( plaintext:string): string

  • Decryption method

  • @param ciphertext

  • decryptData(ciphertext:string): string

// Example

import {RsaClient} from 'encryption-kit'

const publickKey = 'youPublickKey'
const privateKey = 'youPrivateKey'

let rsaClient = new RsaClient(key)

let a = "1232123"

console.log(rsaClient.decryptData(rsaClient.encryptData(a))); // 1232123

Keywords

FAQs

Package last updated on 22 Mar 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc