Add get_ramdon_key function.