Add set 1 readme, misc. makefile changes
x1phosura x1phosura@x1phosura.zone
Wed, 27 Apr 2022 01:07:07 -0700
4 files changed,
48 insertions(+),
4 deletions(-)
M
.gitignore
→
.gitignore
@@ -1,3 +1,5 @@
# general ignore patterns */bin/* +# set 1 ignores +set1/aes-libs/*
M
set1/Makefile
→
set1/Makefile
@@ -2,16 +2,30 @@ CC = gcc
CFLAGS = -Wall -Wpedantic -Wextra -std=c99 -fstack-protector-all \ -fdiagnostics-color=auto DEBUG = -0g -ggdb -LINK = +LINK = +LIB_INC = SRC_DIR = src OUT_DIR = bin -TARGETS = base64 fixed-xor char-freq-analize +TARGETS = base64 fixed-xor char-freq-analyze repeating-key-xor aes-ecb all: $(TARGETS) +# TODO toggle mbedtls or tiny-AES-c +#EXT_INCLUDES = -Iaes-libs/mbedtls/include/ +#EXT_LIBS = -Laes-libs/mbedtls/library +#LDLIBS = -lmbedcrypto +# +EXT_INCLUDES = -Iaes-libs/tiny-AES-c +#EXT_LIBS = -Laes-libs/tiny-AES-c +#LDLIBS = -laes + +#%: $(SRC_DIR)/%.c %: $(SRC_DIR)/%.c - $(CC) $(CFLAGS) $(LINK) $< -o $(OUT_DIR)/$@ + $(CC) $(CFLAGS) -o $(OUT_DIR)/$@ $< + +aes-ecb: $(SRC_DIR)/aes-ecb.c + $(CC) $(CFLAGS) $(EXT_INCLUDES) $(EXT_LIBS) -o $(OUT_DIR)/$@ $< $(LDLIBS) clean: $(RM) *.o $(OUT_DIR)/*
A
set1/README.md
@@ -0,0 +1,28 @@
+# Set 1 + +Note: may need to `pip install jinja2` in order to `make` mbedtls + +### Challenge 1: Convert hex to base64 +Provided by base64.c + +### Challenge 2: Fixed XOR +Provided by fixed-key-xor.c + +### Challenge 3: Single-byte XOR cipher +Provided by ch3-brute-force.c and char-freq-analyze.c + +### Challenge 4: Detect single-character XOR + + +### Challenge 5: Implement repeating-key XOR +Provided by repeating-key-xor.c + +### Challenge 6: Break repeating-key XOR + + +### Challenge 7: AES in ECB mode + + +### Challenge 8: Detect AES in ECB mode + +
M
set1/src/char-freq-analyze.c
→
set1/src/char-freq-analyze.c
@@ -19,7 +19,7 @@ }
for (i = 0; i < sizeof(byte_freq); ++i) { if (byte_freq[i] != 0) { - printf("%x occurs %d times\n", i, byte_freq[i]); + printf("%lx occurs %d times\n", i, byte_freq[i]); } }