get_random_string() and generate_secret_key() functions