summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 2448196577c198f65c125e688ddcc88444ade618 (plain)
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
Onetimebluh (Workbluhp in blogress!!)
======================================

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

Still usign just gcc. Compile only for testing. Openssl libraries are needed and must be linked to gcc with the option `-lcrypto`. Here follows an example:

```
gcc -Wall -Wpedantic -lcrypto onetimebluh.c -o onetimebluh -v
```

Usage
-------

Example creates two keys of length 4096 bytes and use the first as a message and the second as the pad key (just for testing):

```
onetimebluh --key-gen --nbytes 4096 --output message
onetimebluh --key-gen --nbytes 4096 --output pad
onetimebluh --encrypt message --key-file pad --output encrypted-message
onetimebluh --decrypt encrypted-message --key-file pad --outptut decrypted-message
```

You can print the help by running `onetimebluh --help` or `onetimebluh -h`.

```
ONETIMEBLUH USAGE:
onetimebluh [COMMAND] [OPTIONS] ...

COMMANDS:

-d, --decrypt=FILE	decrypt message (input) same as --encrypt, just for the feeling
-e, --encrypt=FILE	encrypt message (input)
-h, --help		print this help
-g, --key-gen		create key file

OPTIONS

-k, --key-file=FILE	use key (input)
-b, --nbytes=NUM	number of bytes
-o, --output=FILE	output name
-t, --tear-page		deletes from the pad file the bytes used to encrypt/decrypt

Onetimebluh project repository at https://git.eigenlab.org/Seppia/onetimebluh
```