decrypt message
This commit is contained in:
parent
2d0fe0062d
commit
b5e1c0facc
@ -27,3 +27,6 @@
|
|||||||
### expanding-nebula
|
### expanding-nebula
|
||||||
* Completed in: 6 hrs, 49 mins, 26 secs.
|
* Completed in: 6 hrs, 49 mins, 26 secs.
|
||||||
* DP & time complexity optimization
|
* DP & time complexity optimization
|
||||||
|
|
||||||
|
## Encrypted message
|
||||||
|
CFcSBwgCCBoHRhkKU1cGAA4AGU5YQR5THBwNFwoGGAxTQQMQVBUSBg4EAAwQRhUQVBUHFAQTGRpT QQMQVBkPERkECQAWDVwXX1BGEwgJBAwCBFRVHQRGUlFBShwaDVZTGBUFVUdBShsVA1tZBwNGUlFB ShoVB1wXX1BGFAQOSklOQR5HGh5AVRY=
|
||||||
|
|||||||
12
decrypt.py
Normal file
12
decrypt.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import sys
|
||||||
|
if len(sys.argv) != 3:
|
||||||
|
print "Usage: python "+sys.argv[0]+" <encrypted_message> <user_name>"
|
||||||
|
exit(1)
|
||||||
|
encrypted_message = sys.argv[1]
|
||||||
|
user_name = sys.argv[2]
|
||||||
|
|
||||||
|
import base64
|
||||||
|
result = []
|
||||||
|
for i, c in enumerate(base64.b64decode(encrypted_message)):
|
||||||
|
result.append(chr(ord(c) ^ ord(user_name[i % len(user_name)])))
|
||||||
|
print ''.join(result)
|
||||||
Loading…
x
Reference in New Issue
Block a user