Code Monkey home page Code Monkey logo

Comments (7)

AlexanderWillner avatar AlexanderWillner commented on September 13, 2024

Hey, nice idea. Maybe the mailing list is better to discuss this:
http://list.openpgpjs.org/

from openpgpjs.

seancolyer avatar seancolyer commented on September 13, 2024

Hm, does it vary within one machine that much? If that's the case then it's almost certainly a difference in how long it takes to generate the random values. Unfortunately the window.crypto.getRandomValues does not provide us a lot of insight into the progress it is making. A more creative solution might be necessary for this...

from openpgpjs.

Nilos avatar Nilos commented on September 13, 2024

I am pretty sure this is not possible due to the way keys are generated.

If you generate a key, he basically takes two random numbers and searches for the next bigger prime.
Because you do not know how far away the next bigger prime is, you can not know how long it will take until you get there.
The only thing you can display is when the first prime was found but there is no way in telling how long the second one will take. It often occured to me that the first prime took 2 seconds and the second took 20 seconds.

As for that I think it is impossible. There is a reason enigmail for example does not have a bar either. (To say the truth: it has a bar, but the bar does not move fluently and just gets stuck at one point)

from openpgpjs.

patcon avatar patcon commented on September 13, 2024

Is it possible to profile the system with some simpler calculations, time how long that takes, and use it to "fake" a progress percentage?

from openpgpjs.

torw4897dfz avatar torw4897dfz commented on September 13, 2024

@patcon

I am trying this by letting browser create a 128bit key which is pretty fast any browser. I am not faking a percentage but telling user that the key creation might take a minute or a few minutes etc...

from openpgpjs.

patcon avatar patcon commented on September 13, 2024

Nice! 👍

from openpgpjs.

tanx avatar tanx commented on September 13, 2024

Not relevant anymore as we use native keygen now in most cases.

from openpgpjs.

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.