Provide function for generating random key.