-1
$\begingroup$

I am trying to find the key of an XOR-encrypted string in Java. It is very probable that the key is eight characters long. I have the encrypted string.

I do not understand how to go backwards and find the encrypted string. I did some research and found out about Vigenère cipher, and some other things, which were partly too advanced for me, as I am new to this.

I would really appreciate any help.

$\endgroup$
0
$\begingroup$

If your encrypted string is a text (not a random set of characters), then:

  • If the text is short, use brute force. For very short texts there might by more than one solution.
  • If the text is long, select a short range and use brute force. Then apply found key for the whole text. If the decrypted text contains too many words that are not in the dictionary, continue brute force with a small range till the next good key.

Both approaches require little resources and are very quick.

| improve this answer | |
$\endgroup$
0
$\begingroup$

The key to encrypt and decrypt are the same for XOR.

I’m not sure what you exactly need, because you mention that you have the encrypted string ad that you are trying to find the encrypted string.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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