I'm researching RC4 and I am trying to recreate a condition where RC4 is crackable. However I can't quite find the article/resource I need to find the weakness for an implementation like this (python):

from Crypto.Cipher import ARC4
f = open('key.txt')
key = f.readline().strip()

o = open('output.txt','w')
f = open('input.txt')
for line in f:
    cipher = ARC4.new(key)
    print >>o, cipher.encrypt(line).encode('hex')

I know the weakness is that the same key is used to encrypt the traffic, however I need a hint as to how this might impact the security of the algorithm.

  • 2
    $\begingroup$ Hint: what would you get if you xor two of the ciphertexts together? $\endgroup$
    – poncho
    Commented May 26, 2016 at 12:24
  • $\begingroup$ The key stream? $\endgroup$
    – Don
    Commented May 26, 2016 at 12:34
  • 2
    $\begingroup$ Potentially interesting as it contains links to papers and infos related to your Q as well as some python files to play with in the “Resources” section $\rightarrow$ rc4nomore.com $\endgroup$
    – e-sushi
    Commented May 26, 2016 at 12:51
  • 1
    $\begingroup$ @Don, no, you get the xor of the two plaintexts. $\endgroup$
    – mikeazo
    Commented May 26, 2016 at 13:01


Browse other questions tagged or ask your own question.