Solved

# XOR Encryption

Posted on 2004-11-25
620 Views
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
0
Question by:dynamicrevolutions

LVL 63

Expert Comment

I can give you an example if you can convince me that this is not your homework.
0

LVL 31

Accepted Solution

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

LVL 25

Assisted Solution

0

LVL 5

Author Comment

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

## Featured Post

### Suggested Solutions

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be \$37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…