Welcome to ProCheckUp Labs, the blog from Procheckup
There are different approaches to writing a tool that allows you to brute-force the passphrase of a PGP private key. You could write the tool in C which relies on the GnuPG Made Easy library. In my case, I decided to write a bash script called gpgpwn, which wraps around the GPG command-line tool.
ap@pcu:~$ ./gpgpwn.sh
usage: gpgpwn.sh <html> <>
uid: as shown by 'gpg --list-keys'
wordlist: file containing words/phrases to brute-force
i.e.: ./gpgpwn.sh "John Smith <jsmith@company.foo>" ./words.txt</jsmith@company.foo>