From 39d7b98852dd54c6eabeb10f37c6cc8499e75df2 Mon Sep 17 00:00:00 2001 From: "Paul S. Ferrell" Date: Thu, 15 Oct 2009 16:29:52 -0600 Subject: [PATCH] Fixed some formatting issues in some puzzles. --- puzzles/crypto/120/index.html | 8 ++------ puzzles/crypto/120binary.py | 8 ++------ puzzles/crypto/130/index.html | 2 ++ puzzles/crypto/130/key | 1 + puzzles/crypto/130manchester.py | 14 +++++--------- puzzles/crypto/140morris.py | 1 + 6 files changed, 13 insertions(+), 21 deletions(-) create mode 100644 puzzles/crypto/130/index.html create mode 100644 puzzles/crypto/130/key diff --git a/puzzles/crypto/120/index.html b/puzzles/crypto/120/index.html index b24b983..b82f473 100644 --- a/puzzles/crypto/120/index.html +++ b/puzzles/crypto/120/index.html @@ -1,6 +1,2 @@ -
-
Alice -
KiTvXqBKSkdOiVHAKgyAdZXuTwudIHqzLHcJBCXRPnxCxuxhUmdKcqvNSgkHGgYmKIdQKAOPMatvHAalZzrZcMCFGaiSklvsNsgbLiJmPagZobKLLpgJJcIMDUvKEXFJMiwVbVFKZdjDMKSvTdugBqjPBdlJTlXnDAvFUPNAFpjFESbJNsgJTnCgNeeZIwGfMkmZwnhGCDrOWWYIPafuXZrKNroELoGjXwtQdlSZZwdDTEZxTulhKsAMFthZfHGqSyxnXzdPShkXVrRqDpoNmuTINniddWNvMThBQEWAVbaRLrChBicNXWYbGuwdAQrvLdfdxEJgPErTwysQ -
Bob -
LqItUzQMBgbWoNMNNavSLvNyBStVGUCWNjgQxghYZevZYvWuBcdweBUETsflAiXPPLxBFVHUOrdhFDARCngbRdLnHiytxFnSSpknmEvZDioBdxTRLnlAOcAfPKvODVUWJpstBLmtXskjWuBBHizDKXRtPobcLVyQHjtzKiFFMwzzOVnfHTqZGKKDQinlYgZDHzmWhHEKYwtDMmDiUKrZYARDIoceQDugJhrXVOZnAbbFneByTliWIpTsMWoVGGSAIzpBZXOvIihvSBcjABbCXEZIRblsPxJFUnuXrIDBFphHpFSzUrpsNUzbPXdLNBUAInuJifwtRigMdtzWGkvLAwYqIQmEetyEPSrMHNTBRLtZCJZPRcEdDQdEXdnILAAfNpwzEsVWPUzYJVBCVbUTVojLIviMzWRpMqpQotsYAqtDcFpe -
+
Alice
OaRnC xYDMj mRfUF NHloY MdDhM
AsGEX EWVcd EluiG ZpfMD sXmLa
wnwCQ FCrpx HlKVQ UdVRB VWXmq
aALLS JoklQ zKmXb zvdFc GCess
vQvLJ twVsy CQCzt AWkLr FUbVE
KMACs bfNJf aWlgx UtXUR fmSHV
JiQtb lOChG IdziE sGCJk uqTBp
bLMxX FHLVG xzHyE DhEgc RxajT
DVyFG UUDWl qnQqR MNypE pQKCK
uoKBh EsZZf HFTPH XyidJ TvfLf
nCIUD nXqwQ vkLmI plZRq HzINo
WWPQK MywcI ryqWh jIVQT pTrwj
vEYqL ObBcu CPUIy YOSQS SxpRJ
TrZOm nqClB sUtqz DjHNC WqPCM
JDJue jLgMB TmcIc GHEQm lRZiW
bHPaH YOFET jlWvr KFVkp UXHDd
JbyjO CwbSc oxGmH QRJqZ FENRH
vumHE qjFvj zQcMV LyaPG xVyJc
opOKT SNIeI FESGS mfRgY QlLgt
mDCvv UWlZT VBMRk dWTqS JZatQ
iVXkL kzRBx iFQqc JQmdS RffSC
zPqVq fyHHa CUgoN DuTzV pvEnc
uTZdh wNpNP OPdHr hpK +
Bob
WmVtZ tinFr jWKqY dNVxD VJKGG
qbrQv ujOyj Naaag ZilxP tTjOp
bMbeD GSheG NgDQY jnGib wDRTd
YTkqo InauZ sRRFZ lGZSK MPyhb
TmjoG qaGHX GnDno ClwsT OwyeA
cFGKX bLAPJ XIeyu RuZAC qkPqK
IYLzj YHeWz CmzZu xCcGL lWRJF
LAjvc DkEJV bgUfl mbWVv ZJRCB
EfaJQ uvyIk oBWqO kZuap XnGYD
GjYTA UCWwo gRZnd LxguW iNZQg
soHjR dQheM SNcxH dgXiH fdHXw
LNOFX NcfaX BqgGt bMqtv oOUsU
XDGXO lvSTi XoGma SPVFo DeelQ
WyCYe aNkwY WXuog vWKcV CwAnd
MLJJv YXTTS LmbmU husBq aIuvc
uVwzu KcEqW jtCpe IAUtg CJxUH
JAuAD SCXFg pcBvo pIewT HhRlM
Ndfoo hfVQd HGKKM FtSvW DmSMm
cMMMN iEzgq VlWOB UpKAN DZTkK
WWeiM YsxKe FUgHw uZqvx QHftF
mVcu
diff --git a/puzzles/crypto/120binary.py b/puzzles/crypto/120binary.py index d9e8498..4ff69d8 100644 --- a/puzzles/crypto/120binary.py +++ b/puzzles/crypto/120binary.py @@ -4,6 +4,7 @@ binary with one character per binary bit. Lower case characters are 1's, and upper case is 0. The letters are chosen at random. Tricky, eh?""" import random +import crypto lower = b'abcdefghijklmnopqrstuvwxyz' upper = lower.upper() @@ -40,9 +41,4 @@ def decode(text): out.append(c) return bytes(out) -c = encode(plaintext[0]) -print('
Alice
', str(c, 'utf-8')) -assert decode(c) == plaintext[0] -c = encode(plaintext[1]) -print('
Bob
', str(c, 'utf-8'), '
') -assert decode(c) == plaintext[1] +crypto.mkIndex(encode, decode, plaintext[0], plaintext[1], crypto.groups) diff --git a/puzzles/crypto/130/index.html b/puzzles/crypto/130/index.html new file mode 100644 index 0000000..8c18ab0 --- /dev/null +++ b/puzzles/crypto/130/index.html @@ -0,0 +1,2 @@ +
Alice
OsaZO qrVCc bBEwT uVaeD cUIgs
XBoLu SiOcy GqSMq LuoKN xjYUn
MepZO lOeYl PqOiU ycJqJ RxnOo
DsXEj CehRl WXsXw mKCka ILpaZ
qWkCf MEyTt CyJtf AsYaD TvyYB
xKgGg ZjrNS qQdRm McJzG uiEuE
DxsLt VvXkY IpcVy FGnfM iAdOL
kTybM kCJaV rlDRw tQBpZ aoTNj
RrSbB nXzSc fBcIE qcFOw AjeBO
ncVnJ nLXyV nuToR YuWdt FFlQq
SxWeW wKpqA bQBok KNkQg qIIdf
JfQWc sQrFd JDzUo ErzCA wGoJt
SzEyT zeIUw TkzQa DNzdN FsrIo
FGllP kOrPn SFjwI uYcNJ yUldB
SmUez OaYzO EpIkc ZGuGl dRvRC
dcEYq FtoZD bjWpS yMXvR jvSvC
PgAnx KOqUe GdUdM xNotY YuYxN
nYmaD nZBgu MzCUo lMcVk ZjCWt
jPaCF kRwgZ SnDuX rbZzK NcIvr
FIwrR AtYaf MLsiX zWiVM rQlJh
oGIxC sEjJc KfSsN dfBFr LfOiM
eBkKe pUBsd CMzoY DltIW knBtT
UbnJl DrPYs QlyJx VJvfO cBNlL
zHqnP wZUob QQcWm tUVff PcUPb
gUGwp PmYRe dCcDO oWfmF GhmXU
iEjhR OoRcT rKhNu CovZo IeFVm
kDIdO jDsjZ wVIye DFxOi UfVfw
GgHCi MorGD hgDNp VrvPE lFwJy
KdBrE qtMuX rPIqK zEuQh VivSb
YrYKg NzgVN eKskT yJEuQ vbPZr
cXLzm HlKsI YrhDl USeRf sEgDS
kbBHr QdxXY tnIjT UffSu WgOlL
KzuHh ZvPIw mEKte EUesW bIxUL
qHxwX iNEyM llYGz GhGoL jLjGk
hXpCr NNwoC XcYzS btNeL iUXyd
GmYoS XrsSu FEvkD dGzDq RUkMq
xPUpm JpJKi JxLfI lfEKz BpSvD
yBeCo jBoPf LMjhP ZaIrZ dyQxJ
YgcPP gYnMs DoqVm UBcEl dDXha
GEarV zQvAd JJvXq vUMnH xbOUh
UeJcF iHcCi vJpWa MGipL rRoTI
mwUpJ UfdCA jEafV FlkJu VIypK
cUDhI gXkbC yDAzf JuMRm CzRfR
llBCk VuSiU iGvPj iXwKQ qSiMi
ExjMP laRzU XlPmF dnNwW LzvGf
JoTPe kIAiP sOalO pYeXY srYEx
qNFlb FbUVn IjVzV qzTLl lUxIV
iiBeP QfRfX juMfH UtrMn OWaXe
NvkNi BlUyJ MeBjj OVeJt bBXaP
gSeUl EiPsn HoSBe iCeUh HCfBg
yEqTH gGmqX EcmPJ bdVxC ZsKtw
PLmsZ YqnSm GYhSs kEAcX yUdLu
lHNjY jJlCl BlAby KwVtD GieJW
bJrWl vJeFK fyHaU oLnPD pBsiC
JqSqH zXhDl CunRi GTxCi mTUaZ
vGxkK bIFaK oaNXo iYNxu ZtLfH
BfrDF oPjQv aRoHO dJkgD AzgGQ
okHdT aNJdE jnGWw RyrBo CObdY
vOKvg EDjbB bDNns DBsPk dRQzn
LpCOp mQpEv EDoSx nPwHG lSxnS
WgwBH cZufD EoIgG xOzCv LgmYa
TvXJh OtaMg TYpzQ vJVei ZjVpU
aLDrs UxZCi bPyFJ qfAIz hFdCG
qArpV CyrVK uDmwA ToLfE pHvYi
YmsMo WjXOh XzpXe QOhwW xEOcu
KjDnR fLOhx KgWaC EqPob HPgHv
oCbQc PWhyK MsWkZ iJwpO JdNpS
vScNw YnzUj FEmjR sEeYq PBnsL
sSFvK kkQxY UvVmV dgKNb CxEpV
fXpZz kFiRM kqZMp tQcWE ijCxD
WaNgv YDhtI QtvAx YjHxJ HnPtp
CUrGn vTAgo IvQrI Is +
Bob
DcfTV cQrxZ bTBnq HCjwG kNIie
CoAyJ gRUqp PrCoZ IvImh WXiUy
jRkJf FZlSa vNTxY yoCxI ShiID
dXntL XyjPz JkOSm ZomOu UXqWz
aYUvJ yVhEd DqPmg YbBPc SdUrt
OaPTt bAoKZ eoChN iQzRL imGmV
JjMhz EJeUp WpvNe LCgQv qKQco
FMtLs zDGfE lXuKi QqWaw UtMjM
GrjGg JrVVy fYpLC dyWNa SkuGW
qoPtP jISrp SVnVg PrsVx FCdtW
GpOzI gVeCg cEAyL wXtGi QjBce
PyQCs YoVhC hjJPf VklPI lPoUm
KfJdN veXvG ReoWE wiJsM TblSc
QLeKr bXAvv GVwvS rGlUm UAnQa
dBDkO lcBzT qDvGj MfZRw JsfML
eHcTi OpEtP uKbvS CbAhW pMmBv
YvzJX ceEFy yTBcB oIzjG gRTmc
FDcAa YoHlg AoHHo CtDuC wmQTm
mGmKb CCxiY QeIkO yTknZ XcHmZ
jGqOo VkpAs WwFGs RlbYw QXluN
sUUuq KoTdF nFEsc WtPfW UesOP
jbYNc rBjMZ ajHjV zSPyF gyIcV
CzRju MPhGc XipXc HcXOh MfrEz
IFbTp yVXsQ wKyVw LbQzo ZkVDq
SqBbq JWlUu kHmGL leKXy VpqEK
mrLoU rLgTY pqBDj EhuCe OLiPo
DvWrl PMjvM uBbTQ rOulG AfWyt
FjQcL GuSkj EHkXl iGoXI sKobC
TbdDG uViyC JvbRj XyFTy VlJyw
KGoPq MdOjV fVxnS xNpGR vVyIc
VnLpb RaFrU PeIgv YRcCb nAmYG
soXgJ lCzFK rsZpJ KuNpZ npPOo
CmmYy DXbMp VtQzb NFyiK uCLfU
lUxpK MnHbq GsDPq gYpUM fGtHm
mGxFQ bBfiA NlhXI wDyrH XfZnM
xUzCe SryJj UExJm NssDa PObqH
dOEmV vYzHg aNMbw IvVgK PbjQX
kcWKv yGtPs VFkSb fYhAY ssYuY
AtBgs FKdbO
diff --git a/puzzles/crypto/130/key b/puzzles/crypto/130/key new file mode 100644 index 0000000..afe7b8d --- /dev/null +++ b/puzzles/crypto/130/key @@ -0,0 +1 @@ +probable cause diff --git a/puzzles/crypto/130manchester.py b/puzzles/crypto/130manchester.py index 82295d0..b1b6d4f 100644 --- a/puzzles/crypto/130manchester.py +++ b/puzzles/crypto/130manchester.py @@ -3,13 +3,14 @@ the binary.''' import random +import crypto lower = b'abcdefghijklmnopqrstuvwxyz' upper = lower.upper() -plaintext = [b'The next one is in Morris Code. Unlike the previous two, ' - b'they will actually need to determine some sort of key.', - b'Morris code with a key? That sounds bizarre. probable cause'] +alice = b'The next one is in Morris Code. Unlike the previous two, '\ + b'they will actually need to determine some sort of key.' +bob = b'Morris code with a key? That sounds bizarre. probable cause' def encode(text): out = bytearray() @@ -52,9 +53,4 @@ def decode(text): out.append(c) return bytes(out) -c = encode(plaintext[0]) -print('
Alice
', str(c, 'utf-8')) -assert decode(c) == plaintext[0] -c = encode(plaintext[1]) -print('
Bob
', str(c, 'utf-8'), '
') -assert decode(c) == plaintext[1] +crypto.mkIndex(encode, decode, alice, bob, crypto.groups) diff --git a/puzzles/crypto/140morris.py b/puzzles/crypto/140morris.py index 923a48c..8e42391 100644 --- a/puzzles/crypto/140morris.py +++ b/puzzles/crypto/140morris.py @@ -4,6 +4,7 @@ many different possible characters. The 'encryption key' is the set of characters that represent dots, and the set that represents dashes.""" import random +import crypto dots = b'acdfhkjnpsrtx' dashes = b'begilmoquvwyz'