Skip to content

Instantly share code, notes, and snippets.

@haccer
Created July 13, 2018 21:13
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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