added generateSecretKey