xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 3KB
    文件類型: .py
    金幣: 1
    下載: 0 次
    發布日期: 2021-05-06
  • 語言: Python
  • 標簽: 重合指數??派森??

資源簡介

重合指數學過密碼學的人都知道計算他的重要性,python實現又快又好

資源截圖

代碼片段和文件信息

from?copy?import?copy
from?itertools?import?product
from?tqdm?import?tqdm

def?calcAscii(s):
????i?=?0
????for?c?in?s:
????????if?ord(c)?==?0x0d?or?(ord(c)?>=?0x20?and?ord(c)?????????????i?=?i?+?1
????return?i

def?ratio(src?length):
????TotalOfEquals?=?0
????total?=?0
????for?i?in?range(0?length):
????????for?j?in?range(i+1?length):
????????????total?+=?1
????????????if?src[i]?==?src[j]:
????????????????TotalOfEquals?+=?1
????return?1.0?*?TotalOfEquals?/?total?

def?CalcCoin(cipher):
????clen?=?len(cipher)
????rotioArray?=?[]
????for?x?in?range(126):
????????tempfloat?=?0.0
????????averRatio?=?0.0
????????for?n?in?range(x):
????????????index?=?0
????????????tempArray?=?‘‘
????????????tempTotal?=?0
????????????m?=?n
????????????while?m?????????????????tempArray?=?tempArray?+?cipher[m]
????????????????tempTotal?+=?1
????????????????m?+=?x
????????????tempfloat?=?ratio(tempArray?tempTotal)
????????????averRatio?=?averRatio?+?tempfloat
????????rotioArray.append([averRatio?/?x?x])
????rotioArray.sort()
????return?rotioArray
????
encraw?=?open(‘file‘?‘rb‘).read()

print?CalcCoin(encraw)

‘‘‘
def?psgen(minlenmaxlen=4):
??iter?=?[
??????‘0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_!@#$%^&*()_+-=‘~[]{}\\|;\‘:“./<>?‘
??????#
??????]
??for?r?in?iter:
????for?repeat?in?range(minlenmaxlen+1):
??????for?ps?in?product(rrepeat=repeat):
????????yield?‘‘.join(ps)

def?trykey(keyencraw):
????global?maxfound
????enc?=?copy(encraw)
????for?i?in?range(len(enc)):
????????if?key[i?%?

評論

共有 條評論

相關資源