I am working with an older piece of software that generates encrypted backups that I'd like to decrypt. I have a plaintext key, a few examples of encrypted data and I'm pretty sure the data is ASCII, but I don't know how they derive the RC4 key from the plaintext key.

How would I go about testing key derivations comprehensively? The space must be relatively small, even if I'm considering all the RC4 key lengths.

  • 1
    $\begingroup$ Have you tried just inserting the plaintext key into the RC4 algorithm as is? It does take variable length (1-256 byte) keys, so that's the obvious way they might have implemented it. $\endgroup$
    – poncho
    Jan 17, 2022 at 1:44
  • $\begingroup$ @poncho The key itself is 237 bytes long - I believe that's too long, isn't it? $\endgroup$
    – slipheed
    Jan 17, 2022 at 2:11
  • $\begingroup$ No, it's not too long; RC4 can handle keys up to 256 bytes in length $\endgroup$
    – poncho
    Jan 17, 2022 at 3:22
  • $\begingroup$ @poncho, thanks that turned out to be it! It was a raw key. $\endgroup$
    – slipheed
    Jan 18, 2022 at 0:29

1 Answer 1


How would I go about testing key derivations comprehensively?

Why don't you start with the most obvious possibility first? RC4 takes a variable length (1-256 byte) key; perhaps they used the key you present directly as into to the RC4 key setup algorithm?

[From your comments, we already know this answer is the correct one - this is just so that the question has an official answer]


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.