import
base64
def
mbox(numArr,
str
):
for
i
in
range
(
256
):
numArr[i]
=
i
i2
=
0
for
i3
in
range
(
256
):
i2
=
((i2
+
numArr[i3])
+
ord
(
str
[i3
%
len
(
str
)]))
%
256
numArr[i3],numArr[i2]
=
numArr[i2],numArr[i3]
return
numArr
def
genenc(numArr,chArr,i):
i2
=
i3
=
0
for
i4
in
range
(i):
i2
=
(i2
+
1
)
%
256
i3
=
(i3
+
numArr[i2])
%
256
;
numArr[i3],numArr[i2]
=
numArr[i2],numArr[i3]
chArr[i4]
=
numArr[(numArr[i2]
+
numArr[i3])
%
256
]
return
chArr
def
encrypt(
str
,str2):
numArr
=
[
0
]
*
256
chArr
=
[
0
]
*
(
len
(
str
))
mbox(numArr,str2)
genenc(numArr, chArr,
len
(
str
))
result
=
[]
for
i
in
range
(
len
(
str
)):
result.append(
ord
(
str
[i])^chArr[i]);
return
result
def
b64():
raw_table
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
new_table
=
'0123456789ABCMtuvwxNOPQRabcdefghijklSTUVWXDEFGHIJKLYZmnopqrsyz+/'
dictionary_decode
=
str
.maketrans(new_table, raw_table)
cipher
=
'Jr0VJ81KJD1PJpY2WytxgeAnJWu2H1qutyA0xFtyJrZHJrZeJrM8ATCWJWft9FtgJsV2SCtR4yASJrE2Uv=='
return
(base64.b64decode(cipher.translate(dictionary_decode)))
enc
=
b64()
enc
=
enc.replace(b
'\xc0\x80'
,b
'\x00'
)
print
(''.join([
chr
(x)
for
x
in
encrypt(enc.decode(),
"runrunrun"
)]))