0.1.8 • Published 2 years ago

encrypted-cookie v0.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Contributors Forks Stargazers Issues MIT License LinkedIn

About Project

This is fully secure cookies with AES Encryption. You can store encrypted cookie. This is specially you can use unlimited length key and store unlimited length of string value in cookie. Encrypt Json array also storable. It's have default key value and you can change own key value to store.

Built With

Features

  • AES-unlimited encryption cookie service without key
  • AES-unlimited decryption cookie service without key
  • AES-unlimited encryption cookie service with key
  • AES-unlimited decryption cookie service with key
  • Store json array in cookie (Normally other cookie packages not support to store json array)
  • Set expire days
  • well secure AES Encryption
  • You can erase manually with erase function

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 0.10 or higher is required.

Installation is done using the npm install command:

Using npm:

$ npm i encrypted-cookie

Using yarn:

$ yarn add encrypted-cookie

Usage

import CookieService from "encrypted-cookie";

//WithoutKey

CookieService.setCookie("userName", "Bavaram", 7); //set Cookie  (key,value,expire_days)
CookieService.getCookie("userName"); //get Cookie (key)
CookieService.setArrayCookie("userDetails", [{name:"bavaram",age:"23"}], 7);  //(key,jsonArray,expire_days)
CookieService.getArrayCookie("userDetails"); //get json array cookie (key)
CookieService.checkCookie("userDetails"); //Check cookie name available ,respones will be comes with boolean (key)
CookieService.eraseCookie("userDetails"); //erase set Cookie (key)

//WithKey
// Note: secretKey can be unlimited letters

CookieService.setCookie("userName", "Bavaram", 7,"passKey"); //set Cookie with encrypted key (key,value,expire_days,encrypt_Key)
CookieService.getCookie("userName","passKey"); //get Cookie with encrypted key (key,encrypt_Key)
CookieService.setArrayCookie("userDetails", [{name:"bavaram",age:"23"}], 7,"passKey"); //(key,jsonArray,expire_days,encrypt_Key)
CookieService.getArrayCookie("userDetails","passKey"); //(key,encrypt_Key)
CookieService.checkCookie("userDetails","passKey"); //Check cookie name available ,respones will be comes with boolean (key,encrypt_Key)
CookieService.eraseCookie("userDetails","passKey"); //erase set Cookie (key,encrypt_Key)

 

Note

CookieService.checkCookie() //=>returns boolean value 
// (If encrypted key is wrong => False)
// (cookie is not available   => False)

CookieService.eraseCookie()
// (If encrypted key is wrong  =>nothing happen)

Browser Support

Native support

  • Chrome
  • Safari
  • FireFox

License

MIT

Developed by Karunaaharan Bavaram

Copyright

Copyright (c) 2022 Karunaaharan Bavaram, contributors. Released under the MIT, GPL licenses

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago