Git Product home page Git Product logo

otp-cryptography's Introduction

OTP-Cryptography

Final Project for Operating Stystems 1 (CS_344_400_F2017)

Five programs that encrypt and decrypt information using a one-time pad-like system

keygen.c:

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

otp_enc.c:

Client application that connects to otp_enc_d, and asks it to perform a one-time pad style encryption.

otp_enc_d.c:

This program is to be ran in the background as a daemon. Its function is to perform actual encoding. This program will listen on a particular socket/port. When a connection is made, it will spawn a child process to handle the client requet. The child receives a plaintext and key via communication socket, and will write back the ciphertext.

otp_dec.c:

Client application that connects to otp_dec_d, and asks it to perform a one-time pad style decryption.

otp_dec_d.c:

This program is to be ran in the background as a daemon. Its function is to perform actual decoding. This program will listen on a particular socket/port. When a connection is made, it will spawn a child process to handle the client requet. The child receives an encrypted text and key via communication socket, and will write back the decyphered text.


Example usage with bash:

$ otp_enc_d 50011 &	
$ otp_dec_d 50012 &	
$ keygen 50 > mykey	
$ cat plaintext1
$ THE RED GOOSE FLIES AT MIDNIGHT STOP
$ otp_enc plaintext1 mykey 50011 > ciphertext1
$ cat ciphertext1	
$ FJLKAESJOL IOVJSANFL PAOIEFJA DYGFYB	
$ otp_dec ciphertext1 mykey 50012 > plaintext1_a	
$ cat plaintext1_a	
$ THE RED GOOSE FLIES AT MIDNIGHT STOP

otp-cryptography's People

Contributors

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