Although this is an old thread, I felt it was appropriate to give a warning about the above script, as it has a bug that produces wrong results for some keys.
I will post more details and a fix when I have some free time.
Meanwhile, you guys can try to find it as an exercise...
Some technical knowledge of bitcoin is required.