Code Monkey home page Code Monkey logo

Comments (7)

lt avatar lt commented on August 27, 2024

Hi,

This library is for key exchange, for signing you want to use the Poly1305 library.

https://github.com/lt/PHP-Poly1305

Cheers.

from php-curve25519.

 avatar commented on August 27, 2024

Hello,

Thank you for your prompt answer. I am porting TextSecure to PHP and it seems your library is missing some functions which are needed. Please see:

https://github.com/WhisperSystems/TextSecure/blob/master/libaxolotl/src/main/java/org/whispersystems/libaxolotl/ecc/Curve25519.java

The needed functions are:

calculateAgreement()
generatePublicKey()
generatePrivateKey()
calculateSignature()
verifySignature()

Any pointers on how to implement these functions in your Curve25519 implementation?

Many thanks.

from php-curve25519.

lt avatar lt commented on August 27, 2024

Public key signing can be done with ed25519, but not with this library. (Twisted Edwards curves are a bit more complicated than I have time for right now, it's on my list, but I'm quite busy with some other projects).

A cursory search shows there is a PHP implementation here: https://github.com/trianglman/sqrl/blob/master/src/Trianglman/Sqrl/Ed25519/Crypto.php

It uses BCMath though, so it's going to be incredibly slow.

from php-curve25519.

 avatar commented on August 27, 2024

Thank you! I'll have a look at it.

from php-curve25519.

 avatar commented on August 27, 2024

Sorry, one last question:

Based on your good information I have found some Ed25519 libraries which look usable for the signature calculations. However, first I need to convert Curve25519 keys into Ed25519 keys. Any pointers how to implement this in PHP?

Found more info here: http://crypto.stackexchange.com/questions/13077/can-curve25519-keys-be-used-with-ed25519-keys

Thanks!

from php-curve25519.

lt avatar lt commented on August 27, 2024

Do you really need to convert the keys? I.e. do you need to use the same key for Curve25519 and Ed25519 operations?

Ed25519 keys can be generated independently from random bytes, check out the NaCl reference implementation

If you really need to "convert" them (there is no standard process for this, as far as I am aware), you could seed the sha512 step with the Curve25519 private key.

from php-curve25519.

 avatar commented on August 27, 2024

I think I have to yes. TextSecure made some changes it seems: https://github.com/WhisperSystems/TextSecure-Browser/blob/master/nacl/ed25519/additions/curve_sigs.c

For now my work-around is to compile the C source and call it from PHP. Not pretty but porting the C code to PHP with my limited knowledge of what is happening there is probably not a good idea ;)

Once again thanks for your help. Your library is working excellent!

from php-curve25519.

Related Issues (7)

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.