Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

dec-enc-lib

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dec-enc-lib

Node.js dec-enc-lib library

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
2
-88.89%
Maintainers
1
Weekly downloads
 
Created
Source

dec-enc-lib

Node.js dec-enc-lib library

  • Pure JavaScript
  • Encryption and decryption string
  • Encryption and decryption object
  • Provides additional encryption with a user-entered password .

Installing

npm i dec-enc-lib

Testing

npm test

Work environment

This library developed and tested primary for Node.js

licens

MIT

Usage

Decryption and Encryption string

Example

// For string
import { Encrypt} from 'dec-enc-lib/src/Encryption.js'
import {Decrypt} from 'dec-enc-lib/src/Decryption.js'

const text = 'Hello there!';
const encryptedMessage = Encrypt(text);
console.log('encrypted: ', encrypted);
const decryptedMessage = Decrypt(encryptedMessage);
console.log('decrypted: ', decryptedMessage);

Decryption and Encryption object

Example

// For object
import {EncryptObj,DecryptObj} from 'dec-enc-lib/src/ObjectEncDec.js'

const object = { name :'manar' , age : 34 , children :['jory','horeya','shams']};
const encrypted = EncryptObj(object);
console.log('encrypted: ', encrypted);
const decrypted = DecryptObj(encrypted);
console.log('decrypted: ', decrypted);

Extra Decryption and Encryption for string with password

Example

// With password
import {EncryptWithPass,DecryptWithPass} from 'dec-enc-lib/src/PassEncDec.js'

const message = ' my name is Manar Alibrahim';
const password = 'key88';
const encrypted = EncryptWithPass(message,password);
console.log('encrypted: ', encrypted);
const decrypted = DecryptWithPass(encrypted, password);
console.log('decrypted: ', decrypted);

Keywords

Decryption- Encryption - password - object

FAQs

Package last updated on 16 Oct 2022

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