Generate Given Number of Random Bytes using Python

os.urandom function

import os

n = 8
randomBytes = os.urandom(n)

print(list(randomBytes))

Leave a Comment

Cancel reply

Your email address will not be published.