1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# Onetimebluh
Simple implementation of One Time Pad cipher.
Capable of generating cryptographically strong random number keys and of usign them to encrypt/decrypt messages of same length with a bitwise XOR function.
## Build
To build onetimebluh just run `make` and you will find the executable binary in the build folder.
## Install
If you want to install onetimebluh, just run `make install`.
If you are using Archlinux onetimebluh is available in the [AUR](https://aur.archlinux.org/packages/otbluh/) and in my unofficial Archlinux repository [seppianet](https://archlinux.seppia.net/).
To use the repo simply add the following to you `pacman.conf` (currently the repo has only `x86_64` packages):
```
[seppianet]
SigLevel = Optional
Server = https://archlinux.seppia.net/$arch
```
If you want to ahve alvways the latest version there is also the git package in the [AUR](https://aur.archlinux.org/packages/otbluh-git/)
## Usage
This example creates a `message` file of 4 KiB and a key of the same length (we are encrypting a pseudo random bytes file):
```
dd bs=512 count=8 if=/dev/urandom of=message
otbluh --gen-key --nbytes 4K --output pad
otbluh --encrypt --input message --key-file pad --output encrypted-message
otbluh --decrypt --input encrypted-message --key-file pad --outptut decrypted-message
```
It is recommended to use the `-t` option in order to be sure not to use more than once the same pieces of the pad to encrypt your data. Here follows an other example:
```
otbluh --encrypt --input message --key-file pad --output encrypted-message --tear-page
```
Or using the short options:
```
otbluh -tei message -k pad -o encrypted-message
```
If you want you can use the `--bluh` function to get the binary dump of yuor encrypted message:
```
otbluh --bluh --input message --output bluhed-message
```
You can print the help by running `otbluh --help`.
```
Onetimebluh usage:
otbluh [COMMAND] [OPTIONS]
Commands:
-b, --bluh bluhes your message or in other words performs a binary dump
-d, --decrypt decrypt message (input) same ad --encrypt, just for the feeling
-e, --encrypt encrypt message (input)
-g, --gen-key create key file
-h, --help print this help
-u, --unbluh unbluhes your message (gets the orginal message from the binary dump)
Options:
-c, --char=CAHRS reads two cahracters as argument and uses them to bluh your message
-k, --key-file=KEY_FILE use key (input)
-i, --input=FILE input file
-n, --nbytes=NUM{K,M,G,T} number of bytes, you can specify K for KiB, M for MiB, etc...
-o, --output=FILE output file
-q, --quiet suppresses all messages, except from error releated ones
-t, --tear-page deletes from the pad file the bytes used to encrypt/decrypt
Onetimebluh project repository at https://git.eigenlab.org/seppia/onetimebluh
```
|