updating secret and key