New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

encrypt-response

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

encrypt-response

Encrypt controller response

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

encrypt-response

NestJs library for encrypt response.

Nest.js (Install)

Requirements:

  • Nest.js
  • npm (Node.js package manager)
npm install encrypt-response

Usage

Import EncryptModule to your current module and pass your private_key:

import { EncryptModule } from 'encrypt-response';

@Module({
  imports: [EncryptModule.register('private_key')]
})

Import Encrypt decorator and EncryptInterceptor to your current controller and pass your algorithm from Algorithm enums:

import { Encrypt, EncryptInterceptor } from 'encrypt-response';
import { Algorithm } from 'encrypt-response/dist/common/enum';

@Get()
@Encrypt(Algorithm.AES)
@UseInterceptors(EncryptInterceptor)
getHello(): any {
  return this.appService.getHello();
}

If you need decrypt cipher text in your back-end project, you can use EncryptService:

import { EncryptService } from 'encrypt-response';
import { Algorithm } from 'encrypt-response/dist/common/enum';

constructor(
  private readonly encryptService: EncryptService,
) {}

decrypt(): any {
  console.log(
    this.encryptService.decrypt(
      'U2FsdGVkX18bd5ZxKAzmHipM9l+gowyOSLcudi6EOWM=',
      Algorithm.AES,
    ),
  );
}

List of crypto algorithms

  • MD5
  • SHA1
  • SHA3
  • SHA256
  • SHA512
  • RIPEMD160
  • HmacMD5
  • HmacSHA1
  • HmacSHA256
  • HmacSHA512
  • AES
  • DES
  • Rabbit
  • RC4
  • RC4Drop

Release notes

0.0.6

The 0.0.x are based on the original EncryptResponse.

Keywords

encrypt_response

FAQs

Package last updated on 12 Jun 2023

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