From bd40b9cd4f6436df1b249b0904845a404b903ffd Mon Sep 17 00:00:00 2001 From: Benedict Date: Mon, 1 Aug 2016 15:24:33 +0200 Subject: compledted set2, challenge 16 --- set2/Makefile | 6 ++++-- set2/task16.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 set2/task16.c (limited to 'set2') diff --git a/set2/Makefile b/set2/Makefile index a2d66d4..914471a 100644 --- a/set2/Makefile +++ b/set2/Makefile @@ -3,7 +3,7 @@ CC=gcc CFLAGS := -g $(CFLAGS) CLIBS=`pkg-config --cflags --libs libcrypto` -all: task9 task10 task11 task12 task13 task15 +all: task9 task10 task11 task12 task13 task15 task16 task9: $(CC) $(CFLAGS) task9.c $(LIB) $(CLIBS) -o task9 @@ -17,5 +17,7 @@ task13: $(CC) $(CFLAGS) task13.c $(LIB) $(CLIBS) -o task13 task15: $(CC) $(CFLAGS) task15.c $(LIB) $(CLIBS) -o task15 +task16: + $(CC) $(CFLAGS) task16.c $(LIB) $(CLIBS) -o task16 clean: - rm task9 task10 task11 task12 task13 task15 + rm task9 task10 task11 task12 task13 task15 task16 diff --git a/set2/task16.c b/set2/task16.c new file mode 100644 index 0000000..f60205e --- /dev/null +++ b/set2/task16.c @@ -0,0 +1,48 @@ +#include "../lib/lib2.h" +#include "../lib/lib.h" +/** + * produces an identical bit error in the following block + * this means: we can control the whole content of the following + * block, when the counterpart decrpyts it + * If there is a 0 in the second block and we want a 1, then flip + * the bit in the prior block at the same position + * If there is a 0 and we want a null, than do nothing + * For one respectivally. + * + * Since ; and = are escaped we need charecters so that with one flip + * we can get ; and =. + * for ; use : in the plaintext. in the ciphtertext we need to flip the + * last bit of : and the resulting plaintext get ; + * for = we use <. we also need to flip the last bit + * + * so out plaintext we give the orcale function is :admin