Estimating Adjacent Character Frequency for Cryptography Python Code Below

Publié le: 01 janvier 1970
sur la chaîne: 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)


Sur cette page du site, vous pouvez voir la vidéo en ligne Estimating Adjacent Character Frequency for Cryptography Python Code Below durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Ralph Turchiano 01 janvier 1970, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 10 fois et il a aimé like téléspectateurs. Bon visionnage!