import operator
import re
bindosu_dict = {}
for i in range(ord('A'), ord('Z') + 1):
bindosu_dict[chr(i)]=0
def bindosu(data):
global bindosu_dict
for i in range(ord('A'), ord('Z') + 1):
for j in range(0, len(data)):
if ord(data[j]) == i:
bindosu_dict[chr(i)] = bindosu_dict[chr(i)]+1
def add_result(current_result,calulate_result):
result = ""
for i in range(0,len(current_result)):
if (current_result[i]=="_" and calulate_result[i]=="_") or (current_result[i]==" " and calulate_result[i]==" "):
result += current_result[i]
elif current_result[i].isalpha():
result += current_result[i]
elif calulate_result[i].isalpha():
result += calulate_result[i]
return result
bindosu("JV KAS WGUMNAKV NZI VZO RWH QSWI KAMB UV FQMSHI M WU MUCQSBBSI ESQV LSGG IZHS VZOQ BZGOKMZH PSV MB UWIRFRHAMMII KAMB GMKKGS RAWGGSHNS LWB HZK KZZ AWQI LWB MK")
res = sorted(bindosu_dict.items(), key=operator.itemgetter(1), reverse = True)
bindosu_result = ""
for i in range(0,len(res)):
bindosu_result += str(res[i][0]) + "=" + str(res[i][1]) + ", "
print bindosu_result
target = "JV KAS WGUMNAKV NZI VZO RWH QSWI KAMB UV FQMSHI M WU MUCQSBBSI ESQV LSGG IZHS VZOQ BZGOKMZH PSV MB UWIRFRHAMMII KAMB GMKKGS RAWGGSHNS LWB HZK KZZ AWQI LWB MK"
target_1 = "__ ___ ________ ___ ___ ___ ____ ____ __ ______ _ __ _________ ____ ____ ____ ____ ________ ___ __ ____________ ____ ______ _________ ___ ___ ___ ____ ___ __"
print target
while True:
a = raw_input("string = ")
b = raw_input("string = ")
tmp = re.sub('[^' + a + '|\s]', '_',target)
tmp = re.sub('[' + a + ']', b, tmp)
target_1 = add_result(target_1,tmp)
print target
print target_1
Flag = BY THE ALMIGHTY GOD YOU CAN READ THIS MY FRIEND I AM IMPRESSED VERY WELL DONE YOUR SOLUTION KEY IS MADCFCNHIIDD THIS LITTLE CHALLENGE WAS NOT TOO HARD WAS IT
'Wargame > wechall challenge' 카테고리의 다른 글
[wechall challenge] Training: Crypto - Caesar II (0) | 2019.11.04 |
---|---|
[wechall challenge] Training: Crypto - Transposition I (0) | 2019.11.04 |
[wechall challenge] Training: Crypto - Caesar I (0) | 2019.11.04 |