Estimating Adjacent Character Frequency for Cryptography Python Code Below

Publicado em: 01 Janeiro 1970
no canal de: Ralph Turchiano
10
like

Very Dirty Program using my highly rudimentary skills. Just throw in a bunch of files where it will group what is to the right and left of a known character to give you the probability of what is on either side. Very similar to a maze.
#filemethods #letterfrequency #pythoncode
print("Basic Adjacent Letter Frequency Estimator - By Ralph Turchiano")
filenames = ['crypt1.txt', 'crypt2.txt', 'crypt3.txt','crypt4.txt','crypt5.txt','dailymail.txt']
with open('cryptall.txt', 'w') as outfile:
for fname in filenames:
with open(fname) as infile:
outfile.write(infile.read())
ggg = 'cryptall.txt'
ggh = open(ggg)
lo=[]
ggj =ggh.read().strip("\n").upper()
ggl = ggj.split(" ")
for jj in ggl:
for cg in jj:
lo.append(cg)
fullcount ={}
q=0
w=0
totaling = 0
for iio in lo:
try:
totaling+=1
w+=1
adf = lo[q]+lo[w]
q+=1
fullcount[adf]= fullcount.get(adf,0) +1
except:
print("Calibration Complete, Combo Count = ", totaling)
for hjk,gl in fullcount.items():
hj = round((gl/totaling) *100,2)
fullcount[hjk]=hj,gl
jkh = sorted([(k,v) for v,k in fullcount.items()], reverse = True)
for rdout in jkh[:11]:
print(rdout[0][0],"% " ,"Letter",rdout[1])
ytyt = []
tyt = input("Probability Indicator:" ).upper()
ytyt.append(tyt)
print(ytyt)
for fn in jkh[:]:
try:
t1 = fn[1][1]
t2 = fn[1][0]
if tyt == t1:
print(fn[1][0],"Left", fn[0][0])
elif tyt == t2:
print(fn[1][1],"Right", fn[0][0])
except:
print("woops, time to go grab a rubber ducky")
print(fullcount)


Nesta página do site você pode assistir ao vídeo on-line Estimating Adjacent Character Frequency for Cryptography Python Code Below duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Ralph Turchiano 01 Janeiro 1970, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 10 vezes e gostou like espectadores. Boa visualização!