Giter Club home page Giter Club logo

Comments (4)

Stebalien avatar Stebalien commented on July 20, 2024 1

Oh, I just looked and realized libp2p-crypto already has GenerateKeyPair(), which does exactly that :P
Are there any concerns with that, or is this perfectly fine?

That should work. We often specify a "test" source of randomness to make the tests faster but we really shouldn't be doing that in examples.

Also, we should probably use a 2048 bit key (instead of 1024 bits). Every time we use 1024, we should explicitly say "not safe for production use".

from go-ipns.

Mr0grog avatar Mr0grog commented on July 20, 2024

Happy to propose a PR with the above if that’s good, but it would be nice if we could do the key generation without relying on two other packages.

from go-ipns.

Stebalien avatar Stebalien commented on July 20, 2024

Well, we don't really need go-ipfs-util (can use crypto/rand.Reader). However, key generation is a separate concern so will probably require the additional import.

from go-ipns.

Mr0grog avatar Mr0grog commented on July 20, 2024

we don't really need go-ipfs-util (can use crypto/rand.Reader)

Oh, I just looked and realized libp2p-crypto already has GenerateKeyPair(), which does exactly that :P
Are there any concerns with that, or is this perfectly fine?

privateKey, publicKey, err := crypto.GenerateKeyPair(crypto.RSA, 1024)

However, key generation is a separate concern so will probably require the additional import.

Oh, d'oh, I guess it has to be a Libp2p PrivKey, so you can’t really get away from that requirement. Boo to me for not looking that up first. 👍

from go-ipns.

Related Issues (10)

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.