March 3rd, 2009, 04:29 PM

Help with a xor on alphabetic position
Can Any one help me with this.
Encrypt the given value using xor on alphabetic position.
Use ? for 0 and ABCDE to extend the set to 5 bits: key = key
Value is "jackpot"
And pls explain the steps
Comments on this post
March 4th, 2009, 12:56 AM

Encrypt the given value using xor on alphabetic position.
Use ? for 0 and ABCDE to extend the set to 5 bits: key = key
Value is "jackpot"
Sounds like homework.
A quick example using 8bits. Totally made up, but will point you in the right direction.
Assume the letter A is encoded 10000000
B is 10000001
C is 10000010
etc..
If I have the string "HELLO":
Code:
10001000 = H
10000101 = E
10001100 = L
10001100 = L
10001111 = O
1000100010000101100011001000110010001111
represents my HELLO string, or plaintext, in 5 x 8 bits = 40 bits.
If my key is "KEY", and I repeat this for the length of the message (so the key length is the same as the message length), I get:
Code:
10001011 = K
10000101 = E
10011001 = Y
1000101110000101100110011000101110000101
as my key.
Putting them side by side and XORing I get:
Code:
1000100010000101100011001000110010001111 (PLAINTEXT)
1000101110000101100110011000101110000101 XOR (KEY)
========================================
0000001100000000000101010000011100001010 (CIPHERTEXT)
as the ciphertext.
XOR Truth Table:
Code:
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0
Hopefully this will help you solve your problem.
Best regards,
AstroTux.
Last edited by AstroTux; March 4th, 2009 at 01:02 AM.
March 4th, 2009, 06:30 AM

Hi AstroTux.
Thanks for your reply.
I followed ur steps but it didn't work
j = 01101010
a = 01100001
c = 01100011
k = 01101011
p = 01110000
o = 01101111
t = 01110100
01101011011001010111100101101011011001010111100101101011
k = 01101011
e = 01100101
y = 01111001
01101011011001010111100101101011011001010111100101101011
01101010011000010110001101101011011100000110111101110100 (PLAINTEXT)
01101011011001010111100101101011011001010111100101101011 XOR (KEY)
________________________________________________________
00000001000001000001101100000000000101010001011000011111 (CIPHERTEXT)
Plz Help
March 4th, 2009, 10:40 PM

Hi,
I don't know what you did, but your long strings of bits are wrong.
Your translations of letters to bits seems OK, but the long string to make J A C K P O T should read:
Code:
01101010011000010110001101101011011100000110111101110100
Compare with your (incorrect) string of:
Code:
01101011011001010111100101101011011001010111100101101011
See the difference in bit patterns between the two plaintexts:
Code:
01101010011000010110001101101011011100000110111101110100  correct (JACKPOT)
01101011011001010111100101101011011001010111100101101011  incorrect
You need to rework my example to work for your key, the word JACKPOT, and how you're supposed to extend the key to match the message length.
Best regards,
AstroTux.
Last edited by AstroTux; March 4th, 2009 at 10:44 PM.
March 5th, 2009, 01:01 AM

Possible bigendian vs littleendian issue?
March 5th, 2009, 08:49 AM

Hi Astro Tux,
Thanks for your reply,
I am sorry, It was a copy paste error.
Please have a look at the calculation
01101010011000010110001101101011011100000110111101110100 (PLAINTEXT JACKPOT)
01101011011001010111100101101011011001010111100101101011 XOR (KEY)
________________________________________________________
00000001000001000001101100000000000101010001011000011111 (CIPHERTEXT)
Its not working
I tried even converting this bits to alphabetic.. No go...
Plz help
March 5th, 2009, 11:06 AM

What isn't working?
There is an error in the string:
Here's a proof of the reversal:
Plaintext to Ciphertext:
Code:
0100101110100010101  plaintext
1011000101101010110  key
===================
1111101011001000011  ciphertext
Ciphertext to Plaintext:
Code:
1111101011001000011  ciphertext
1011000101101010110  key
===================
0100101110100010101  computed plaintext
0100101110100010101  original plaintext for comparison
To represent all 26 characters of the alphabet, you need 5 bits
((2^5)1) = 31.
Code:
A = 00001
B = 00010
C = 00011
...
X = 10110
Y = 10111
Z = 11000
HI (plaintext)
Code:
H = 8 = 01000
I = 9 = 01001
AB (key)
Code:
A = 00001
B = 00010
Code:
0100001001  HI
0000100010  AB
==========
0100101011  CIPHER TEXT
01001 = I
01011 = J
HI xor AB = IJ
JOKER
Code:
J = 01010
O = 15 = 01111
K = 11 = 01011
E = 5 = 00101
R = 18 = 10010
KEY
Code:
K = 11 = 01011
E = 5 = 00101
Y = 25 = 11001
JOKER xor KEYKE
Code:
0101001111010110010110010 JOKER
0101100101110010101100101 KEYKE
=============================
0000101010100100111010111 AJRNW
The ciphertext is AJRNW.
To solve the case of:
A xor Z
Code:
00001 xor 11000 = 11001
you will need to fix the problem of the remaining values not having a character. If you simply repeat the letters "A", "B" etc.. you get ambiguity. Is it "A" 00001 or "A" 11001?
To solve this you need to use additional characters. We're short of 7 characters. You can use the printable characters:
Code:
!, ", £, $, %, ^, &
and assign them thus:
Code:
11001 = !
11010 = "
11011 = £
11100 = $
11101 = %
11110 = ^
11111 = &
so A xor Z:
Code:
00001  A
11000  Z
=====
11001  !
The ciphertext is !.
Best regards,
AstroTux.
Last edited by AstroTux; March 5th, 2009 at 11:46 AM.
March 6th, 2009, 05:10 PM

Hi AstroTux.
Thanks for Ur reply, I really appreciate it.
CODE
J = 10 = 01010
A = 1 = 00001
C = 3 = 00011
K = 11 = 01011
P = 16 = 10000
O = 15 = 01111
T = 20 = 10100
K = 11 = 01011
E = 5 = 00101
Y = 25 = 11001
JACKPOT xor KEYKEYK
01010 00001 00011 01011 10000 01111 10100 ( JACKPOT )
01011 00101 11001 01011 00101 11001 01011 ( KEYKEYK )

00001 00100 11010 00000 10101 10110 11111 ( ADZ?UV& )

00001 = A
00100 = D
11010 = Z
00000 =
10101 = U
10110 = V
11111 = &
How do we convert 00000 [I tried with .(period)No go]
Please help.
Comments on this post
October 12th, 2010, 03:40 PM

I may have your answer!!!
Right, here go's
you are using 5 bits, which the question tells you to do. What astrotux has told you is pretty much on the dot except he didnt read your question properly.
as i said you are using 5 bits which is 31 charecters. Your question tells you to use A B C D E to make it upto 5 bits therfore when you get 11100 which is 28, you should use the CAPITOL 'B' so the first 26 binary numbers use lower case and the last 5 use the capitals.
As for 00000, the question tells you to use '?'. I would suggest using the question mark symbol to represent 00000.
So your answer would be: adz?uvE
Hope this helps.