# XOR Encryption

Problem Specification
A message in English is encrypted using XOR-encryption. The input is the encrypted message. The output should be the original plaintext message. It is known that the length of the key used is less than 100 characters. Also, the encrypted message is represented in hexadecimal format. Come out the solution for the sample question and answer.Help !

Example
Sample Input:
0538031B145A4114474400393F181C145E5747550514347E

Sample Output:
This is a short message.

Note:
The key used in this example is
QPjh4324&ds
LVL 5
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Systems architectCommented:
I can give you an example if you can convince me that this is not your homework.
0
Commented:
Here is something to get you started with the syntax. Now put every thing in a loop after you form the arrays holding the key and coded message

<script>
str=''
str=str+String.fromCharCode('Q'.charCodeAt(0)^((0x05).toString(10)))
str=str+String.fromCharCode('P'.charCodeAt(0)^((0x38).toString(10)))
str=str+String.fromCharCode('j'.charCodeAt(0)^((0x03).toString(10)))
str=str+String.fromCharCode('h'.charCodeAt(0)^((0x1B).toString(10)))
str=str+String.fromCharCode('4'.charCodeAt(0)^((0x14).toString(10)))
str=str+String.fromCharCode('3'.charCodeAt(0)^((0x5A).toString(10)))
</script>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
0
Author Commented:
thanks. gave me some insights about XOR. one question, is it possible to decrypt it without knowing the key? but knowing the output it plain a-Z and length of key is less than 100. technically is it possible?thanks
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.