1

I trying to use SRP algorithm but I have some questions:

  1. Is that a good choice to use for registration and authorization SRP algorithm with SSL/TLS? And for all other transmission using just SSL/TLS? I will use C# Sockets for implementation.

  2. How to generate g, k, N? Is it safe to use these like app constants?

  3. Is that SRP algorithm right?

    //M-modulus, g-generator, k-multiplier, I-username, p-password, s-salt, v-pass verifier

    Registration:

    Client: s = randomString(); x = Hash(s, p); v = g^x %N;

    sendToServer(I, s, v);

    Server: save(I, s, v);

    Authorization:

    Client: a = random(); A = g^a %N;

    sendToServer(I, A);

    Server: if(A != 0) { b=random(); B = k*v + g^b %N;}

    sendToClient(B, s);

    u = Hash(A, B);

    if(u == 0) abortConnection();

    Client: if(B == 0) abortConnection();

    u = Hash(A, B);

    if(u == 0) abortConnection();

    x = Hash(s, p);

    S = ((B - k*(g^x %N)) ^ (a + u*x)) %N;

    K = Hash(S);

    Mc = Hash( Hash(N) XOR Hash(g), Hash(I), s, A, B, K);

    sendToServer(M);

    Server: S = ((A*(v^u %N)) ^ B) %N; K = Hash(S);

    Ms = Hash( Hash(N) XOR Hash(g), Hash(I), s, A, B, K);

    if(Mc == Ms) {Rs = Hash(A, M, K); sendToClient(Rs);}

    Client: Rc = Hash(A, M, K);

    if(Rc == Rs) ALL_OK();

  • You appear to have 1. backwards. SRP usually can't be used for registration because there's not yet a shared password. – user49075 Feb 15 '15 at 23:42
  • 1
    This was also posted to SO. Please dont post to multiple sites. – mikeazo Feb 16 '15 at 11:37
  • @RickyDemer ok, can you explain in more detail? If you about registration step: "Security is provided by the complexity of the operations of the discrete logarithm - get x of v = g^x %N knowing v, g, N."(only russian source). – user2274492 Feb 16 '15 at 19:12
  • @RickyDemer Can you explain more understandable? Because I think I not quite understood your comment. – user2274492 Feb 17 '15 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.