Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
*~ | ||
/dictionaries/reductor.py | ||
/brute_venv/ | ||
/html/ | ||
/src/__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
VENV=brute_venv | ||
INVENV = $(shell pip3 -V | grep $(VENV)) | ||
current_dir = $(shell pwd) | ||
|
||
prereqs: venvcheck FORCE | ||
pip install -r requirements.txt | ||
|
||
venv: FORCE | ||
python3 -m venv $(VENV) | ||
|
||
docs: | ||
pdoc --html ./src/brutus.py --force | ||
|
||
venvcheck: | ||
ifeq ($(INVENV),) | ||
$(error You should only run this from within the venv. Use '. ./$(VENV)/bin/activate') | ||
else | ||
@echo "venv check passed\n" | ||
endif | ||
|
||
test/testbin: test/testbin.c | ||
$(CC) -o test/testbin test/testbin.c | ||
|
||
test: FORCE venvcheck test/testbin | ||
py.test -v tests/ | ||
|
||
|
||
|
||
|
||
FORCE: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pdoc3 | ||
pytest | ||
pexpect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import pytest | ||
import sys | ||
sys.path.append("./src/") | ||
|
||
import brutus | ||
|
||
# You can import your source files here, too | ||
# So you can test the functions you create |
BIN
+8.38 KB
test/testbin
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <ctype.h> | ||
#include <string.h> | ||
#include <time.h> | ||
|
||
int main(void) | ||
{ | ||
char* actualPw = "swordfish"; //Of course | ||
char guess[20]; | ||
printf ("Enter the password: "); | ||
fgets ( guess, 80, stdin ); | ||
|
||
//Strip the \n, replace with 0 | ||
guess[strcspn(guess, "\n")] = 0; | ||
printf("You entered [%s]\n",guess); | ||
if(strcmp(guess,actualPw)==0){ | ||
printf("Password Correct\n"); | ||
}else{ | ||
printf("Password Incorrect\n"); | ||
} | ||
} |