Code Monkey home page Code Monkey logo

Comments (17)

indutny avatar indutny commented on August 20, 2024

What you want is called http://en.wikipedia.org/wiki/Integrated_Encryption_Scheme . I think we have at least one module mentioned in readme of elliptic.

Please let me know if there is anything else I could help you with.

from elliptic.

beastybeast avatar beastybeast commented on August 20, 2024

Think you misunderstood me as I am only talking about ECC encryption with a public private key pair when using the ed25519 curve. E.g. not symmetric encryption and then public private encryption as under the Integrated Encryption Scheme.

I am not using the ed25519 curve for signing - but all info on the web states the ed25519 curve is used for signing. No where is there any info about using the ed25519 curve for ECDH.

I have tested that it works fine with your library but think my question is if this is then secure?

from elliptic.

beastybeast avatar beastybeast commented on August 20, 2024

Also see my question here:

http://stackoverflow.com/questions/28795706/ed25519-ecdh-encryption-possible-and-safe

from elliptic.

indutny avatar indutny commented on August 20, 2024

I think it should be possible, though, you'll need to use curve25519 and ed25519 for ECDSA and ECDH.

from elliptic.

indutny avatar indutny commented on August 20, 2024

Regarding security - there are tons of side-channel leaks, but other than that - there should not be other problems.

from elliptic.

beastybeast avatar beastybeast commented on August 20, 2024

OK - for now I will then use seperate curves for encryption and signing!

BTW: Why do this code fail when I select curve25519 (works fine for ed25519)?

var eccdh = new ellipticjs.ec('curve25519');
var asymkeysdh;
asymkeysdh = eccdh.genKeyPair();
var keypublicdh = asymkeysdh.getPublic(true, 'hex');

It fails because getY is undefined here:

if (compact) {
    var res = [ this.pub.getY().isEven() ? 0x02 : 0x03 ].concat(x);
  } else {
    var y = this.pub.getY().toArray();

from elliptic.

indutny avatar indutny commented on August 20, 2024

It doesn't fail for me, what elliptic version are you using?

from elliptic.

beastybeast avatar beastybeast commented on August 20, 2024

Will test with the latest version ASAP.

BTW: What is the diff between the small and big distribution?

from elliptic.

indutny avatar indutny commented on August 20, 2024

small distribution does not include precomputed points for sepc256k1 curve. Technically they could be computed in runtime, but it takes some time and it might be useful for bitcoin apps to just distribute it with precomputed points.

from elliptic.

beastybeast avatar beastybeast commented on August 20, 2024

Have now testet the latest version 3.03 with the same result => getY is not defined.

Please note that I run it directly in the browser and just took the file elliptic,js from the dist folder!

from elliptic.

pohutukawa avatar pohutukawa commented on August 20, 2024

Don't know whether that's the reason for the problem you're having. But the Ed25519 private "key" is actually a "key seed" that's used to derive the private and public keys (internally). Benefit for that is that it's impossible to actually choose an illegal key (e. g. not adhering to the pre-defined bit mask on the first/last few bits as Curve25519 uses).

from elliptic.

beastybeast avatar beastybeast commented on August 20, 2024

Do not think that is the problem here. I actually had some problems to understand the concept to begin with ;-)

from elliptic.

indutny avatar indutny commented on August 20, 2024

@beastybeast exactly this code works for me in a browser too.

from elliptic.

beastybeast avatar beastybeast commented on August 20, 2024

I have now done some testing with the code and it works in Firefox but does not work in Chrome (Chromium) where getY is undefined - very strange!

Testing is done under Ubuntu 14.10 (64 bit), FF 36, Chromium Version 40.0.2214.11

from elliptic.

beastybeast avatar beastybeast commented on August 20, 2024

Now testet under Windows 8.1 and both IE, FF and Chrome works fine.

So the only problem is my development platform Chromium Version 40.0.2214.11 under Ubuntu 14.10 (64 bit)

NB: Have not tested Chromium under Windows!

from elliptic.

beastybeast avatar beastybeast commented on August 20, 2024

Chromium version 43.0.2325.0 works under Windows 8.1 (64 bit)

So the conclusion must be that there is a bug in Chromium Version 40.0.2214.11 - strange error!

Will try to upgrade my Chromium Linux version and see if it helps!

from elliptic.

beastybeast avatar beastybeast commented on August 20, 2024

Installed Chrome Version 41.0.2272.76 (64-bit) and it works fine under Ubuntu!

from elliptic.

Related Issues (20)

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.