Socket
Socket
Sign inDemoInstall

sec-obfuscate

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sec-obfuscate

Obfuscate IDs in a secure way!


Version published
Weekly downloads
14
increased by75%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

sec-obfuscate

sec-obfuscate is a fork of the original sec-obfuscate-nodejs last updated in 2014. There have been deprecations since then, so this library addresses those.

sec-obfuscate is a library which obfuscates numbers (IDs etc...) using ciphers from OpenSSL.

Parameters

var SecObfuscate = require("sec-obfuscate"),
secObfuscate = new SecObfuscate(key, iv, [cipher], [blockLength]);

cipher is a name of a encrption algorithm in OpenSSL notation. Default value is AES-256-CTR. blockLength is a length of the output block. It have to be a multiple of 8. Default value is 32.

Ciphers

Currently only stream cipher (RC4) or AES with stream modes of operation are available:

  • RC4
  • AES-128-CTR
  • AES-128-GCM
  • AES-128-OFB
  • AES-192-CTR
  • AES-192-GCM
  • AES-192-OFB
  • AES-256-CTR
  • AES-256-GCM
  • AES-256-OFB

Usage

Code below presents a simple example of how the library can be used. More examples are available in test directory.

var SecObfuscate = require("sec-obfuscate"),
    key = '0123456789abcdef0123456789abcdef',
    iv = '0123456789abcdef'

secObfuscate = new SecObfuscate(key, iv),
encryptedValue = secObfuscate.encrypt(42),
decryptedValue = secObfuscate.decrypt(encryptedValue),

Keywords

FAQs

Last updated on 27 Oct 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