Generate a key for use as salt or any other form

By | 10th September 2024

While installing or configuring setups we may need to generate a 32 character long random keys may that be for salt or used for flask sessions or while setting up ELK stack and you need to create this key. These 2 commands will generate the desired key. If needed modify or alter the random function to get variety of keys.

python3
>>import os
>>print(os.urandom(32).hex())