Code Monkey home page Code Monkey logo

pixeldust's Introduction

PixelDust - a CLI based Image Encryption

PixelDust is a command-line tool for encrypting and decrypting images using XOR encryption. It supports both encryption and decryption of images with a randomly generated key.

Features

  • Encrypt images using XOR encryption.
  • Decrypt images using the provided key.
  • Supports custom output file names for both encrypted images and keys.
  • Supported formats: png, jpg and jpeg.

Dependencies

  • npm
  • Node.js

Installation

To use pixelDust, you need to have Node.js installed. Then, follow these steps:

  1. Clone the repository:

    git clone https://github.com/AvijeetJain/pixelDust.git
  2. Navigate to the project directory:

    cd pixelDust
  3. Install the dependencies:

    npm install

Commands Available

List of all the command available:

  -h, --help                 # Lists all available commands
  -e, --encrypt              # The image to encrypt
  -d, --decrypt              # The image to decrypt
  -c, --clear                # Clear the console Default: false
  --noClear                  # Don't clear the console Default: true
  -v, --version              # Print CLI version Default: false
  -k, --key                  # The key to use for decryption Default: false
  -i, --outputImageFileName  # The output image
  -p, --outputKeyFileName    # The output key

Usage

Encrypt an Image

To encrypt an image, use the following command:

pixeldust --encrypt <image_path> --outputImageFileName <output_image> --outputKeyFileName <key_file>

Decrypt an Image

To decrypt an image, use the following command:

pixeldust --decrypt <encrypted_image_path> --key <key_file> --outputImageFileName <decrypted_image>

Limitation

While encryption and decryption of PNG images are flawless, the process encounters challenges with JPG and JPEG formats. These formats employ lossy compression, which discards some image data to reduce file size and introduces compression artifacts. Additionally, they undergo color space conversion and quantization during compression, affecting pixel precision. Moreover, their block-based compression method can cause blocky artifacts, which may become more noticeable after decryption. Consequently, decrypted JPG and JPEG images exhibit minor differences in pixel values compared to the original.

Contributing

Feel free to open issues or contribute to the project. Pull requests are always welcomed.

pixeldust's People

Contributors

avijeetjain avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.