Logic update to key=SecretKey