[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

XOR Encryption

Posted on 2004-11-25
4
Medium Priority
?
640 Views
Last Modified: 2008-02-01
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
Comment
Question by:dynamicrevolutions
4 Comments
 
LVL 63

Expert Comment

by:Zvonko
ID: 12674176
I can give you an example if you can convince me that this is not your homework.
0
 
LVL 31

Accepted Solution

by:
GwynforWeb earned 1600 total points
ID: 12676407
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)))
alert(str)
</script>
0
 
LVL 25

Assisted Solution

by:archrajan
archrajan earned 400 total points
ID: 12676778
0
 
LVL 5

Author Comment

by:dynamicrevolutions
ID: 12678469
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question