# Does Processing have a system random type

**URL:** <https://discourse.processing.org/t/does-processing-have-a-system-random-type/36642>\
**Category:** Beginners\
**Created:** [April 28, 2022, 10:47pm UTC](https://discourse.processing.org/t/does-processing-have-a-system-random-type/36642 "2022-04-28T22:47:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AntiViral\_Builder](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@AntiViral\_Builder](https://discourse.processing.org/u/AntiViral_Builder)\
**Post date:** [April 28, 2022, 10:47pm UTC](https://discourse.processing.org/t/does-processing-have-a-system-random-type/36642/1 "2022-04-28T22:47:43Z")

</div>

Is there anything that is secure enough to generate encryption codes?

---

<div class="post-metadata">

**Author:** ![SomeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/someone/32/8639_2.png) [@SomeOne](https://discourse.processing.org/u/SomeOne)\
**Post date:** [April 29, 2022, 1:57am UTC](https://discourse.processing.org/t/does-processing-have-a-system-random-type/36642/2 "2022-04-29T01:57:45Z")

</div>

Random generator in processing most like relies on what Java language offers, but then again you can use external Java libraries and I’m sure there exists random generators that are good enough.

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [April 29, 2022, 2:02am UTC](https://discourse.processing.org/t/does-processing-have-a-system-random-type/36642/3 "2022-04-29T02:02:58Z")

</div>

Hello,

> **[The Java SecureRandom Class | Baeldung](https://www.baeldung.com/java-secure-random)**
>
> Learn how to use the SecureRandom class in Java and how to produce safe random numbers.

[https://www.geeksforgeeks.org/random-vs-secure-random-numbers-java/](https://www.geeksforgeeks.org/random-vs-secure-random-numbers-java/)

Example used in Processing (from web site above):

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/4/b/4b0accca01e04763749145120aecf5dd9ff7fb33.png)

`:)`

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [April 29, 2022, 8:15am UTC](https://discourse.processing.org/t/does-processing-have-a-system-random-type/36642/4 "2022-04-29T08:15:36Z")

</div>

You can use the SHA-1 or SHA-256 hashing algorithms. I used these when encrypting images in my Steganos library.

I gave some detail of it use in this [discussion](https://discourse.processing.org/t/image-encryption-decryption-tool-bug/8119)
