summaryrefslogtreecommitdiff
path: root/set2
diff options
context:
space:
mode:
Diffstat (limited to 'set2')
-rw-r--r--set2/Makefile6
-rw-r--r--set2/task15.c21
2 files changed, 25 insertions, 2 deletions
diff --git a/set2/Makefile b/set2/Makefile
index b0c56a2..1f8f890 100644
--- a/set2/Makefile
+++ b/set2/Makefile
@@ -3,11 +3,13 @@ CC=gcc
CFLAGS := -g $(CFLAGS)
CLIBS=`pkg-config --cflags --libs libcrypto`
-all: task9 task10
+all: task9 task10 task15
task9:
$(CC) $(CFLAGS) task9.c $(LIB) $(CLIBS) -o task9
task10:
$(CC) $(CFLAGS) task10.c $(LIB) $(CLIBS) -o task10
+task15:
+ $(CC) $(CFLAGS) task15.c $(LIB) $(CLIBS) -o task15
clean:
- rm task9 task10
+ rm task9 task10 task15
diff --git a/set2/task15.c b/set2/task15.c
new file mode 100644
index 0000000..504eabb
--- /dev/null
+++ b/set2/task15.c
@@ -0,0 +1,21 @@
+#include "../lib/lib2.h"
+
+
+
+
+int main(int argc, char **Argv)
+{
+
+
+ char *padded_text = pkcs7_padding("YELLOW SUBMARINE", 16, 20);
+ char *unpadded = malloc(100);
+ //char *padded_text = "ICE ICE BABY\x01\x02\x03\x04";
+ printf("padded text: %s\n", padded_text);
+ int result = valid_pkcs7_padding(padded_text, 20,unpadded, 20);
+
+ if(result)
+ printf("valid padding: %s\n", unpadded);
+ else
+ printf("invalid padding\n");
+
+}