0

I am trying to determine how much entropy is going into a specific CSPRNG in JavaScript, but I can't seem to find a pure-JS client-side implementation of an entropy estimator.

So, I need to find a way to estimate entropy locally with pure JavaScript.

If it helps, the entropy is in an array which should be easy to manipulate.

kelalaka
  • 49,797
  • 12
  • 123
  • 211

1 Answers1

3

If someone chooses to run your program with a seed that you can't predict but an adversary can, you won't be able to tell. There is no way around this: nothing about the software can tell you what an adversary does or doesn't know; you can only use cryptography to ensure that if an adversary doesn't know a key and the message, then they can't decrypt the message.

In general, to estimate the entropy of a system, you need to have a model for how the system behaves. This is how all entropy estimation tools work: they posit some parametric model for how the input data might have been generated; then use the data to fit parameters for that model; and finally spit out the entropy of the model with the fitted parameters.

Squeamish Ossifrage
  • 49,816
  • 3
  • 122
  • 230