1

I have the ciphertext and an encrypting program (with the key hardcoded in). How would I go about finding the key? Surely the availability of the encryptor must open up possibilities beyond brute-forcing it.

asked May 31, 2010 at 15:06

3 Answers 3

2

Yes knowing the algorithm may help in decoding the cypher text, but only if there is a flaw in the algorithm that may be exploited. (the good news is Playfair has some flaws that can be exploited)

Here are a few good starting points to read.

  1. Wikipedia (read it all - particularly Cryptanalysis)
  2. Basic Cryptanalysis (look at chapter 7)

The second one is not what I would call a light read, but interesting if you're into cyphers.

answered Jun 3, 2010 at 12:52
Sign up to request clarification or add additional context in comments.

Comments

0

I've found a way in five lines (obviously re-evaluated a bit, and admittedly very long lines):

(a,b,c)="".join((input("CODE: ")).split()),input("Polybius Square: "),"" 
for i in a:
 c+=str(int(((b.find(i))-((b.find(i))%5))/5))+str((b.find(i))%5)
for j in range(0,(int(len(c)/2))):
 print((b[((5*(int((c[:(int(len(c)/2))])[j])))+(int((c[(int(len(c)/2)):])[j])))]).lower(),end="")

NB: When prompted to enter the polybius square, first enter row 1, then row 2 etc, no spaces

Then you just have to remove unnecessary 'x's and voila!

answered Jan 22, 2014 at 17:43

Comments

0

Try:

(a,b,f,g,c)="".join(input("CODE: ").split()),input("Polybius S: "),"","",1
for(i)in(a):
 if(c%2)==0:
 g+=i
 else:
 f+=i
 c+=1
for(j)in(range(0,len(f))):
 if(b.find(f[j])%5)!=(b.find(g[j])%5)and(int(((b.find(f[j]))-(b.find(f[j])%5))/5))!=(int(((b.find(g[j]))-(b.find(g[j])%5))/5)):
 print(b[((int(((b.find(f[j]))-(b.find(f[j])%5))/5))*5)+(b.find(g[j])%5)],end="")
 print(b[((int(((b.find(g[j]))-(b.find(g[j])%5))/5))*5)+(b.find(f[j])%5)],end="")
 elif(b.find(f[j])%5)==(b.find(g[j])%5)and(int(((b.find(f[j]))-(b.find(f[j])%5))/5))!=(int(((b.find(g[j]))-(b.find(g[j])%5))/5)):
 print(b[((((int(((b.find(f[j]))-(b.find(f[j])%5))/5))-1)%5)*5)+b.find(f[j])%5],end="")
 print(b[((((int(((b.find(g[j]))-(b.find(g[j])%5))/5))-1)%5)*5)+b.find(g[j])%5],end="")
 elif(b.find(f[j])%5)!=(b.find(g[j])%5)and(int(((b.find(f[j]))-(b.find(f[j])%5))/5))==(int(((b.find(g[j]))-(b.find(g[j])%5))/5)):
 print(b[((int(((b.find(f[j]))-(b.find(f[j])%5))/5))*5)+((b.find(f[j])%5)-1)%5],end="")
 print(b[((int(((b.find(g[j]))-(b.find(g[j])%5))/5))*5)+((b.find(g[j])%5)-1)%5],end="")

It's not pretty, but it works

answered Jan 22, 2014 at 17:47

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.