Skip to content

Instantly share code, notes, and snippets.

@vndee
Created November 1, 2024 13:51
Show Gist options
  • Save vndee/4329f388a73604d63795b269640ace96 to your computer and use it in GitHub Desktop.
Save vndee/4329f388a73604d63795b269640ace96 to your computer and use it in GitHub Desktop.
# Using operating system's secure random source
import os
true_random_bytes = os.urandom(16)
# On Linux systems
with open("/dev/random", "rb") as f:
hardware_random = f.read(16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment