npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bouzraa-files-crypter

v1.0.7

Published

A package for encrypting and decrypting files using various algorithms.

Downloads

26

Readme

Bouzraa Files Crypter

Bouzraa Files Crypter is a Node.js package that provides functionality for encrypting and decrypting files using various cryptographic algorithms. This package allows you to easily secure and restore files through AES encryption and decryption.

Table of Contents

Installation

To install Bouzraa Files Crypter, use npm:

npm install bouzraa-files-crypter

Usage

Encrypting a File

const { BouzraaFilesCrypter } = require('bouzraa-files-crypter');

const encryptionKey = 'your-encryption-key-in-hex';
const crypter = new BouzraaFilesCrypter(encryptionKey);

const inputPath = 'path/to/your/input/file.txt';
const outputPath = 'path/to/your/encrypted/file.enc';

crypter.encryptFile(inputPath, outputPath);

Decrypting a File

const { BouzraaFilesCrypter } = require('bouzraa-files-crypter');

const encryptionKey = 'your-encryption-key-in-hex';
const crypter = new BouzraaFilesCrypter(encryptionKey);

const inputPath = 'path/to/your/encrypted/file.enc';
const outputPath = 'path/to/your/decrypted/file.txt';

crypter.decryptFile(inputPath, outputPath);

API

BouzraaFilesCrypter Constructor

constructor(encryptionKey: string, algorithm?: string)

encryptionKey: A hexadecimal string used for encryption and decryption.

algorithm (optional): The algorithm to use for encryption. Default is aes-256-ctr.

Methods


encryptFile(inputFilePath: string, outputFilePath: string): string

Encrypts the file at inputFilePath and writes the encrypted content to outputFilePath.


decryptFile(inputFilePath: string, outputFilePath: string): string

Decrypts the file at inputFilePath and writes the decrypted content to outputFilePath. Returns the output file path.

Supported Algorithms

The following algorithms are supported:

  • aes-256-ctr (default)
  • aes-192-ctr
  • aes-128-ctr
  • aes-256-cbc
  • aes-192-cbc
  • aes-128-cbc

Ensure that your encryption key length matches the requirements for the selected algorithm.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request. Make sure to follow the code style and include tests for new features or bug fixes.

License

This package is licensed under the MIT License. See the LICENSE file for details.

For more detailed documentation and updates, visit the GitHub repository.

Key Points:

  • Installation: Provides instructions to install the package.
  • Usage: Demonstrates basic usage for encrypting and decrypting files.
  • API: Details the class constructor and methods.
  • Supported Algorithms: Lists the algorithms that can be used.
  • Contributing: Encourages contributions and provides basic guidelines.
  • License: Specifies the license under which the package is distributed.