Estimating Adjacent Character Frequency for Cryptography Python Code Below

Publicado el: 01 enero 1970
en el 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)


En esta página del sitio puede ver el video en línea Estimating Adjacent Character Frequency for Cryptography Python Code Below de Duración hora minuto segunda en buena calidad , que subió el usuario Ralph Turchiano 01 enero 1970, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 10 veces y le gustó like a los espectadores. Disfruta viendo!