0
$\begingroup$

This question already has an answer here:

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.

$\endgroup$

marked as duplicate by Ilmari Karonen, Maarten Bodewes, yyyyyyy, e-sushi May 27 '16 at 11:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    $\begingroup$ Hint: what would you get if you xor two of the ciphertexts together? $\endgroup$ – poncho May 26 '16 at 12:24
  • $\begingroup$ The key stream? $\endgroup$ – Don May 26 '16 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 May 26 '16 at 12:51
  • 1
    $\begingroup$ @Don, no, you get the xor of the two plaintexts. $\endgroup$ – mikeazo May 26 '16 at 13:01

Browse other questions tagged or ask your own question.