Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin Random Number should discuss Secure Random #6762

Closed
JLLeitschuh opened this issue Apr 19, 2019 · 5 comments
Closed

Kotlin Random Number should discuss Secure Random #6762

JLLeitschuh opened this issue Apr 19, 2019 · 5 comments

Comments

@JLLeitschuh
Copy link

https://www.baeldung.com/kotlin-random-number

This writeup doesn't discuss Secure Random or the impacts of not using a Secure Random number generator when non-predictable randomness is needed.

Related:
Kotlin/KEEP#184

@eric-martin
Copy link
Collaborator

@JLLeitschuh We have logged an internal ticket to update the article. I'll keep this ticket updated with our progress.

@JLLeitschuh
Copy link
Author

Thanks! Given the risks of using an insecure RNG in a security critical location, I recommend highlighting it first.

@zimou13
Copy link

zimou13 commented May 25, 2019

Before 1.3, on the JVM we use Random or even ThreadLocalRandom if we're on JDK > 1.6.

fun IntRange.random() =
Random().nextInt((endInclusive + 1) - start) + start
Used like this:

// will return an Int between 0 and 10 (incl.)
(0..10).random()


Bluestacks Lucky Patcher Kodi

@eric-martin
Copy link
Collaborator

@JLLeitschuh We added a new 'Pseudo vs Secure Random Number Generators' section to the article. Thanks for bringing this to our attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@JLLeitschuh @eric-martin @zimou13 and others