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

@giakki/encrypt-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@giakki/encrypt-webpack-plugin

Webpack plugin to encrypt sources

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Encrypt Webpack Plugin

Not sure why you'd want this, but here it is...

Installation

npm i @giakki/encrypt-webpack-plugin

Simple usage

{
    entry: {
        privateCss: path.resolve(__dirname, 'src/index.css'),
        privateJs: path.resolve(__dirname, 'src/index.js'),
    },
    plugins: [
        encryptPlugin({ assets: ['privateCss.css', 'privateJs.js'], key: process.env.SECRET_KEY }),
    ]
}

Options

The simplest way to use the plugin is to specify the assets and the secret key to use, as show above. If used this way, the plugin wil derive a key using 100000 passes of pbkdf2 using a random salt, and then encrypt the assets using aes-256-cbc. The output will be the base-64 concatenation of [salt, iv, cyphertext].

The key argument also accepts configurable pbkdf2 options, as such:

{
    assets: [...],
    key: {
        digest: 'sha512',
        iterations: 100000,
        password: SECRET,
        salt: crypto.randomBytes(16),
    }
}

Where password and salt can either be Strings or Buffers.

Keywords

FAQs

Package last updated on 31 Jan 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

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