Browse Source

Move urls from gist to git and related README edits

index.html (test run output) is now called output.txt
Also added hash64 function (for paste integrity checks).
master
The Dod 10 years ago
parent
commit
1e601adaaf
  1. 13
      README.md
  2. 12
      darkened.py
  3. 55
      output.txt

13
README.md

@ -12,7 +12,8 @@ @@ -12,7 +12,8 @@
= ______________________________________________________________________________________________________________
Unlike Alice, Bob doesn't get dropped packets when pinging legal department, and delays are no serious problem
#### Slightly longer examples [here](http://bl.ocks.org/thedod/raw/7a4a81224b5bed676b00/) and [here](https://pastee.org/v46af).
#### Slightly longer examples [here](https://raw.githubusercontent.com/Knights-of-Redact/DarkenedAges/master/output.txt)
and [here](https://pastee.org/v46af).
For public moves and gossip, see [#DarkenedAges](https://twisterio.com/search?kw=%23darkenedages) on [twister](http://twister.net.co)
@ -59,10 +60,14 @@ Perhaps you could trade this information with their adversaries? The possibiliti @@ -59,10 +60,14 @@ Perhaps you could trade this information with their adversaries? The possibiliti
More info soon, meanwhile here's how to become a player:
* Every player should have a [twister](http://twister.net.co) account
* <del>Fork this, add a line about yourself to `players.csv`, and mention `@darkenedages` on twister with a link to your forked gist.</del> Bugger it. Just twist `@darkenedages I want to play #DarkenedAges` ;)
* It is recommended to follow `@darkenedages` and have `#DarkenedAges` in your profile, but the formal definition of "player" is "one who appears at [players.csv](https://gist.github.com/thedod/7a4a81224b5bed676b00#file-players-csv)" ;)
* <del>If you know how, add a line about yourself to [players.csv](https://github.com/Knights-of-Redact/DarkenedAges/blob/master/players.csv),
(as a pull-request or something).</del> Bugger it. Just twist `@darkenedages I want to play #DarkenedAges` ;)
* It is recommended to follow `@darkenedages` and have `#DarkenedAges` in your profile, but the formal definition of "player" is
"one who appears at [players.csv](https://github.com/Knights-of-Redact/DarkenedAges/blob/master/players.csv)" ;)
The file [output.txt](https://raw.githubusercontent.com/Knights-of-Redact/DarkenedAges/master/output.txt)
was produced with `python darkened.py > output.txt`. You should get a similar output if everything works well.
Essentially [index.html](http://bl.ocks.org/thedod/raw/7a4a81224b5bed676b00/) was produced with `python darkened.py > index.html`.
The motivation behind this "full retard crypto suite" is to create an environment where everyone can have a go at code breaking.
_______________________________________

12
darkened.py

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
import random
import time
import codecs
import hashlib
import json
import csv
import textwrap
@ -112,6 +113,10 @@ def unredact(cipher, pads, trustees=[]): @@ -112,6 +113,10 @@ def unredact(cipher, pads, trustees=[]):
mapmsgs(base642bytes,
mapmsgs(integrate, *pads64))))
def hash64(b):
"Returns base64 of sha1 (appended as hash to paste urls against evil eye)"
return str(codecs.encode(hashlib.sha1(b).digest(),'base64').strip(),'ascii')
## Game functions
def makeid():
@ -181,7 +186,7 @@ prefab = { @@ -181,7 +186,7 @@ prefab = {
["sbuL", "qhM8EFAOWM0=", "oxO8cg==", None, "/eYQidGv/nc=", "epMLVQA=",
None, None, "i5dv", "Dh9fFA==", None, "gNKi", "lrEPMyg=", None],
[None, None, "+UoxOmBAFcvrFg==", "Xo4=", None, "4f56t0C6WA=="]]},
"recipients": ["bob", "carol"], "subject": "Hey, sport. YOU connect"
"recipients": ["bob", "carol"], "subject": "Hey, sport. YOU connect "
"the dots."}, "ted": {"trustees": ["ted", "dan"], "sender": "alice",
"msgid": "DA14341968415407", "pads": {"ted": [["xWusIv5F", "29q4dg==",
"zAa7Rc4K", "pqY7HvIXqHA1RRWMhA==", None, None, "lSXD+g==", None,
@ -197,7 +202,6 @@ prefab = { @@ -197,7 +202,6 @@ prefab = {
def testit():
"Todo: turn this into proper unit tests, anyone?"
print('<!DOCTYPE html>\n<html lang="en"><head><title>Testing DarkenedAges library</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body><pre>')
print('### Players')
for p in getplayers().values():
print('\n# {name} ({player}, @{twister}):'.format(**p))
@ -214,11 +218,9 @@ def testit(): @@ -214,11 +218,9 @@ def testit():
print('\n\n### Unredaction of prefab message (with conflicting pads)')
for t in prefab['__public__']['trustees']:
print('\n# >>> Unredaction for trustee: {}'.format(t))
print(unredact(prefab['__public__'], prefab[t]))
print(unredact(prefab['__public__'], prefab['__to__'],trustees=[t]))
print('\n### >>> integration >>>')
print(unredact(prefab['__public__'], prefab['__to__']))
print('</pre></body></html>')
if __name__=='__main__':
testit()

55
index.html → output.txt

@ -1,9 +1,7 @@ @@ -1,9 +1,7 @@
<!DOCTYPE html>
<html lang="en"><head><title>Testing DarkenedAges library</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body><pre>
### Players
# Sandy Claws (sandyclaws, @sandyclaws):
From the Magic Tuna Show (ask your kids).
# Forth Inc. (forth, @forth):
Registered ████████.
# Rabbi Yoav (broyo, @thedod):
Confession sensor technician (CST) and ChurchApproved Rabbi (CAR)
@ -13,40 +11,40 @@ @@ -13,40 +11,40 @@
(mainly due to family and origin). 77% heterosexual. No other known
dominant deviatoins.
# Forth Inc. (forth, @forth):
Registered ████████.
# Sandy Claws (sandyclaws, @sandyclaws):
From the Magic Tuna Show (ask your kids).
# Daan II (daanii, @black_puppydog):
██ ███ ███████ of ██████.
### Redacting prefab plaintext (2 trustees)
{"daanii": {"pads": {"daanii": [["krEZr3A9", null, "Ew+m5z8=",
"zMwQeJk="], [null, "oDo=", "Gg==", null, "LSr3"]]}, "subject": "Is
this thing on?", "sender": "alice", "trustees": ["daanii", "broyo"],
"msgid": "DA14341999781041", "recipients": ["bob", "carol"]},
"__public__": {"cipher": [["2tRryldO", "5F+i", "dWbUlEs=",
"oKV+HbU="], ["to5RIGi8VsQ=", "wkM=", "ew==", "mIQCOq/5", "QkSS"]],
"subject": "Is this thing on?", "sender": "alice", "trustees":
["daanii", "broyo"], "msgid": "DA14341999781041", "recipients":
["bob", "carol"]}, "__to__": {"pads": {"daanii": [["krEZr3A9", null,
"Ew+m5z8=", "zMwQeJk="], [null, "oDo=", "Gg==", null, "LSr3"]],
"broyo": [[null, "kDfH", null, null], ["0OE9TAfLM6A=", null, null,
"6+FhVcGd", null]]}, "subject": "Is this thing on?", "sender":
"alice", "trustees": ["daanii", "broyo"], "msgid": "DA14341999781041",
"recipients": ["bob", "carol"]}, "broyo": {"pads": {"broyo": [[null,
"kDfH", null, null], ["0OE9TAfLM6A=", null, null, "6+FhVcGd", null]]},
"subject": "Is this thing on?", "sender": "alice", "trustees":
["daanii", "broyo"], "msgid": "DA14341999781041", "recipients":
["bob", "carol"]}}
{"__to__": {"msgid": "DA14342296128997", "sender": "alice",
"recipients": ["bob", "carol"], "subject": "Is this thing on?",
"pads": {"broyo": [["DeQiOr6R", null, null, "ql8ABmM="],
["wKFeiKus9u8=", "VLY=", "Kg==", null, null]], "daanii": [[null,
"oM8O", "wBgmWVc=", null], [null, null, null, "z8G1nS+/", "zLhb"]]},
"trustees": ["daanii", "broyo"]}, "broyo": {"msgid":
"DA14342296128997", "sender": "alice", "recipients": ["bob", "carol"],
"subject": "Is this thing on?", "pads": {"broyo": [["DeQiOr6R", null,
null, "ql8ABmM="], ["wKFeiKus9u8=", "VLY=", "Kg==", null, null]]},
"trustees": ["daanii", "broyo"]}, "__public__": {"msgid":
"DA14342296128997", "sender": "alice", "recipients": ["bob", "carol"],
"cipher": [["RYFQX5ni", "1Kdr", "pnFUKiM=", "xjZuY08="],
["ps4y5MTbk4s=", "Ns8=", "Sw==", "vKTW8kHb", "o9Y+"]], "subject": "Is
this thing on?", "trustees": ["daanii", "broyo"]}, "daanii": {"msgid":
"DA14342296128997", "sender": "alice", "recipients": ["bob", "carol"],
"subject": "Is this thing on?", "pads": {"daanii": [[null, "oM8O",
"wBgmWVc=", null], [null, null, null, "z8G1nS+/", "zLhb"]]},
"trustees": ["daanii", "broyo"]}}
# >>> Unredaction for trustee: daanii
Here's ███ first line,
████████ by a ██████ one
██████ the first █████
████████ ██ second one
# >>> Unredaction for trustee: broyo
██████ the █████ █████
followed ██ █ second ███
Here's ███ █████ line,
followed by a ██████ ███
### >>> integration >>>
Here's the first line,
@ -75,4 +73,3 @@ access to the Pujinda paper. As far as we know, it may have never leaked. @@ -75,4 +73,3 @@ access to the Pujinda paper. As far as we know, it may have never leaked.
The El-Hamdan encryption crack is a result of independent research by FTT.
DHQ predicts that the official story (that FTT has died in the ╳╳╳╳╳ crash)
won't be challenged by the public.
</pre></body></html>
Loading…
Cancel
Save