Browse Source

Merge branch 'master' of github.com:Knights-of-Redact/DarkenedAges

master
The Dod 9 years ago
parent
commit
d7b9f5cd6d
  1. 2
      README.md
  2. 6
      darkened.py
  3. 86
      output.txt

2
README.md

@ -56,6 +56,8 @@ Perhaps you could trade this information with their adversaries? The possibiliti
### How to play ### 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 #### First you need to join
* Every player should have a [twister](http://twister.net.co) account * Every player should have a [twister](http://twister.net.co) account

6
darkened.py

@ -206,14 +206,14 @@ def testit():
for p in getplayers().values(): for p in getplayers().values():
print('\n# {name} ({player}, @{twister}):'.format(**p)) print('\n# {name} ({player}, @{twister}):'.format(**p))
print('\n'.join(' '+l for l in textwrap.wrap(p['bio']))) print('\n'.join(' '+l for l in textwrap.wrap(p['bio'])))
print('\n\n### Redacting prefab plaintext (2 trustees)') print('\n\n### Redacting "fake redaction" to 2 trustees')
plaintext = "Here's the first line, \nfollowed by a second one" plaintext = "You're not as █████████\nas you think you are"
redaction = redact(plaintext, 'alice', recipients=['bob','carol'], subject='Is this thing on?', k=2) 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 line in textwrap.wrap(json.dumps(redaction)): print(line)
for t in redaction['__public__']['trustees']: for t in redaction['__public__']['trustees']:
print('\n# >>> Unredaction for trustee: {}'.format(t)) print('\n# >>> Unredaction for trustee: {}'.format(t))
print(unredact(redaction['__public__'], redaction[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(unredact(redaction['__public__'], redaction['__to__']))
print('\n\n### Unredaction of prefab message (with conflicting pads)') print('\n\n### Unredaction of prefab message (with conflicting pads)')
for t in prefab['__public__']['trustees']: for t in prefab['__public__']['trustees']:

86
output.txt

@ -1,12 +1,8 @@
### Players ### Players
# Rabbi Yoav (broyo, @thedod): # Zabadee O'Mally (zayo, @zayo):
Confession sensor technician (CST) and ChurchApproved Rabbi (CAR) A defrocked ███████████ priest turned confession analysis contractor
[technically, a priest] in the Geneva parish. Born 2061 in Kibbutz (CAC).
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.
# Daan II (daanii, @black_puppydog): # Daan II (daanii, @black_puppydog):
██ ███ ███████ of ██████. ██ ███ ███████ of ██████.
@ -15,47 +11,55 @@
A confirmed human resident of █████████ ███████████ and ChurchApproved A confirmed human resident of █████████ ███████████ and ChurchApproved
DepescheProzessor since 2048. DepescheProzessor since 2048.
# Zabadee O'Mally (zayo, @zayo): # Rabbi Yoav (broyo, @thedod):
A defrocked ███████████ priest turned confession analysis contractor Confession sensor technician (CST) and ChurchApproved Rabbi (CAR)
(CAC). [technically, a priest] in the Geneva parish. Born 2061 in Kibbutz
Tzofna [burnt down during the 2067 reforms]. Graduated Ofakim Yeshiva
# Sandy Claws (sandyclaws, @sandyclaws): (a ChurchApproved institute) 2085. Level 17 communism indicators
From the Magic Tuna Show (ask your kids). (mainly due to family and origin). 77% heterosexual. No other known
dominant deviations.
# Forth Inc. (forth, @forth): # Forth Inc. (forth, @forth):
Registered ████████. Registered ████████.
# Sandy Claws (sandyclaws, @sandyclaws):
From the Magic Tuna Show (ask your kids).
### Redacting prefab plaintext (2 trustees) ### Redacting "fake redaction" to 2 trustees
{"__to__": {"sender": "alice", "recipients": ["bob", "carol"], {"__public__": {"recipients": ["bob", "carol"], "cipher":
"subject": "Is this thing on?", "msgid": "DA14345355125001", "pads": [["W7MZY1y1", "mnb7", "TQY=", "sT6ZUgYlTlkIaog69AbAFgYCydQ/Na335paz"],
{"daanii": [["EX9FwomA", null, "O1oE0lk=", "8bBvQdY="], [null, "Ddw=", ["mCs=", "KalY", "7uvPaTg=", "D4Nc", "jaiB"]], "sender": "alice",
null, "PjVkQR2S", "rPqr"]], "talex": [[null, "4t54", null, null], "subject": "Is this thing on?", "trustees": ["forth", "zayo"],
["5E2TnuiWtQQ=", null, "Hw==", null, null]]}, "trustees": ["daanii", "msgid": "DA14348757490111"}, "forth": {"recipients": ["bob",
"talex"]}, "daanii": {"sender": "alice", "recipients": ["bob", "carol"], "pads": {"forth": [[null, "9BmP", null,
"carol"], "subject": "Is this thing on?", "msgid": "DA14345355125001", "U6gRsJCtrM+AiB6yFpBI9JCKK0K31zt/BAA7"], ["+Vg=", "UMYt", "moOmB1M=",
"pads": {"daanii": [["EX9FwomA", null, "O1oE0lk=", "8bBvQdY="], [null, "duwp", null]]}, "sender": "alice", "subject": "Is this thing on?",
"Ddw=", null, "PjVkQR2S", "rPqr"]]}, "trustees": ["daanii", "talex"]}, "trustees": ["forth", "zayo"], "msgid": "DA14348757490111"}, "zayo":
"__public__": {"cipher": [["WRo3p67z", "lrYd", "XTN2oS0=", {"recipients": ["bob", "carol"], "pads": {"zayo": [["AtxsRC7Q", null,
"ndkBJPo="], ["giL/8ofh0GA=", "b6U=", "fg==", "TVAHLnP2", "w5TO"]], "LHU=", null], [null, null, null, null, "7Nrk"]]}, "sender": "alice",
"sender": "alice", "recipients": ["bob", "carol"], "subject": "Is this "subject": "Is this thing on?", "trustees": ["forth", "zayo"],
thing on?", "msgid": "DA14345355125001", "trustees": ["daanii", "msgid": "DA14348757490111"}, "__to__": {"recipients": ["bob",
"talex"]}, "talex": {"sender": "alice", "recipients": ["bob", "carol"], "pads": {"forth": [[null, "9BmP", null,
"carol"], "subject": "Is this thing on?", "msgid": "DA14345355125001", "U6gRsJCtrM+AiB6yFpBI9JCKK0K31zt/BAA7"], ["+Vg=", "UMYt", "moOmB1M=",
"pads": {"talex": [[null, "4t54", null, null], ["5E2TnuiWtQQ=", null, "duwp", null]], "zayo": [["AtxsRC7Q", null, "LHU=", null], [null,
"Hw==", null, null]]}, "trustees": ["daanii", "talex"]}} null, null, null, "7Nrk"]]}, "sender": "alice", "subject": "Is this
thing on?", "trustees": ["forth", "zayo"], "msgid":
# >>> Unredaction for trustee: daanii "DA14348757490111"}}
Here's ███ first line,
████████ by █ second one # >>> Unredaction for trustee: forth
██████ not ██ █████████
# >>> Unredaction for trustee: talex as you think you ███
██████ the █████ █████
followed ██ a ██████ ███ # >>> Unredaction for trustee: zayo
You're ███ as ███████████████████████████
██ ███ █████ ███ are
(one of them has utf-8 bloat)
### >>> integration >>> ### >>> integration >>>
Here's the first line, You're not as █████████
followed by a second one as you think you are
### Unredaction of prefab message (with conflicting pads) ### Unredaction of prefab message (with conflicting pads)

Loading…
Cancel
Save