Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@adonisjs/encryption

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adonisjs/encryption

Encryption provider for AdonisJs

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27K
decreased by-12.56%
Maintainers
2
Weekly downloads
 
Created
Source

Encryption

AdonisJs provider to encrypt and decrypt values

circleci-image npm-image license-image

This module is used by AdonisJs to encrypt/decrypt values using a secret key.

Table of contents

Usage

Install the package from npm registry as follows:

npm i @adonisjs/encryption

# yarn
yarn add @adonisjs/encryption

and then use it as follows:

import { Encryption } from '@adonisjs/encryption/build/standalone'
const encryption = new Encryption({ secret: 'verylongandrandom32characterskey' })

const encryptedValue = encryption.encrypt('hello-world')
encryption.decrypt(encryptedValue) // 'hello-world'

Using with AdonisJs

The @adonisjs/core module includes this module by default. However, here's how you can set it up manually.

const providers = [
  '@adonisjs/encryption'
]

And then also register the typings file inside tsconfig.json file.

{
  "files": ["./node_modules/@adonisjs/encryption/build/adonis-typings/encryption.d.ts"]
}

And use it as follows:

import Encryption from '@ioc:Adonis/Core/Encryption'
Encryption.encrypt('password')

Keywords

FAQs

Package last updated on 12 Apr 2020

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