News for hackers. Stuff that matters.
Re:Should random() be banned? by mmazing on Thursday February 11, 2021 @06:56PM (#26109194)
That's all great and makes sense, but ...

What does that have to do with being verbose and letting developers know they are using an insecure method when it would apply to them?

If I'm writing code and using rng for gameplay variety, and then I notice that I have to use a function called "insecureRandom", at the very least I'm going to read up on an interesting aspect of computing and be a little more informed at the end of the day.

Re:Should random() be banned? by Macha on Thursday February 11, 2021 @07:41PM (#26109511)
Because suitability for use in secure algorithms is just one property of the random number generator. At what point do we then decide it needs to be uniformInsecureBoundedRandom?

Why don't we apply the same logic to string comparisons. Should we replace String.equals with String.shortcuttableEquals()? Since there's plenty of circumstances where that is inappropriate for crypto uses also.

What about other functions with important caveats? Should we have mailGmailMightReject()? fsyncCantFixHardware()? file.existsAtCurrentInstant()?

Re:Should random() be banned? by striking on Thursday February 11, 2021 @07:46PM (#26109549)
I actually don't hate `file.existsAtCurrentInstant`. `file.exists` is so misused.

Maybe functions suitable for crypto use should be in their own "crypto primitives" package.

Re:Should random() be banned? by TheCoelacanth on Thursday February 11, 2021 @08:02PM (#26109674)
I would prefer something like file.existedAtSomePointInTheRecentPast