Random byte string in Python March 21, 2023 by Tarik >>> import os >>> "\x00"+os.urandom(4)+"\x00" '\x00!\xc0zK\x00'