kaisha密码

用来破解一些加密文件

import urllib
from urllib import parse

def str2url(s):
    #s = '9hFaF2FF%_Et%m4F4%538t2i%795E%3pF.265E85.%fnF9742Em33e162_36pA.t6661983%x%6%%74%2i2%22735'
    num_loc = s.find('h')
    rows = int(s[0:num_loc])
    strlen = len(s) - num_loc
    cols = int(strlen/rows)
    right_rows = strlen % rows
    new_s = list(s[num_loc:])
    output = ''
    for i in range(len(new_s)):
        x = i % rows
        y = i / rows
        p = 0
        if x <= right_rows:
            p = x * (cols + 1) + y
        else:
            p = right_rows * (cols + 1) + (x - right_rows) * cols + y
        output += new_s[int(p)]
    return parse.unquote(output).replace('^', '0')


def main():
    s = "6hAFxn752E5F215234uy495-3741E8t%mie15F2E185E%6at%72E%7ba%13t21at27261734458%h3%%-5a885d5pF2m%%11799662E13_D55%E992E48%%8i222%4%59358.Fk1EE5-8bc%7632..FF%5%24_%9_mae58%E513e51"
    result_str = str2url(s)
    print(result_str)

main()


  转载请注明: 微笑看你 kaisha密码

 上一篇
summary summary
选择器 一个标签有多个类属性时,取到这个标签的时候,多个类属性之间用不用空格隔开,正常表示result = soup.select('.-live-layout-row.layout_sports_350_650') 清除数据库清除自
2018-05-19
下一篇 
Linux-vim-practice Linux-vim-practice
practice1_fish#!/usr/bin/python3 """ 穷举法:穷尽所有可能直到找到正确答案 """ def main(): """分鱼""" fish = 1 while True:
2018-05-14
  目录