GithubHelp home page GithubHelp logo

one-time-pads's Introduction

One Time Pads

Encrypts & Decrypts Messages

I createdfive small programs that encrypt and decrypt information using a one-time pad-like system. These programs combine multi-processing code with socket-based inter-process communication. It includes a compilation script.

enc_client This program connects to enc_server, and asks it to perform a one-time pad style encryption. By itself, enc_client doesn’t do the encryption - enc_server does. The syntax of enc_client is as follows:

$ enc_client plaintext key port

In this syntax, plaintext is the name of a file in the current directory that contains the plaintext you wish to encrypt. Similarly, key contains the encryption key you wish to use to encrypt the text. Finally, port is the port that enc_client should attempt to connect to enc_server on. When enc_client receives the ciphertext back from enc_server, it should output it to stdout. Thus, enc_client can be launched in any of the following methods, and should send its output appropriately:

$ enc_client myplaintext mykey 57171

$ enc_client myplaintext mykey 57171 > myciphertext

If enc_client receives key or plaintext files with any bad characters in them, or the key file is shorter than the plaintext, then it terminates, send appropriate error text to stderr, and sets the exit value to 1. If enc_client should nog be able to connect to dec_server, the programs reject each other.

dec_server This program performs exactly like enc_server, in syntax and usage. In this case, however, dec_server will decrypt ciphertext it is given, using the passed-in ciphertext and key. Thus, it returns plaintext again to dec_client.

dec_client Similarly, this program will connect to dec_server and will ask it to decrypt ciphertext using a passed-in ciphertext and key, and otherwise performs exactly like enc_client, and is runnable in the same ways.

keygen This program creates a key file of specified length. The characters in the file generated will be any of the 27 allowed characters, generated using the
standard Unix randomization methods.

The syntax for keygen is as follows:

$ keygen keylength

where keylength is the length of the key file in characters. keygen outputs to stdout.

Here is an example run, which creates a key of 256 characters and redirects stdout a file called mykey (note that mykey is 257 characters long because of the
newline):

$ keygen 256 > mykey

one-time-pads's People

Contributors

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