Modified to use a secret key