Coder Social home page Coder Social logo

glusk / srp6-variables Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 202 KB

A Java library of cryptographic primitives required for the implementation of the SRP-6 protocol.

License: MIT License

Shell 0.69% Java 99.31%
srp-6a srp object-oriented key-exchange-protocol authentication java rfc-5045 rfc-2945

srp6-variables's Issues

Repo badges

Lets add the following:

  • Travis build status
  • Codacy project report
  • Coveralls coverage
  • LoC + HoC

Add WoW Test Vectors

Add WoW authentication SRP-6 test vectors, dumped from a private server session.

SRP-6 variables todo list

Implement:

  • u Random scrambling parameter -- #16
  • A,B Public ephemeral values -- #22 #24
  • a,b Private ephemeral values -- #26
  • x Private key (derived from p and s) -- #12
  • v Password verifier -- #9
  • k Multiplier parameter (k = H(N, g) in SRP-6a, k = 3 for legacy SRP-6) -- #30

  • M1,M2 Proofs of session key -- #49 #43
  • S Shared secret -- #35 #37
  • K Session key -- #41

  • Basic usage README section with code examples -- #52

Add 2 more Bytes implementations

We want something like this:

// SRP6IntegerVariable x = ...
// SRP6IntegerVariable y = ...

// bytes of x in BIG_ENDIAN byte order
Bytes b1 = new SRP6IntegerVariableBytes(x, ByteOrder.BIG_ENDIAN);
// bytes of x in BIG_ENDIAN byte order, zero-padded to the byte length of y
Bytes b2 = new SRP6IntegerVariableBytes(x, ByteOrder.BIG_ENDIAN, y);

instead of in addtion to this:

// SRP6IntegerVariable x = ...
Bytes b1 = x.bytes(ByteOrder.BIG_ENDIAN);
Bytes b1 = x.bytes(ByteOrder.BIG_ENDIAN, 32);

in order to enhance object composition and defer execution.

Motivation

Some of the existing open source SRP-6 Java libraries include:

What I've found is that such libraries are not easy to extend.

Most of them work only with big-endian byte array representations and some of them aren't compliant with RFC 5054.

With that in mind, I decided to create a library of basic building blocks (SRP-6 Variables) that one can use to implement the protocol.

Don't use exceptions for flow control

Currently, we have the following conde snippet as part of our README.md:

if (!(cM2.equals(M2))) {
    throw new SRP6Exception("Server proof mismatch!");
}

This is not an exceptional behaviour. It's perfectly normal that an SRP6 authentication fails (ie, wong credentials). Let's not use exceptions for flow control in our examples. Fix the example; re-think where to throw an exception and what type.

Should be done after/with #78.

Fix SRP6RandomEphemeral

SRP6RandomEphemeral was first implemented as part of #26.

Remove synchronized from method declaration. In project Loom, a synchronized block or a method blocks the underlying platform thread. Assuming SRP6 authentication runs in a virtual thread, this could potentially slow the application.

Fix the typo in the code comment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.