From 6d851d490732b6423a523d452336583c262829fe Mon Sep 17 00:00:00 2001 From: Seppia Date: Thu, 9 Jun 2016 03:05:54 +0200 Subject: added options input --- keygen.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/keygen.c b/keygen.c index 4d7d4dd..0dd64ca 100644 --- a/keygen.c +++ b/keygen.c @@ -1,14 +1,52 @@ #include #include +#include int main(int argc, char* argv[]) { - long long int len = strtoll(argv[1], NULL, 10); - unsigned char key[len]; - RAND_bytes(key, len); - FILE* file = fopen(argv[2], "w"); - fwrite(key, len, 1, file); - fclose(file); - printf("Created key file %s of %lli bytes \n", argv[2], len); - - return 0; + + int opt; + int nbytes = 256; + char* output; + int defout = 0; + int defbyte = 0; + while ((opt = getopt(argc, argv, "b:o:")) != -1) { + switch (opt) { + case 'b': + nbytes = atoi(optarg); + defbyte = 1; + break; + case 'o': + output = argv[(optind-1)]; + defout = 1; + break; + default: + fprintf(stderr, "Usage: %s [-b nbytes] [-o output] \n", argv[0]); + exit(EXIT_FAILURE); + } + } + + if (nbytes < 0) { + printf("Negative byte value inserted! \n"); + printf("Exiting... \n"); + exit(EXIT_FAILURE); + } else if (nbytes != 0) { + if (defbyte == 0) { + printf("No byte number specified... using default value: 256 \n"); + } + unsigned char key[nbytes]; + RAND_bytes(key, nbytes); + if (defout == 0) { + output = "default.key"; + printf("No output name specified... using default value: default.key \n"); + } + FILE* file = fopen(output, "w"); + fwrite(key, nbytes, 1, file); + fclose(file); + printf("Created key file %s of %d bytes \n", output, nbytes); + } else { + printf("Byte number specified is 0. \n"); + printf("Doing nothing! \n"); + } + + exit(EXIT_SUCCESS); } -- cgit v1.2.3 From 73d8f08b16502a47733ab56fc64b993b670eca61 Mon Sep 17 00:00:00 2001 From: Seppia Date: Thu, 9 Jun 2016 03:09:03 +0200 Subject: README work in progress --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index acc7d57..418aec4 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -Blblblblbl +Workbluhp in blogress!! -- cgit v1.2.3 From a5100d0374dc95500e859a038aca249d8ecb532c Mon Sep 17 00:00:00 2001 From: Seppia Date: Thu, 9 Jun 2016 03:57:33 +0200 Subject: fixed tabs --- keygen.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/keygen.c b/keygen.c index 0dd64ca..7e49a85 100644 --- a/keygen.c +++ b/keygen.c @@ -4,26 +4,26 @@ int main(int argc, char* argv[]) { - int opt; + int opt; int nbytes = 256; - char* output; + char* output; int defout = 0; int defbyte = 0; - while ((opt = getopt(argc, argv, "b:o:")) != -1) { - switch (opt) { - case 'b': - nbytes = atoi(optarg); + while ((opt = getopt(argc, argv, "b:o:")) != -1) { + switch (opt) { + case 'b': + nbytes = atoi(optarg); defbyte = 1; - break; - case 'o': - output = argv[(optind-1)]; + break; + case 'o': + output = argv[(optind-1)]; defout = 1; - break; - default: - fprintf(stderr, "Usage: %s [-b nbytes] [-o output] \n", argv[0]); - exit(EXIT_FAILURE); - } - } + break; + default: + fprintf(stderr, "Usage: %s [-b nbytes] [-o output] \n", argv[0]); + exit(EXIT_FAILURE); + } + } if (nbytes < 0) { printf("Negative byte value inserted! \n"); -- cgit v1.2.3 From b4fdcac63613c7d114b2ccb004fa053577811f2e Mon Sep 17 00:00:00 2001 From: Seppia Date: Thu, 9 Jun 2016 15:10:42 +0200 Subject: keygen 'no option specified' detection --- keygen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/keygen.c b/keygen.c index 7e49a85..f3793ea 100644 --- a/keygen.c +++ b/keygen.c @@ -9,6 +9,7 @@ int main(int argc, char* argv[]) { char* output; int defout = 0; int defbyte = 0; + int noopts = 0; while ((opt = getopt(argc, argv, "b:o:")) != -1) { switch (opt) { case 'b': @@ -23,8 +24,14 @@ int main(int argc, char* argv[]) { fprintf(stderr, "Usage: %s [-b nbytes] [-o output] \n", argv[0]); exit(EXIT_FAILURE); } + if (noopts == 0) { + noopts = 1; + } } + if(noopts == 0) { + printf("WARNING no option specified usign default values... \n"); + } if (nbytes < 0) { printf("Negative byte value inserted! \n"); printf("Exiting... \n"); -- cgit v1.2.3 From d16925e3b7910735586a36d6f197f624783dbfd3 Mon Sep 17 00:00:00 2001 From: Seppia Date: Thu, 9 Jun 2016 17:16:10 +0200 Subject: added option and help to code --- onetimebluh.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 63 insertions(+), 10 deletions(-) diff --git a/onetimebluh.c b/onetimebluh.c index f838db3..b8f3f8c 100644 --- a/onetimebluh.c +++ b/onetimebluh.c @@ -1,22 +1,75 @@ #include #include +#include + +void xor(int ac, char* av[]); +void help(char* av[]); int main(int argc, char* argv[]) { - FILE* uno = fopen(argv[1], "r"); - FILE* due = fopen(argv[2], "r"); - FILE* tre = fopen(argv[3], "w"); + if (atoi(argv[1]) == 1){ + xor(argc, argv); + printf("Message successfully encrypted! \n"); + } else if (atoi(argv[1]) == 2) { + printf("Working \n"); + } else { + printf("WARNING no command specified!! \n"); + help(argv); + fprintf(stderr,"Exiting... \n"); + exit(EXIT_FAILURE); + } + + exit(EXIT_SUCCESS); +} + +void xor(int ac, char* av[]) { + + int opt; + int defout = 0; + char* output; + while ((opt = getopt(ac, av, "o:")) != -1) { + switch (opt) { + case 'o': + output = av[(optind-1)]; + defout = 1; + break; + default: + fprintf(stderr,"Usage %s %s [-o output] \n", av[0], av[1]); + exit(EXIT_FAILURE); + } + } + + if (defout == 0) { + printf("WARNING no command specified using default value critt \n"); + output = "critt"; + } + FILE* mess_uno = fopen(av[2], "r"); + FILE* mess_due = fopen(av[3], "r"); + FILE* critt = fopen(output, "w"); int i = 1; char a, b; while(i != EOF) { - i = fscanf(uno, "%c", &a); - fscanf(due, "%c", &b); + i = fscanf(mess_uno, "%c", &a); + fscanf(mess_due, "%c", &b); if(i != EOF) { - fprintf(tre, "%c", a^b); + fprintf(critt, "%c", a^b); } } - fclose(uno); - fclose(due); - fclose(tre); + fclose(mess_uno); + fclose(mess_due); + fclose(critt); + + return; +} + +void help(char* av[]) { + printf("ONETIMEBLUH USAGE: \n"); + printf("%s [COMMAND] [OPTIONS] \n \n", av[0]); + printf("COMMANDS: \n"); + printf("1 -> encrypt encrypt message (argv[1]) using key (argv[2]) \n"); + printf("2 -> keygen create key file \n \n"); + printf("OPTIONS \n"); + printf("-b number of bytes \n"); + printf("-o output name \n"); - return 0; + return; } -- cgit v1.2.3 From 56c7cadb8e8587b5ea382af1463f4aa0978891a2 Mon Sep 17 00:00:00 2001 From: Seppia Date: Sat, 11 Jun 2016 17:38:19 +0200 Subject: fixed pointer in keygen.c and onetimebluh.c --- keygen.c | 3 ++- onetimebluh.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/keygen.c b/keygen.c index f3793ea..b03b89c 100644 --- a/keygen.c +++ b/keygen.c @@ -6,6 +6,7 @@ int main(int argc, char* argv[]) { int opt; int nbytes = 256; + char* defname = "default.key"; char* output; int defout = 0; int defbyte = 0; @@ -43,7 +44,7 @@ int main(int argc, char* argv[]) { unsigned char key[nbytes]; RAND_bytes(key, nbytes); if (defout == 0) { - output = "default.key"; + output = defname; printf("No output name specified... using default value: default.key \n"); } FILE* file = fopen(output, "w"); diff --git a/onetimebluh.c b/onetimebluh.c index b8f3f8c..83cf93a 100644 --- a/onetimebluh.c +++ b/onetimebluh.c @@ -24,6 +24,7 @@ int main(int argc, char* argv[]) { void xor(int ac, char* av[]) { int opt; + char* defname = "critt"; int defout = 0; char* output; while ((opt = getopt(ac, av, "o:")) != -1) { @@ -40,7 +41,7 @@ void xor(int ac, char* av[]) { if (defout == 0) { printf("WARNING no command specified using default value critt \n"); - output = "critt"; + output = defname; } FILE* mess_uno = fopen(av[2], "r"); FILE* mess_due = fopen(av[3], "r"); -- cgit v1.2.3 From 6fb039da2b18c278817dfcdb240e3e5032902e0a Mon Sep 17 00:00:00 2001 From: Seppia Date: Sun, 12 Jun 2016 05:30:21 +0200 Subject: major code fix in ontimebluh.c 'comments coming soon' --- onetimebluh.c | 132 +++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 93 insertions(+), 39 deletions(-) diff --git a/onetimebluh.c b/onetimebluh.c index 83cf93a..98d0d3b 100644 --- a/onetimebluh.c +++ b/onetimebluh.c @@ -1,64 +1,115 @@ #include #include -#include +#include -void xor(int ac, char* av[]); +void xor(char* mess, char* keyf, char* outp); void help(char* av[]); int main(int argc, char* argv[]) { - if (atoi(argv[1]) == 1){ - xor(argc, argv); - printf("Message successfully encrypted! \n"); - } else if (atoi(argv[1]) == 2) { - printf("Working \n"); - } else { - printf("WARNING no command specified!! \n"); - help(argv); - fprintf(stderr,"Exiting... \n"); - exit(EXIT_FAILURE); - } - - exit(EXIT_SUCCESS); -} + int opt = 1; + int command = 0; + int comm = 0; + char* message = NULL; + char* keyfile = NULL; + char* output = NULL; + while (opt) { + int option_index = 0; + static struct option options[] = { + {"encrypt", required_argument, 0, 'e'}, + {"key-file", required_argument, 0, 'k'}, + {"key-gen", no_argument, 0, 'g'}, + {"help", no_argument, 0, 'h'}, + {"nbytes", required_argument, 0, 'b'}, + {"output", required_argument, 0, 'o'}, + {0, 0, 0, 0}, + }; -void xor(int ac, char* av[]) { + if ((opt = getopt_long(argc, argv, "b:e:ghk:o:", options, &option_index)) == -1) + break; - int opt; - char* defname = "critt"; - int defout = 0; - char* output; - while ((opt = getopt(ac, av, "o:")) != -1) { switch (opt) { + case 'b': + printf("Work in progress \n"); + break; + case 'e': + message = argv[optind-1]; + command++; + comm = 'e'; + break; + case 'g': + printf("Work in progress \n"); + command++; + comm = 'g'; + break; + case 'h': + help(argv); + command++; + break; + case 'k': + keyfile = argv[optind-1]; + break; case 'o': - output = av[(optind-1)]; - defout = 1; + output = argv[optind-1]; + break; + case '?': break; default: - fprintf(stderr,"Usage %s %s [-o output] \n", av[0], av[1]); + printf("carachter code returned 0%o \n", opt); + } + } + + if (command == 0) { + printf("No command called \n"); + exit(EXIT_FAILURE); + } else if (command > 1) { + printf("Multiple commands called (print usage)\n"); + exit(EXIT_FAILURE); + } + + if (optind < argc) { + printf("Too many arguments \n"); + exit(EXIT_FAILURE); + } + + if (comm == 'e') { + if (keyfile == NULL) { + printf("No key specified: exit! \n"); exit(EXIT_FAILURE); } + xor(message, keyfile, output); } - if (defout == 0) { - printf("WARNING no command specified using default value critt \n"); - output = defname; + exit(EXIT_SUCCESS); +} + +void xor(char* mess, char* keyf, char* outp) { + + char* defoutp = "critt"; + + if (outp == NULL) { + printf("WARNING no output name specified using default value 'critt' \n"); + outp = defoutp; } - FILE* mess_uno = fopen(av[2], "r"); - FILE* mess_due = fopen(av[3], "r"); - FILE* critt = fopen(output, "w"); + FILE* mex = fopen(mess, "r"); + FILE* keyx = fopen(keyf, "r"); + FILE* critt = fopen(outp, "w"); int i = 1; char a, b; + while(i != EOF) { - i = fscanf(mess_uno, "%c", &a); - fscanf(mess_due, "%c", &b); + i = fscanf(mex, "%c", &a); + fscanf(keyx, "%c", &b); if(i != EOF) { fprintf(critt, "%c", a^b); } } - fclose(mess_uno); - fclose(mess_due); + + fclose(mex); + fclose(keyx); fclose(critt); + printf("Message successfully encrypted \n"); + return; } @@ -66,11 +117,14 @@ void help(char* av[]) { printf("ONETIMEBLUH USAGE: \n"); printf("%s [COMMAND] [OPTIONS] \n \n", av[0]); printf("COMMANDS: \n"); - printf("1 -> encrypt encrypt message (argv[1]) using key (argv[2]) \n"); - printf("2 -> keygen create key file \n \n"); + printf("-e, --encrypt=FILE encrypt message (input) \n"); + printf("-h, --help print this help \n"); + printf("-g, --key-gen create key file \n \n"); printf("OPTIONS \n"); - printf("-b number of bytes \n"); - printf("-o output name \n"); + printf("-k, --key-file=KEY_FILE use key (input) \n"); + printf("-b, --nbytes=NUM number of bytes \n"); + printf("-o, --output=FILE output name \n \n"); + printf("Onetimebluh project repository at http://git.eigenlab.org/Seppia/onetimebluh \n"); return; } -- cgit v1.2.3 From fa813ece17a99fb0a0a177ad5a0bf4f11d9629d7 Mon Sep 17 00:00:00 2001 From: Seppia Date: Sun, 12 Jun 2016 06:40:34 +0200 Subject: merged keygen.c to onetimbluh.c --- onetimebluh.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/onetimebluh.c b/onetimebluh.c index 98d0d3b..3516cd3 100644 --- a/onetimebluh.c +++ b/onetimebluh.c @@ -1,8 +1,10 @@ #include #include #include +#include void xor(char* mess, char* keyf, char* outp); +void keyrand(int nb, char* outp); void help(char* av[]); int main(int argc, char* argv[]) { @@ -12,6 +14,8 @@ int main(int argc, char* argv[]) { char* message = NULL; char* keyfile = NULL; char* output = NULL; + int nbytes = -1; // must be resolved temporary workaround (ho sonno) + while (opt) { int option_index = 0; static struct option options[] = { @@ -29,7 +33,7 @@ int main(int argc, char* argv[]) { switch (opt) { case 'b': - printf("Work in progress \n"); + nbytes = atoi(argv[optind-1]); break; case 'e': message = argv[optind-1]; @@ -37,7 +41,6 @@ int main(int argc, char* argv[]) { comm = 'e'; break; case 'g': - printf("Work in progress \n"); command++; comm = 'g'; break; @@ -77,6 +80,8 @@ int main(int argc, char* argv[]) { exit(EXIT_FAILURE); } xor(message, keyfile, output); + } else if (comm == 'g') { + keyrand(nbytes, output); } exit(EXIT_SUCCESS); @@ -113,6 +118,42 @@ void xor(char* mess, char* keyf, char* outp) { return; } +void keyrand(int nb, char* outp) { + + char* defoutp = "default.key"; + + if((nb == -1) && (outp == NULL)) { + printf("WARNING no option specified usign default values... \n"); + nb = 256; + outp = defoutp; + } + if (nb < -1) { // orribile + printf("Negative byte value inserted! \n"); + printf("Exiting... \n"); + exit(EXIT_FAILURE); + } else if (nb != 0) { + if(nb == -1) { + printf("No byte number specified... using default value: 256 \n"); + nb = 256; + } + unsigned char key[nb]; + RAND_bytes(key, nb); + if (outp == NULL) { + outp = defoutp; + printf("No output name specified... using default value: default.key \n"); + } + FILE* file = fopen(outp, "w"); + fwrite(key, nb, 1, file); + fclose(file); + printf("Created key file %s of %d bytes \n", outp, nb); + } else { + printf("Byte number specified is 0. \n"); + printf("Doing nothing! \n"); + } + + return; +} + void help(char* av[]) { printf("ONETIMEBLUH USAGE: \n"); printf("%s [COMMAND] [OPTIONS] \n \n", av[0]); -- cgit v1.2.3 From 6d63e5552ae3199e83536fb631a15df1fa7d4e96 Mon Sep 17 00:00:00 2001 From: Seppia Date: Sun, 12 Jun 2016 16:44:31 +0200 Subject: added input file existance check in function xor --- onetimebluh.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/onetimebluh.c b/onetimebluh.c index 3516cd3..e6366f0 100644 --- a/onetimebluh.c +++ b/onetimebluh.c @@ -1,7 +1,10 @@ -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include void xor(char* mess, char* keyf, char* outp); void keyrand(int nb, char* outp); @@ -91,6 +94,12 @@ void xor(char* mess, char* keyf, char* outp) { char* defoutp = "critt"; + if (access(mess, F_OK) == -1) { + error(errno, errno, mess); + } else if (access(keyf, F_OK) == -1) { + error(errno, errno, keyf); + } + if (outp == NULL) { printf("WARNING no output name specified using default value 'critt' \n"); outp = defoutp; -- cgit v1.2.3 From 7d5ea469a8291062dbc6a8bbf9b3ca8942d41a21 Mon Sep 17 00:00:00 2001 From: Seppia Date: Sun, 12 Jun 2016 17:08:18 +0200 Subject: added decrypt option just for the feeling --- onetimebluh.c | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/onetimebluh.c b/onetimebluh.c index e6366f0..3b163c3 100644 --- a/onetimebluh.c +++ b/onetimebluh.c @@ -6,7 +6,7 @@ #include #include -void xor(char* mess, char* keyf, char* outp); +void xor(int ed, char* mess, char* keyf, char* outp); void keyrand(int nb, char* outp); void help(char* av[]); @@ -22,6 +22,7 @@ int main(int argc, char* argv[]) { while (opt) { int option_index = 0; static struct option options[] = { + {"decrypt", required_argument, 0, 'd'}, {"encrypt", required_argument, 0, 'e'}, {"key-file", required_argument, 0, 'k'}, {"key-gen", no_argument, 0, 'g'}, @@ -31,13 +32,18 @@ int main(int argc, char* argv[]) { {0, 0, 0, 0}, }; - if ((opt = getopt_long(argc, argv, "b:e:ghk:o:", options, &option_index)) == -1) + if ((opt = getopt_long(argc, argv, "b:d:e:ghk:o:", options, &option_index)) == -1) break; switch (opt) { case 'b': nbytes = atoi(argv[optind-1]); break; + case 'd': + message = argv[optind-1]; + command++; + comm = 'd'; + break; case 'e': message = argv[optind-1]; command++; @@ -77,12 +83,12 @@ int main(int argc, char* argv[]) { exit(EXIT_FAILURE); } - if (comm == 'e') { + if (comm == 'e' || comm == 'd') { if (keyfile == NULL) { printf("No key specified: exit! \n"); exit(EXIT_FAILURE); } - xor(message, keyfile, output); + xor(comm, message, keyfile, output); } else if (comm == 'g') { keyrand(nbytes, output); } @@ -90,9 +96,10 @@ int main(int argc, char* argv[]) { exit(EXIT_SUCCESS); } -void xor(char* mess, char* keyf, char* outp) { +void xor(int ed, char* mess, char* keyf, char* outp) { - char* defoutp = "critt"; + char* defenoutp = "critt"; + char* defdeoutp = "decritt"; if (access(mess, F_OK) == -1) { error(errno, errno, mess); @@ -101,8 +108,13 @@ void xor(char* mess, char* keyf, char* outp) { } if (outp == NULL) { - printf("WARNING no output name specified using default value 'critt' \n"); - outp = defoutp; + if (ed == 'e') { + printf("WARNING no output name specified using default value 'critt' \n"); + outp = defenoutp; + } else if (ed == 'd') { + printf("WARNING no output name specified usign default value 'decritt' \n"); + outp = defdeoutp; + } } FILE* mex = fopen(mess, "r"); FILE* keyx = fopen(keyf, "r"); @@ -122,7 +134,11 @@ void xor(char* mess, char* keyf, char* outp) { fclose(keyx); fclose(critt); - printf("Message successfully encrypted \n"); + if (ed == 'e') { + printf("Message successfully encrypted \n"); + } else if (ed == 'd') { + printf("Message successfully decrypted \n"); + } return; } @@ -167,6 +183,7 @@ void help(char* av[]) { printf("ONETIMEBLUH USAGE: \n"); printf("%s [COMMAND] [OPTIONS] \n \n", av[0]); printf("COMMANDS: \n"); + printf("-d, --decrypt=FILE decrypt message (input) same ad --encrypt, just for the feeling \n"); printf("-e, --encrypt=FILE encrypt message (input) \n"); printf("-h, --help print this help \n"); printf("-g, --key-gen create key file \n \n"); -- cgit v1.2.3 From aef49b9b56c02753e5619dd2532883e5d254886c Mon Sep 17 00:00:00 2001 From: Seppia Date: Sun, 12 Jun 2016 17:44:39 +0200 Subject: updated README.md --- README.md | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 418aec4..841ad3c 100644 --- a/README.md +++ b/README.md @@ -1 +1,40 @@ -Workbluhp in blogress!! +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. + +Usage +------- + +Example creates two keys of lenght 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 key --output encrypted-message +onetimebluh --decrypt encrypted-message --key-file key --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 ad --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 + +Onetimebluh project repository at http://git.eigenlab.org/Seppia/onetimebluh + +''' -- cgit v1.2.3 From 8f783454ebaf1582de901d5b955b0321292f131f Mon Sep 17 00:00:00 2001 From: Seppia Date: Sun, 12 Jun 2016 17:48:32 +0200 Subject: fixed README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 841ad3c..0725b82 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,16 @@ Usage Example creates two keys of lenght 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 key --output encrypted-message onetimebluh --decrypt encrypted-message --key-file key --outptut decrypted-message -''' +``` -You can print the help by running 'onetimebluh --help' or 'onetimebluh -h'. +You can print the help by running `onetimebluh --help` or `onetimebluh -h`. -''' +``` ONETIMEBLUH USAGE:; onetimebluh [COMMAND] [OPTIONS] ... @@ -37,4 +37,4 @@ OPTIONS Onetimebluh project repository at http://git.eigenlab.org/Seppia/onetimebluh -''' +``` -- cgit v1.2.3 From e43d3106afbead6dcfc172b0edc037bb2d5ebb83 Mon Sep 17 00:00:00 2001 From: Seppia Date: Sun, 12 Jun 2016 17:58:15 +0200 Subject: deleted a tab in onetimebluh.c --- onetimebluh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onetimebluh.c b/onetimebluh.c index 3b163c3..2aafbd6 100644 --- a/onetimebluh.c +++ b/onetimebluh.c @@ -146,7 +146,7 @@ void xor(int ed, char* mess, char* keyf, char* outp) { void keyrand(int nb, char* outp) { char* defoutp = "default.key"; - + if((nb == -1) && (outp == NULL)) { printf("WARNING no option specified usign default values... \n"); nb = 256; -- cgit v1.2.3