#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0

    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

    • AstroTux disagrees : March 13th 2009: Looks like spam. Interactive and time wasting, there is another thread identical to this one that has just started. I'm not participating.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2008
    Posts
    601
    Rep Power
    43
    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 8-bits. 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 12:02 AM.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0
    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
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2008
    Posts
    601
    Rep Power
    43
    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 re-work 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 09:44 PM.
  8. #5
  9. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Sep 2007
    Location
    outside Washington DC
    Posts
    2,642
    Rep Power
    3699
    Possible big-endian vs little-endian issue?
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0
    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
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2008
    Posts
    601
    Rep Power
    43
    Its not working
    What isn't working?

    There is an error in the string:

    Code:
    11
    01
    ==
    11
    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:
    01010-01111-01011-00101-10010 J-O-K-E-R
    01011-00101-11001-01011-00101 K-E-Y-K-E
    =============================
    00001-01010-10010-01110-10111 A-J-R-N-W
    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 10:46 AM.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0
    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 ( J-A-C-K-P-O-T )
    01011 00101 11001 01011 00101 11001 01011 ( K-E-Y-K-E-Y-K )
    -------------------------------------------------------------
    00001 00100 11010 00000 10101 10110 11111 ( A-D-Z-?-U-V-& )
    -------------------------------------------------------------

    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

    • AstroTux disagrees : Interactive spam/time wasting. You said in your OP that 00000 was to be represented by '?'. I'm not participating further. Reported.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2010
    Posts
    1
    Rep Power
    0

    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.

IMN logo majestic logo threadwatch logo seochat tools logo