Code Monkey home page Code Monkey logo

minimal-ruby-rsa-encryptor-decryptor's Introduction

oliver-paaske-66BgmIglPhM-unsplash

This is an absolute bare-bones pure Ruby application that will perform RSA encryption and decryption of user provided text files via the command line.

Methods used here are borrowed from the archived EncryptoSigno Gem

Setup:

  • Generate your own RSA private/public key pair and save them in the correspondingly named files inside this app automically by running these two commands from the top level directory for the app.

    $openssl genrsa -out lib/private.key 2048

    $openssl rsa -pubout -in lib/private.key -out lib/public.key

    (or insert your own existing keys)

To use:

From the command line:

  • To encrypt a file:

    $ruby runner.rb <<path_to_file_you_wish_to_encrypt.txt>>

    Application will encrypt the contents of the file using the public key and save it (in the top level directory of this app) as <<original file>>_encrypted.txt.

  • To decrypt a file:

    $ruby runner.rb <<path_to_file_you_wish_to_decrypt>>_encrypted.txt

    (file must end in `_encrypted.txt)

    Application will automatically detect the _encrypted.txt in the file name, decrypt it using the private key, and save it as a new file, same name less the _encrypted bit (in the top level directory of this app).

    Photo by Oliver Paaske on Unsplash

minimal-ruby-rsa-encryptor-decryptor's People

Contributors

phimed 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.