In cryptography, the one-time pad (OTP) is an encryption technique that cannot be cracked, but requires the use of a one-time pre-shared key the same size as, or longer than, the message being sent (Wikipedia). This program aims to emulate this cryptography technique and allows users to generate keys, encrypt, and decrypt messages. The program is currently designed to run on just one server, but can be modified to run across multiple servers.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
What things you need to install the software and how to install them
GNU Compiler (Recommend to install with package manager such as Homebrew)
In the command line within your desired directory, run the following command to download the program:
#Downloads the project directory to the current working directory
git clone https://github.com/venGaza/cryptoPad
Then run the following command to build the project:
#Build
compileCryptoPad
Run the following command to generate a key for the program to use for encryption and decryption:
keygen <numberOfCharactersDesired> > <desiredKeyFileName>
#example
keygen 20 > keygen1
ls
keygen1.txt
**Make sure to generate key that has longer character length than the message that will be encrypted
To start the server daemons in the background run the following code:
encrypt-daemon <portNum> &
decrypt-daemon <portNum> &
**portNum = the port number the daemon will listen for requests
encrypt-client <encryptionKeyFile> <portNumberOfDaemon> > <outputFileName>
#example
encrypt-client plain1 key70000 3000 > cipher1
decrypt-client <encryptionKeyFile> <portNumberOfClient> > <outputFileName>
#example
decrypt-client cipher1 key70000 3000 > plainRead1
Once you are done with the program, you can use the following command to stop the servers:
killall -q -u $USER encrypt-daemon* decrypt-daemon
- Visual Studio Code - Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.
- Vim - Vim is a highly configurable text editor for efficiently creating and changing any kind of text.
- Dustin Jones - venGaza
This project is licensed under the MIT License - see the LICENSE.md file for details
- Oregon State University
- Beej's Guide to Socket Programming
- Wikipedia