GithubHelp home page GithubHelp logo

rev22 / curve255js Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 8.0 1.89 MB

Javascript implementation of Curve25519, the elliptic cryptography function by Daniel J. Bernstein

Home Page: http://rev22.github.io/curve255js

JavaScript 78.84% CoffeeScript 21.16%

curve255js's People

Contributors

rev22 avatar ryancdotorg 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

Watchers

 avatar  avatar  avatar

curve255js's Issues

Verifying?

Is it possible to verify with this library also?

something like verify(signature, message, publicKey);

Question: cannot match public key with that from Whisper and Donna

As an example, I use the private key

a0e7cb1a31ef588cf7c0a7d537a1a02d72d47667a7964f1d8e35f904e95f3d65 (hex)

With the Whisper implementation (curve25519-java at https://github.com/WhisperSystems/curve25519-java) and the Donna implementation (https://github.com/agl/curve25519-donna) of Curve 25519 I get the same result when computing the corresponding public key. The result (public key) is:

8b61c39e39eed90fc4c1cec39a4bea0db61dfbaa3753c1cd38df8a570a67a241 (hex)

However, I am unable to reproduce this result with curve255.js. I am a beginner at JavaScript. Here is the JavaScript code I thought would reproduce the results of Whisper and Donna implementations:

var privHex = "a0e7cb1a31ef588cf7c0a7d537a1a02d72d47667a7964f1d8e35f904e95f3d65";
var priv = c255lhexdecode(privHex);
var pub = curve25519(priv);
var pubHex = c255lhexencode(pub);
console.log("pubHex: " + pubHex);

The output I get is

pubHex: 04a4b47444f345546698dcfc885a3f087ac979f53a1eb7fc55e9164105f37c13

Not the expected 8b61.. How come? I am probably doing something wrong? I tried several variants of the above with no success.

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.