Menu

#282 Post-Python 3: Change "urandom" to "secrets" to improve security

v1.0 (example)
open
nobody
None
5
1 day ago
1 day ago
Ahasuerus
No

Due to ISFDB's use of CSP (Content Security Policy) and Cloudflare, our Python code needs to generate a one-time nonce in common/isfdb.py. We currently use base64.b64encode(os.urandom(32)) to generate it since it's the best we can do under Python 2.7. Once we finish the upgrade to Python 3, we should switch from "urandom" to "secrets", because the latter is more secure.

Discussion

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB