From b2df2a824a78f2beebdbc0c0d5b08bb0bd566c4b Mon Sep 17 00:00:00 2001 From: chupax Date: Tue, 20 Aug 2024 09:50:20 -0500 Subject: First commit Generates one random password. 5 digit number, random word w/ random case, and random characters --- Makefile | 2 + output | Bin 0 -> 16136 bytes password.c | 89 + word_list.txt | 10000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 10091 insertions(+) create mode 100644 Makefile create mode 100755 output create mode 100644 password.c create mode 100644 word_list.txt diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..013d033 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +password: password.c + gcc -o output password.c -lsodium diff --git a/output b/output new file mode 100755 index 0000000..4314952 Binary files /dev/null and b/output differ diff --git a/password.c b/password.c new file mode 100644 index 0000000..e028b61 --- /dev/null +++ b/password.c @@ -0,0 +1,89 @@ +// https://github.com/dwyl/english-words + +#include +#include +#include +#include +#include +#include //To Upper + + +long count_lines(FILE *File) { // Accepts file as input + char c; + long line_counter = 0; + while ((c = getc(File)) != EOF) { + if (c == '\n') { + line_counter++; // Increment when each line number is passed + } + } + return(line_counter); // Return the found value +} + +void randomize_case(char *a) { // Accepts a string as input + for (int i = 0; i < strlen(a); i++) { // Loop through the length of the string + int coin = randombytes_uniform(2); // Decide if the current character will be capitalized or lowercase + if (coin == 1) { + a[i] = toupper(a[i]); // Change current character into a capital + } + } +} + +void generate_integers(void) { // Generates a string of random integers + int length = 5; // TO-DO: Make random eventually + for (int i=0; i