Thanks. Can you also explain how VanityGen works then? It can calculate private keys for specified addresses, but it is nearly impossible to do so. (Unless the specified part is short)
VanityGen just generates lots of random addresses as fast as it can. It compares each random address to the string of characters that you supply. If they don't match, it ignores the address and keeps on generating more. If they do match, then it gives you the private key and the address.
The longer the string of characters that you are trying to match, the less likely that vanityGen will ever randomly end up with a match.