Giter Club home page Giter Club logo

caesar-cipher-cli's Introduction

Caesar cipher cli

This is a command-line interface to encrypt and decrypt text with Caesar's cipher. The application encrypts and decrypts only latin alphabet letters. All other characters remain unchanged.


How to install

  1. Download or clone this repository.
  2. Run command line and go to the application folder.

How to use

In the application folder, enter the following into the command line: "node caesar-cli [options]".

Options:

  • -s, --shift: a shift
  • -i, --input: an input file
  • -o, --output: an output file
  • -a, --action: an action encode/decode

The action option is required and can take the values of encode or deconde and indicates what needs to be done with the incoming text: encrypt or decrypt.

The shift option is required and must be an integer (you can also use negative values ​​or values ​​that exceed the length of the alphabet). It denotes a shift of letters for encryption and decryption.

The input option must be relative or absolute path to input file. If there are spaces in the path, it must be wrapped in quotes.

The output option must be relative or absolute path to output file. If there are spaces in the path, it must be wrapped in quotes.

If the input and/or the output options are absent, then reading and writing will be carried out from/to the command line.


Examples of usage:

Encription with shorthand names of the options

$ node caesar-cli -a encode -s 7 -i ./input.txt -o ./output.txt

Before:

input.txt This is secret. Message about "_" symbol!

output.txt empty

After:

input.txt This is secret. Message about "_" symbol!

output.txt Aopz pz zljyla. Tlzzhnl hivba "_" zftivs!

Decryption with full names of the options

$ node caesar-cli --action decode --shift 7 --input ./plain.txt --output ./decode.txt

Before:

plain.txt Aopz pz zljyla. Tlzzhnl hivba "_" zftivs!

decode.txt empty

After:

plain.txt Aopz pz zljyla. Tlzzhnl hivba "_" zftivs!

decode.txt This is secret. Message about "_" symbol!

caesar-cipher-cli's People

Contributors

liza-veis 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.