Menu

Tree [385e04] main 1.0.0 /
 History

HTTPS access


File Date Author Commit
 src 2024-06-19 David Valin David Valin [385e04] First version
 test 2024-06-19 David Valin David Valin [385e04] First version
 .gitignore 2024-06-19 David Valin David Valin [385e04] First version
 LICENSE 2024-06-19 David Valin David Valin [385e04] First version
 Makefile 2024-06-19 David Valin David Valin [385e04] First version
 README.md 2024-06-19 David Valin David Valin [385e04] First version
 diagram.png 2024-06-19 David Valin David Valin [385e04] First version
 tutorial.mp4 2024-06-19 David Valin David Valin [385e04] First version

Read Me

One Time Pad "otp" command

This program takes stdin, xor's it with a key file and outputs to stdout.
When it finishes it writes a new file containing the part of the key file that was not used, ending with ".next". When using one time pad, remember to never reuse the keys, that is why a new key file is created with the part that wasn't used. You should always remove the key that you have used once.

Tutorial

YouTube

Install

  • Build and test: make
  • Install: sudo make install

How to use it

  • Create a key file: echo -n "mysupersecretkey" > key.txt
  • Encrypt using key: echo -n "hello" | otp key.txt > cipher.txt
  • Decrypt using key: cat cipher.txt | otp key.txt > plain.txt

Next key

Everytime you run the command it will create a new file with the same name as the key file ending with ".next". You should never reuse keys once they are used (one time pad algorithm requirements), therefore you should remove the original key file and use the new key file generated next time.