Does anyone has idea how metamask generates the passPhrase. I was looking in github for related files but unable to figure out how exactly the things are done.
The mnemonic key phrase? How is that generated?
I'm not sure how MetaMask generates it. But I can guess that it uses a similar approach to the other standards our there. E.g. BIP 39
For a detailed "how is this done". Read here:
You need random data, aka, entropy.
You get enough of that and do fancy computes on said data.
That data is then separate out in a "table" of numbers
These numbers are indexed to a word list (dictionary)
You print out words that corresponde to the indexed numbers
Note: You can further protect, or secure, one's mnemonic by pairing it with a user's passphrase.
[mnemonic] + [passphrase] = [private keys].
This is cool, because, if someone got ahold of your mnemonic, they still could NOT generate your private keys without your unique passphrase.