From 2c38248daa767cf602c80cf77cccbe18683051a6 Mon Sep 17 00:00:00 2001 From: The Dod Date: Sun, 21 Jun 2015 15:36:52 +0700 Subject: [PATCH] Note re python3 Better lorem ipsum ;) --- README.md | 2 ++ darkened.py | 6 ++-- output.txt | 86 ++++++++++++++++++++++++++++------------------------- 3 files changed, 50 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 5e833cb..0ac8cb8 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ Perhaps you could trade this information with their adversaries? The possibiliti ### How to play +**Note:** All code here should be run with python3. No telling what this code might do on python2 ;) + #### First you need to join * Every player should have a [twister](http://twister.net.co) account diff --git a/darkened.py b/darkened.py index f746cea..a883813 100644 --- a/darkened.py +++ b/darkened.py @@ -206,14 +206,14 @@ def testit(): for p in getplayers().values(): print('\n# {name} ({player}, @{twister}):'.format(**p)) print('\n'.join(' '+l for l in textwrap.wrap(p['bio']))) - print('\n\n### Redacting prefab plaintext (2 trustees)') - plaintext = "Here's the first line, \nfollowed by a second one" + print('\n\n### Redacting "fake redaction" to 2 trustees') + plaintext = "You're not as █████████\nas you think you are" redaction = redact(plaintext, 'alice', recipients=['bob','carol'], subject='Is this thing on?', k=2) for line in textwrap.wrap(json.dumps(redaction)): print(line) for t in redaction['__public__']['trustees']: print('\n# >>> Unredaction for trustee: {}'.format(t)) print(unredact(redaction['__public__'], redaction[t])) - print('\n### >>> integration >>>') + print('\n(one of them has utf-8 bloat)\n\n### >>> integration >>>') print(unredact(redaction['__public__'], redaction['__to__'])) print('\n\n### Unredaction of prefab message (with conflicting pads)') for t in prefab['__public__']['trustees']: diff --git a/output.txt b/output.txt index 84d943b..1594790 100644 --- a/output.txt +++ b/output.txt @@ -1,12 +1,8 @@ ### Players -# Rabbi Yoav (broyo, @thedod): - Confession sensor technician (CST) and ChurchApproved Rabbi (CAR) - [technically, a priest] in the Geneva parish. Born 2061 in Kibbutz - Tzofna [burnt down during the 2067 reforms]. Graduated Ofakim Yeshiva - (a ChurchApproved institute) 2085. Level 17 communism indicators - (mainly due to family and origin). 77% heterosexual. No other known - dominant deviations. +# Zabadee O'Mally (zayo, @zayo): + A defrocked ███████████ priest turned confession analysis contractor + (CAC). # Daan II (daanii, @black_puppydog): ██ ███ ███████ of ██████. @@ -15,47 +11,55 @@ A confirmed human resident of █████████ ███████████ and ChurchApproved DepescheProzessor since 2048. -# Zabadee O'Mally (zayo, @zayo): - A defrocked ███████████ priest turned confession analysis contractor - (CAC). - -# Sandy Claws (sandyclaws, @sandyclaws): - From the Magic Tuna Show (ask your kids). +# Rabbi Yoav (broyo, @thedod): + Confession sensor technician (CST) and ChurchApproved Rabbi (CAR) + [technically, a priest] in the Geneva parish. Born 2061 in Kibbutz + Tzofna [burnt down during the 2067 reforms]. Graduated Ofakim Yeshiva + (a ChurchApproved institute) 2085. Level 17 communism indicators + (mainly due to family and origin). 77% heterosexual. No other known + dominant deviations. # Forth Inc. (forth, @forth): Registered ████████. +# Sandy Claws (sandyclaws, @sandyclaws): + From the Magic Tuna Show (ask your kids). + -### Redacting prefab plaintext (2 trustees) -{"__to__": {"sender": "alice", "recipients": ["bob", "carol"], -"subject": "Is this thing on?", "msgid": "DA14345355125001", "pads": -{"daanii": [["EX9FwomA", null, "O1oE0lk=", "8bBvQdY="], [null, "Ddw=", -null, "PjVkQR2S", "rPqr"]], "talex": [[null, "4t54", null, null], -["5E2TnuiWtQQ=", null, "Hw==", null, null]]}, "trustees": ["daanii", -"talex"]}, "daanii": {"sender": "alice", "recipients": ["bob", -"carol"], "subject": "Is this thing on?", "msgid": "DA14345355125001", -"pads": {"daanii": [["EX9FwomA", null, "O1oE0lk=", "8bBvQdY="], [null, -"Ddw=", null, "PjVkQR2S", "rPqr"]]}, "trustees": ["daanii", "talex"]}, -"__public__": {"cipher": [["WRo3p67z", "lrYd", "XTN2oS0=", -"ndkBJPo="], ["giL/8ofh0GA=", "b6U=", "fg==", "TVAHLnP2", "w5TO"]], -"sender": "alice", "recipients": ["bob", "carol"], "subject": "Is this -thing on?", "msgid": "DA14345355125001", "trustees": ["daanii", -"talex"]}, "talex": {"sender": "alice", "recipients": ["bob", -"carol"], "subject": "Is this thing on?", "msgid": "DA14345355125001", -"pads": {"talex": [[null, "4t54", null, null], ["5E2TnuiWtQQ=", null, -"Hw==", null, null]]}, "trustees": ["daanii", "talex"]}} - -# >>> Unredaction for trustee: daanii -Here's ███ first line, -████████ by █ second one - -# >>> Unredaction for trustee: talex -██████ the █████ █████ -followed ██ a ██████ ███ +### Redacting "fake redaction" to 2 trustees +{"__public__": {"recipients": ["bob", "carol"], "cipher": +[["W7MZY1y1", "mnb7", "TQY=", "sT6ZUgYlTlkIaog69AbAFgYCydQ/Na335paz"], +["mCs=", "KalY", "7uvPaTg=", "D4Nc", "jaiB"]], "sender": "alice", +"subject": "Is this thing on?", "trustees": ["forth", "zayo"], +"msgid": "DA14348757490111"}, "forth": {"recipients": ["bob", +"carol"], "pads": {"forth": [[null, "9BmP", null, +"U6gRsJCtrM+AiB6yFpBI9JCKK0K31zt/BAA7"], ["+Vg=", "UMYt", "moOmB1M=", +"duwp", null]]}, "sender": "alice", "subject": "Is this thing on?", +"trustees": ["forth", "zayo"], "msgid": "DA14348757490111"}, "zayo": +{"recipients": ["bob", "carol"], "pads": {"zayo": [["AtxsRC7Q", null, +"LHU=", null], [null, null, null, null, "7Nrk"]]}, "sender": "alice", +"subject": "Is this thing on?", "trustees": ["forth", "zayo"], +"msgid": "DA14348757490111"}, "__to__": {"recipients": ["bob", +"carol"], "pads": {"forth": [[null, "9BmP", null, +"U6gRsJCtrM+AiB6yFpBI9JCKK0K31zt/BAA7"], ["+Vg=", "UMYt", "moOmB1M=", +"duwp", null]], "zayo": [["AtxsRC7Q", null, "LHU=", null], [null, +null, null, null, "7Nrk"]]}, "sender": "alice", "subject": "Is this +thing on?", "trustees": ["forth", "zayo"], "msgid": +"DA14348757490111"}} + +# >>> Unredaction for trustee: forth +██████ not ██ █████████ +as you think you ███ + +# >>> Unredaction for trustee: zayo +You're ███ as ███████████████████████████ +██ ███ █████ ███ are + +(one of them has utf-8 bloat) ### >>> integration >>> -Here's the first line, -followed by a second one +You're not as █████████ +as you think you are ### Unredaction of prefab message (with conflicting pads)