Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
71
Task/Bifid-cipher/EasyLang/bifid-cipher.easy
Normal file
71
Task/Bifid-cipher/EasyLang/bifid-cipher.easy
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
func$ crypt enc msg$ key$ .
|
||||
key$[] = strchars key$
|
||||
n = len msg$
|
||||
for i to len msg$
|
||||
c$ = substr msg$ i 1
|
||||
for j to 25
|
||||
if c$ = key$[j]
|
||||
break 1
|
||||
.
|
||||
.
|
||||
j -= 1
|
||||
h[] &= j div 5
|
||||
h[] &= j mod 5
|
||||
.
|
||||
if enc = 1
|
||||
for i = 1 step 4 to 2 * n - 3
|
||||
j = h[i] * 5 + h[i + 2] + 1
|
||||
r$ &= key$[j]
|
||||
.
|
||||
for i = 2 step 4 to 2 * n - 2
|
||||
j = h[i] * 5 + h[i + 2] + 1
|
||||
r$ &= key$[j]
|
||||
.
|
||||
else
|
||||
for i = 1 to n
|
||||
j = h[i] * 5 + h[i + n] + 1
|
||||
r$ &= key$[j]
|
||||
.
|
||||
.
|
||||
return r$
|
||||
.
|
||||
func$ conv s$ .
|
||||
for e$ in strchars s$
|
||||
h = strcode e$
|
||||
if h >= 97
|
||||
h -= 32
|
||||
.
|
||||
if h >= 65 and h <= 91
|
||||
if h = 74
|
||||
h = 73
|
||||
.
|
||||
r$ &= strchar h
|
||||
.
|
||||
.
|
||||
return r$
|
||||
.
|
||||
func$ encr msg$ key$ .
|
||||
return crypt 1 conv msg$ key$
|
||||
.
|
||||
func$ decr msg$ key$ .
|
||||
return crypt 0 msg$ key$
|
||||
.
|
||||
key$ = "ABCDEFGHIKLMNOPQRSTUVWXYZ"
|
||||
h$ = encr "ATTACKATDAWN" key$
|
||||
print h$
|
||||
print decr h$ key$
|
||||
print ""
|
||||
#
|
||||
key$ = "BGWKZQPNDSIOAXEFCLUMTHYVR"
|
||||
h$ = encr "FLEEATONCE" key$
|
||||
print h$
|
||||
print decr h$ key$
|
||||
print ""
|
||||
h$ = encr "ATTACKATDAWN" key$
|
||||
print h$
|
||||
print decr h$ key$
|
||||
print ""
|
||||
#
|
||||
h$ = encr "The invasion will start on the first of January" key$
|
||||
print h$
|
||||
print decr h$ key$
|
||||
97
Task/Bifid-cipher/Quackery/bifid-cipher.quackery
Normal file
97
Task/Bifid-cipher/Quackery/bifid-cipher.quackery
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
[ $ "" swap
|
||||
witheach
|
||||
[ upper
|
||||
dup char I > if [ 1 - ]
|
||||
dup char A char Z
|
||||
within iff
|
||||
[ char A - join ]
|
||||
else drop ] ] is ->0..24 ( $ --> [ )
|
||||
|
||||
[ $ "" swap
|
||||
witheach
|
||||
[ char A +
|
||||
dup char I > if 1+
|
||||
join ] ] is ->A..Z ( [ --> $ )
|
||||
|
||||
[ [] 5 times
|
||||
[ dip ->0..24 join ] ] is makesquare ( $ $ $ $ $ --> [ )
|
||||
|
||||
[ dup witheach
|
||||
[ i^ unrot poke ] ] is makeindex ( [ --> [ )
|
||||
|
||||
[ dup temp put
|
||||
makeindex temp put
|
||||
->0..24
|
||||
[] swap witheach
|
||||
[ temp share swap peek
|
||||
5 /mod join
|
||||
nested join ]
|
||||
temp release
|
||||
transpose
|
||||
unpack join
|
||||
[] swap
|
||||
dup size 2 / times
|
||||
[ 2 split dip
|
||||
[ nested join ] ]
|
||||
drop
|
||||
$ "" swap
|
||||
witheach
|
||||
[ unpack swap 5 * +
|
||||
temp share swap peek
|
||||
join ]
|
||||
->A..Z
|
||||
temp release ] is encrypt ( $ [ --> $ )
|
||||
|
||||
[ dup temp put
|
||||
makeindex temp put
|
||||
->0..24
|
||||
[] swap witheach
|
||||
[ temp share swap peek
|
||||
5 /mod join join ]
|
||||
temp release
|
||||
dup size 2 / split
|
||||
2 pack
|
||||
transpose
|
||||
[] swap witheach
|
||||
[ unpack swap 5 * +
|
||||
temp share swap peek
|
||||
join ]
|
||||
->A..Z
|
||||
temp release ] is decrypt ( $ [ --> $ )
|
||||
|
||||
[ $ "ABCDE"
|
||||
$ "FGHIK"
|
||||
$ "LMNOP"
|
||||
$ "QRSTU"
|
||||
$ "VWXYZ"
|
||||
makesquare ] constant is tasksquare ( --> [ )
|
||||
|
||||
[ $ "BGWKZ"
|
||||
$ "QPNDS"
|
||||
$ "IOAXE"
|
||||
$ "FCLUM"
|
||||
$ "THYVR"
|
||||
makesquare ] constant is wikisquare ( --> [ )
|
||||
|
||||
[ $ "QUACK"
|
||||
$ "DEPTH"
|
||||
$ "LYING"
|
||||
$ "FORMS"
|
||||
$ "BVWXZ"
|
||||
makesquare ] constant is ducksquare ( --> [ )
|
||||
|
||||
|
||||
say "Using tasksquare:" cr
|
||||
$ "Attack at dawn." dup echo$ say " -> "
|
||||
tasksquare encrypt dup echo$ say " -> "
|
||||
tasksquare decrypt echo$
|
||||
cr cr
|
||||
say "Using wikisquare:" cr
|
||||
$ "Flee at once." dup echo$ say " -> "
|
||||
wikisquare encrypt dup echo$ say " -> "
|
||||
wikisquare decrypt echo$
|
||||
cr cr
|
||||
say "Using ducksquare:" cr
|
||||
$ "The invasion will start on the first of January." dup echo$ cr say " -> "
|
||||
ducksquare encrypt dup echo$ cr say " -> "
|
||||
ducksquare decrypt echo$
|
||||
Loading…
Add table
Add a link
Reference in a new issue