Modify Jpeg via BinaryWriter renders "useless" output

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard Coltrane

    Modify Jpeg via BinaryWriter renders "useless" output

    Hello,

    If i take a jpeg and pipe it from a binary reader to a binary writer,
    everything is fine and I can still use it.
    If i take that same jpeg and piping code and simply add a byte encoded
    string to the front of the file then I can no longer open it in an image
    editor. This i would expect.

    However if i open that image in notebook and remove the string I entered,
    then i still cant open the file in an image editor, does anyone know why
    this is?? Once ive removed the 4 character string with notepad the files are
    "seemingly" exactly the same?? They have precisely the same file size (down
    to the byte) and the bytes within the file are also exactly the same??

    Whats different?

    Thanks



  • =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=

    #2
    RE: Modify Jpeg via BinaryWriter renders "useless&q uot; output

    If your goal is to embed messages into images, you want to look into
    steganography. Corinna Johns has a series of articles on codeproject.com on
    the subject.
    -- Peter
    Site: http://www.eggheadcafe.com
    UnBlog: htp://petesbloggerama .blogspot.com
    Short Urls & more: http://ittyurl.net


    "Richard Coltrane" wrote:
    Hello,
    >
    If i take a jpeg and pipe it from a binary reader to a binary writer,
    everything is fine and I can still use it.
    If i take that same jpeg and piping code and simply add a byte encoded
    string to the front of the file then I can no longer open it in an image
    editor. This i would expect.
    >
    However if i open that image in notebook and remove the string I entered,
    then i still cant open the file in an image editor, does anyone know why
    this is?? Once ive removed the 4 character string with notepad the files are
    "seemingly" exactly the same?? They have precisely the same file size (down
    to the byte) and the bytes within the file are also exactly the same??
    >
    Whats different?
    >
    Thanks
    >
    >
    >
    >

    Comment

    • Hans Kesting

      #3
      Re: Modify Jpeg via BinaryWriter renders "useless&q uot; output

      Richard Coltrane formulated on zondag :
      Hello,
      >
      If i take a jpeg and pipe it from a binary reader to a binary writer,
      everything is fine and I can still use it.
      If i take that same jpeg and piping code and simply add a byte encoded string
      to the front of the file then I can no longer open it in an image editor.
      This i would expect.
      >
      However if i open that image in notebook and remove the string I entered,
      then i still cant open the file in an image editor, does anyone know why this
      is?? Once ive removed the 4 character string with notepad the files are
      "seemingly" exactly the same?? They have precisely the same file size (down
      to the byte) and the bytes within the file are also exactly the same??
      >
      Whats different?
      >
      Thanks
      Try using your own process in reverse: use a .Net program to strip
      those first bytes and leave the rest of the data intact.
      I suspect that that *will* work (see the other replies)

      Hans Kesting


      Comment

      • Richard Coltrane

        #4
        Re: Modify Jpeg via BinaryWriter renders "useless&q uot; output

        Hi Peter,

        no it wasn't but thanks for the response, ive always wonderd what that was
        called. Spies and school kids use that stuff right?


        "Peter Bromberg [C# MVP]" <pbromberg@yaho o.NoSpamMaam.co mwrote in message
        news:B003760B-3A66-4FC4-A5A6-1CC22D2A7B2C@mi crosoft.com...
        If your goal is to embed messages into images, you want to look into
        steganography. Corinna Johns has a series of articles on codeproject.com
        on
        the subject.
        -- Peter
        Site: http://www.eggheadcafe.com
        UnBlog: htp://petesbloggerama .blogspot.com
        Short Urls & more: http://ittyurl.net
        >
        >
        "Richard Coltrane" wrote:
        >
        >Hello,
        >>
        >If i take a jpeg and pipe it from a binary reader to a binary writer,
        >everything is fine and I can still use it.
        >If i take that same jpeg and piping code and simply add a byte encoded
        >string to the front of the file then I can no longer open it in an image
        >editor. This i would expect.
        >>
        >However if i open that image in notebook and remove the string I entered,
        >then i still cant open the file in an image editor, does anyone know why
        >this is?? Once ive removed the 4 character string with notepad the files
        >are
        >"seemingly" exactly the same?? They have precisely the same file size
        >(down
        >to the byte) and the bytes within the file are also exactly the same??
        >>
        >Whats different?
        >>
        >Thanks
        >>
        >>
        >>
        >>

        Comment

        Working...