summaryrefslogtreecommitdiff
path: root/set5
diff options
context:
space:
mode:
authorBenedict <benedict@0xb8000.de>2016-12-13 20:15:14 +0100
committerBenedict <benedict@0xb8000.de>2017-02-21 13:00:26 +0100
commitcfe5cbfd43b5c3e18737fc2707d351919ddf4aa2 (patch)
treeeee1488688f09d1ee5d7bc39f27375c359c33686 /set5
parent6619623d75b8ace7f70f64dc683c5e9193aa6aea (diff)
set5: task39: completed
Diffstat (limited to 'set5')
-rw-r--r--set5/task38.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/set5/task38.c b/set5/task38.c
new file mode 100644
index 0000000..889fe11
--- /dev/null
+++ b/set5/task38.c
@@ -0,0 +1,35 @@
+#include "../lib/lib.h"
+#include "../lib/lib2.h"
+#include "../lib/lib3.h"
+#include "../lib/lib4.h"
+#include "../lib/lib5.h"
+#include <time.h>
+
+int main()
+{
+ struct srp_context srpc;
+ char *email = "test@example.com";
+ char *password = "12345";
+ //char *password = passwords[index];
+ char sK[41];
+ char cK[41];
+ out = BIO_new(BIO_s_file());
+ BIO_set_fp(out, stdout, BIO_NOCLOSE);
+
+ ctx = BN_CTX_new();
+ printf("using password: %s\n", password);
+ srp_context_init(&srpc);
+ srp_server_init(email, password, &srpc);
+ srp_client_send1(email, &srpc);
+ ssrp_server_send1(&srpc);
+ // inject some new MITM params here
+ BN_pseudo_rand(srpc.b, 1024, -1, -1);
+ BN_mod_exp(srpc.B, srpc.g, srpc.b, srpc.N, ctx);
+ BN_pseudo_rand(srpc.u, 1024, -1, -1);
+ ssrp_compute_uH(&srpc);
+ ssrp_client_prepare_k(&srpc, password);
+ hex_binary_to_string(srpc.client_K, cK, 20);
+ printf("hash sended from client: %s\n", cK);
+ ssrp_dictionary_attack(&srpc);
+ // set client session key also to 0
+}