How are the keys for Namecoin generated? I need the exact technical algorithm. I found a lot about the key generation mechanism for Bitcoin in the web, but nothing for Namecoin, except the fact that they are starting with N or M instead of 1.
I am very interested in key generation of Altcoins.
and what do you need it for ?

any illegal purpose or just curiosity?