JSPM

@shenyan1206/crypto-helper

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q41429F
  • License ISC

Crypto Helper

Package Exports

  • @shenyan1206/crypto-helper
  • @shenyan1206/crypto-helper/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@shenyan1206/crypto-helper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

crypto-helper

Crypto Helper for NodeJS

Support: TDES, DES with mode ECB and CBC

Padding: PADDING_ZERO, PADDING_PKCS7

Public Methods:

tdes_enc_ecb(key, data)

tdes_dec_ecb(key, data)

tdes_enc_cbc(key, data, iv)

tdes_dec_cbc(key, data, iv)

des_enc_ecb(key, data)

des_dec_ecb(key, data)

padding(data, padding_type)

unpadding(data, padding_type)

kcv(key)

generateKeyOfSize(size)

installation

$ npm install @shenyan1206/crypto-helper --save

example

var CryptoHelper = require("@shenyan1206/crypto-helper");

var key = Buffer.from("0123456789ABCDEFFEDCBA9876543210", "hex");
var data = Buffer.from("0102030405060708", "hex");

var ciphter_data = CryptoHelper.tdes_enc_ecb(key, data);

console.log(ciphter_data);