compute secret key