# Generating a random 32-byte hex integer using Qiskit

Hello I posted here yesterday about generating random 16 digits using Qiskit, and a gentle guy helped me but how about a string? How can I generate random 256 bit key in hex format in a superposition state and measure it?

Anyway something like this but using Qiskit instead:

def generate_key():

 return binascii.hexlify(os.urandom(32)).decode('utf-8').upper()


Output: CEF3A7BE7F95F3C27F393C74C99A2C1F1F8C658D3CD973C5FF3C266C7133AA38

import coden

Here, get_random_bits will be constructed by you using your knowledge from the answer of the previous question.