added the key generator used by Rails to convert the secret in various derived keys