Giter Club home page Giter Club logo

curve25519-elisabeth's People

Contributors

dependabot[bot] avatar isislovecruft avatar str4d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

curve25519-elisabeth's Issues

Set up as a Java module

An important part of a good cryptographic library is its API. By and large, we only want downstream libraries and applications to use the interface that we have defined, because it helps to ensure that (often security-critical) invariants are enforced (e.g. that an invalid Ristretto group element is unrepresentable, because the only way to instantiate one is through the DECODE or FROM_UNIFORM_BYTES functions).

Currently, the way we enforce the API is by keeping all internal classes inside the same package as the API, so that they can be package-private. Java only provides two levels of visibility for classes - public, and package-private - so this is the only way to keep the implementation accessible to the classes providing the API, without giving the implementation public visibility.

However, this still suffers from reflection: anyone with reflection priviledges can make any class (or its members) visible. Java 7 and 8 provide no way for libraries to override this; reflection can only be disabled at the system level via security permissions.

Java 9 introduced the concept of modules, which enable strong encapsulation by preventing reflection into a package by default. Libraries can use this to export their API without exposing any internals, and reflection for exported APIs is disabled. Only when a package is "opened" can reflection be performed. This can be overridden by the user at the system level (by passing flags to the JVM), but it's a significantly improved barrier, and more effectively encourages use of the intended API.

This issue requires:

  • Creating a module-info.java exporting the intended API.
  • Configuring the build system to compile module-info.java targeting Java 9, while leaving the rest of the codebase targeting Java 7.
  • Testing that the module correctly prevents reflection on Java 9 and above.

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.