JSPM

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

Encrypt and Decrypt System in Node JS

Package Exports

  • dikacryptjs

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 (dikacryptjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Dika CryptJS

Download Donate

A Javascript Encrypt and Decrypt Module

Instalation

npm i dikacryptjs

Usage

const DikaCryptJS = require("dikacryptjs")

const CryptJS = new DikaCryptJS.CryptJS({
    useHex: true | false (Default: true),
    useBase64: true | false (Default: true)
})

//Generate salt
const salt = CryptJS.genSaltSync()

//Encrypt

//Using Hex and Base64
console.log(CryptJS.encrypt("Text", salt, "Hex" | "Base64"))
//Return to Hex: 566b314856465a4b4e47746b576b46485056553965513d3d
//Return to Base64: NTY0ZDQ3NTQ1NjRhMzQ2YjY0NWE0MTQ3M2Q1NTNkNzk=

//Only Using Hex
console.log(CryptJS.encrypt("Text", salt))
//Return to Hex: 564d4754564a346b645a41473d553d79

//Only Using Base64
console.log(CryptJS.encrypt("Text", salt))
//Return to Base64: Vk1HVFZKNGtkWkFHPVU9eQ==

//Decrypt

//Using Hex and Base64
console.log(CryptJS.decrypt("566b314856465a4b4e47746b576b46485056553965513d3d", salt "Hex"))
//Result: "Text"

console.log(CryptJS.decrypt("NTY0ZDQ3NTQ1NjRhMzQ2YjY0NWE0MTQ3M2Q1NTNkNzk=", salt, "Base64"))
//Result: "Text"

//Only Using Hex
console.log(CryptJS.encrypt("566b314856465a4b4e47746b576b46485056553965513d3d", salt))
//Result: "Text"

//Only Using Base64
console.log(CryptJS.encrypt("NTY0ZDQ3NTQ1NjRhMzQ2YjY0NWE0MTQ3M2Q1NTNkNzk=", salt))
//Result: "Text"
Donate Link
Saweria https://saweria.co/IDikaN