You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<pclass="admonition-title">Random Data Can Be Captured</p>
487
+
<divclass="admonition danger">
488
+
<pclass="admonition-title">Random Data Can Be Captured</p>
489
+
<p>Capturing the random data used to generate shares is possible. It's <strong>not</strong> enabled by default and the <code>function()</code> necessary to process the random data is at the discretion users of this package. </p>
490
+
<p>The ability to access the random data is <strong>solely</strong> intended for random dithering and auditing purposes. <em>(like the images below)</em></p>
<p>The <code>secrets</code> module is used for generating cryptographically strong random numbers suitable for managing data such as passwords, account authentication, security tokens, and related secrets.</p>
497
+
<p>The <code>secrets</code><strong>should be used</strong> instead of the default pseudo-random number generator in the <code>random</code> module, which is designed for modelling and simulation, not security or cryptography.</p>
<p>The pseudo-random generators in the <code>random</code> module <strong>should not</strong> be used for security purposes. For security or cryptographic uses, use the <code>secrets</code> module. </p>
<p>The <code>testRandom</code> function serves as useful tool for development, generating predictable values. However, when it comes to applications involving security or cryptography, it's crucial to employ a robust random number generator. </p>
Capturing the random data used to generate shares is possible. It's __not__ enabled by default and the `function()` necessary to process the random data is at the discretion users of this package.
86
+
87
+
The ability to access the random data is __solely__ intended for random dithering and auditing purposes. _(like the images below)_
91
88
92
-
recovered = secrets.combine(shares) # '86a8e7'
93
-
```
94
-
95
-
96
89
=== "secrets"
97
90
{ align=left }
98
91
99
-
=== " :fontawesome-brands-python: Python"
100
-
``` py
101
-
import js2pysecrets as secrets
102
-
103
-
key = "86A8E7"
92
+
The `secrets` module is used for generating cryptographically strong random numbers suitable for managing data such as passwords, account authentication, security tokens, and related secrets.
104
93
105
-
shares = secrets.share(key, 6, 3)
106
-
107
-
recovered = secrets.combine(shares) # '86a8e7'
108
-
```
94
+
The `secrets` __should be used__ instead of the default pseudo-random number generator in the `random` module, which is designed for modelling and simulation, not security or cryptography.
109
95
110
96
=== "random"
111
97
{ align=left }
98
+
99
+
100
+
101
+
102
+
!!! warning "Warning"
103
+
104
+
The pseudo-random generators in the `random` module __should not__ be used for security purposes. For security or cryptographic uses, use the `secrets` module.
112
105
113
106
=== "testRandom"
114
107
{ align=left }
115
108
109
+
!!! warning "Do Not Use"
116
110
111
+
__For testing purposes only!__
112
+
113
+
The `testRandom` function serves as useful tool for development, generating predictable values. However, when it comes to applications involving security or cryptography, it's crucial to employ a robust random number generator.
0 commit comments