ruby - Unable to get the correct encoding after decryption with XOR-cipher -


given ciphertext 7b5a4215415d544115415d5015455447414c155c46155f4058455c5b523f xored 151515151515151515151515151515151515151515151515151515151515 6e4f57005448415400544845005041525459004953004a554d50494e472a (no rocket science here).

now, i'm trying decode hex encoded string normal string - result should now party jumping\n. unfortunately, is

irb(main):012:0> ["6e4f57005448415400544845005041525459004953004a554d50494e472a"].pack('h*') => "now\x00that\x00the\x00party\x00is\x00jumping*" 

it's close enough me decipher it, bad enough score bad given english letter frequency evaluator.

for of previous strings i've used [str].pack('h*')and went well. example

irb(main):004:0> ["54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f672e"].pack('h*') => "the quick brown fox jumps on lazy dog." 

i'm guessing new dataset has bizarre encoding unable decipher , handle.

any ruby ideas?

you have xor key stream (and therefore ciphertext) 0x20. both turn uppercase lowercase , zeros in spaces (0x20).

so key 0x35 instead of 0x15.


Comments