From cfe5cbfd43b5c3e18737fc2707d351919ddf4aa2 Mon Sep 17 00:00:00 2001 From: Benedict Date: Tue, 13 Dec 2016 20:15:14 +0100 Subject: set5: task39: completed --- set5/task38.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 set5/task38.c (limited to 'set5') 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 + +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 +} -- cgit v1.2.3-70-g09d2