home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / ghiribizzo / Oldfile / ghiric17.txt < prev    next >
Encoding:
PGP Message  |  2000-05-25  |  1.9 KB  |  50 lines

  1. -----BEGIN PGP SIGNED MESSAGE-----
  2.  
  3. Contraband 9g
  4.  
  5. First I performed a binary compare of the two images. I
  6. noted that the differences were in the range 3F-150B. That's
  7. 5324 bytes. We can be quite sure that the actual number of
  8. bytes is very close to this number because there is a 0.5
  9. chance of being one byte more, 0.25 chance of being 2 bytes
  10. more etc. We know the length of the file is 587 bytes so
  11. 5324/587 gives 9.
  12. Now, we know from looking at the source code that:
  13.  
  14. Block size = 8 + (digit 2 of PIN) mod 4
  15.  
  16. i.e. PIN(2) = 1 (mod 4) => PIN(2) = 1, 5 or 9 (considering
  17. digits only)
  18.  
  19. I became rather lazy now and opted for the brute force
  20. method. Since there are only 10 digits to search through, I
  21. just did this by hand. I tried values x100 until I got an
  22. output file of the right length. Now as the encryption used
  23. by Contraband is merely a simple XOR with a one byte key,
  24. decrypting the file is trivial. However, since we are told
  25. that the file contains URLs and ';;?u`` matches marvellously
  26. the http:// we are expecting we can perform a known
  27. plaintext attack. I decrypted using a utility I wrote a
  28. while ago, but you can do the same using HIEW by XORing the
  29. first byte with 'h' and then noting the value 'O'. Then xor
  30. the rest of the file using the value 'O' to get it in
  31. decrypted form.
  32.  
  33. It wouldn't be difficult to write a program to automate a
  34. lot of these steps as a lot of the code you need is already
  35. written for you in the source of Contraband itself!
  36.  
  37. -----BEGIN PGP SIGNATURE-----
  38. Version: PGP for Personal Privacy 5.0
  39. Charset: noconv
  40.  
  41. iQEVAwUBNK5wgf2BzbC3j9ThAQF71AgArrbMqLWsDgI7q9MC8VU8Yu7R2uS5MpPN
  42. iiXNihrgL8KpNS1FfToZdfcB1IubFxZn17TX+bhWYUblhHoKS0wxL+icfqMZguri
  43. nTDa4uqWVMvKv1Ii7J0pS1AKkjrOSpSWaZB8H7SDWCYF4MwlELxhJAM8CKJIasbQ
  44. IKTKjnhRgE2JMdiDyr9Nmg9sEcDMVNzEdrJm0ZU4JKFw59mcimoALf4B/r76KlUj
  45. c9dmB0vvi0IziSIplYGOV/PRHdqJgzaS/PceWMKCJVdWuaz3hhgdVshOnhJGzvY8
  46. cFUU3HaeV+z8c/UdofRIoSeE+jqoOJYLPIvPfbqrEoHogX3JizRDig==
  47. =iT76
  48. -----END PGP SIGNATURE-----
  49.  
  50.