New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cookie-encryption

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cookie-encryption

encrypt/decrypt data to store on cookie, with memoization

  • 1.4.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

NPM version Linux Status Windows Status Dependency Status Coveralls

Encrypt/decrypt data to store on cookie, with memoization. This class is built with arc4 cipher, autokey cipher, nodejs ciphers, nodejs hash, nodejs hmac, nodejs pbkdf2 and nodejs diffiehellman,

Installation

Install through NPM

npm install cookie-encryption

or

git clone git://github.com/hex7c0/cookie-encryption.git

API

inside expressjs project

var cookiee = require('cookie-encryption');

var vault = cookiee('ciao');

return supported ciphers

var cookiee = require('cookie-encryption');

cookiee.getCiphers();

Check Cookie options

Methods

write data ('pippo') to selected cookie

vault.write(req, 'pippo');

read data from selected cookie

vault.read(req);

flush data cache

vault.flush();

optional arguments inside of previous methods

 * @param {String} [cookie] - fast cookie
 * @param {String} [encoding] - fast encoding

cookiee(secret [, options])

secret
  • secret- String | Buffer Set password (default "required")
[options]
  • cipher - String Type of cipher, grab list from getCiphers (default "arc4")
  • domain - String Domain of cookie (default "null")
  • cookie - String Name of cookie (default "vault")
  • path - String Path of cookie (default "/")
  • maxAge - Number Age of cookie in millisecond (default "1 year")
  • httpOnly - Boolean Flag for http only cookie (default "false")
  • secure - Boolean Flag for using cookie over TLS/SSL (default "false")
  • signed - Boolean Will use the secret passed to cookieParser(secret) to sign the value (default "false")
  • encoding - String Type of output encoding by nodejs (default "hex")
  • extra - Array Extra info for Hmac ([true] to enable instead of Hash) and pbkdf2 ([salt, iterations, keylen]) (default "[ ]")

Examples

Take a look at my examples

License GPLv3

Keywords

FAQs

Package last updated on 24 Nov 2015

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