Coder Social home page Coder Social logo

wrzlbrmft / ppcrypt Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 24 KB

Public/private key encryption/decryption demo using the RSA cryptosystem.

License: GNU General Public License v3.0

Java 100.00%
rsa cryptography asymmetric-cryptography publickey privatekey encryption

ppcrypt's Introduction

ppcrypt

Build Status

Public/private key encryption/decryption demo using the RSA cryptosystem.

Build Instructions

Requirements

To build, run:

mvn package

The ppcrypt.jar file will be stored in the target directory.

Usage

Run:

java -jar ppcrypt.jar

Append -h or --help to get a list of all available options:

java -jar ppcrypt.jar -h

All available options are:

 -d,--decrypt
 -e,--encrypt
 -h,--help            print this help message and exit
 -i,--input <file>    input file
 -k,--key <file>      public-/private-key file for encryption/decryption
 -o,--output <file>   output file
 -v,--version         print version info and exit

Generate RSA Key-pair

To generate a 1024-bit RSA key-pair, run:

openssl genrsa -out private.pem 1024
openssl pkcs8 -topk8 -inform PEM -outform DER -in private.pem -out private.der -nocrypt
openssl rsa -in private.pem -pubout -outform DER -out public.der

The public-key will be stored in public.der, the private-key in private.der.

Encrypt

To encrypt a message stored in message.txt into secret.txt using the public-key, run:

java -jar ppcrypt.jar --encrypt --key public.der --input message.txt --output secret.txt

or short:

java -jar ppcrypt.jar -e -k public.der -i message.txt -o secret.txt

Decrypt

To decrypt a secret stored in secret.txt back to revealed.txt using the private-key, run:

java -jar ppcrypt.jar --decrypt --key private.der --input secret.txt --output revealed.txt

or short:

java -jar ppcrypt.jar -d -k private.der -i secret.txt -o revealed.txt

License

This software is distributed under the terms of the GNU General Public License v3.

ppcrypt's People

Contributors

wrzlbrmft avatar

Watchers

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