Estimating Adjacent Character Frequency for Cryptography Python Code Below

Pubblicato il: 01 gennaio 1970
sul canale di: 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)


In questa pagina del sito puoi guardare il video online Estimating Adjacent Character Frequency for Cryptography Python Code Below della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Ralph Turchiano 01 gennaio 1970, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 10 volte e gli è piaciuto like spettatori. Buona visione!