Handle the secret key automatically and securely