Skip to content

Instantly share code, notes, and snippets.

@haccer
Created July 13, 2018 21:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save haccer/40479b98ff5fe365f02c8ec4c19b782b to your computer and use it in GitHub Desktop.
Save haccer/40479b98ff5fe365f02c8ec4c19b782b to your computer and use it in GitHub Desktop.
Extract emails from PGP keys
#!/usr/bin/env python
import requests, base64, re, sys
r = requests.get("https://keybase.io/" + sys.argv[1] + "/key.asc")
body = r.text.split("\n\n")
key = body[1].split("-----")
for email in re.findall(r' <(.*?)>', str(base64.b64decode(key[0]))):
print(email)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment