In this paper, a generalized scheme is proposed for extracting biometric keys from keystroke dynamics of the user. In the proposed scheme, first some features of are extracted from keystroke patterns of the user. Then, using a secret sharing scheme, a number of true shares are assigned to each feature to reproduce the secret key based on its discriminatory power. This true shares are hidden among random shares. When a user wants to be authenticated, the same features are extracted from his or her keystroke pattern and if its value is in the proper region, a true share is extracted. If the total number of true shares are extracted, and exceeds a threshold, reproduction of the secret key will be possible. Otherwise no information about the key will be leaked. Two parameters are used in the scheme, through which FAR and FRR can be balanced. The proposed scheme is able to extract 20 to 50 bits of secret key (besides the intrinsic entropy of the password itself). The equal error rate (ERR) of the scheme is nearly 4%. Besides, on top of a traditional password-based system, using the proposed scheme increases the security by a factor of 2 or 3 (in number of bits).