Skip to content

supereater14/otpcrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

otpcrypt

One-time pad data encryption

By Alec Hitchiner

Building

make clean
make

Usage

Encryption (auto-generate key):   otpcrypt e [input file]
Encryption (provided key):        otpcrypt e [input file] [key file]
Decryption:                       otpcrypt d [encrypted file] [key file]

Encryption

During encryption, otpcrypt generates a random key with size equal to the plaintext. This key is generated using data from /dev/urandom. The plaintext is then XOR'd with the generated key. The result is stored in two files. A file, ending in ".otp", contains the plaintext XOR'd with the key. A second file, ending in ".key" contains the generated key.

If the key is provided, the same procedure as is followed for decryption will be performed, which is functionally identical to encryption.

Decryption

During decryption, the encrypted file and the key are again XOR'd together. This yields the original file, which is then stored in a file whose name is based on the encrypted file's name.

About

One-Time Pad Encryption System

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published