2
I know from guides like this that it's pretty easy to add a RAR archive to the end of a JPG. What I'm wanting to know is whether it's only JPG files that can handle extra data at the end, and whether I can append any arbitrary binary blob to the end of a JPG. I don't care whether the file I append to the end will be recognized by its program, I only care that the JPG appears exactly the same to image viewers.
To give a bit more specific information about my use case, I'm trying to implement a backup mechanism in a webapp focused on mobile devices. I need this to work for iOS, so the only avenue available is to use data stashed in an image file. It is a bit clunky, but humor me in understanding that it makes sense in this use case. In the link above it is shown that RAR files appended to a JPG can still be opened, as I imagine that it's not required for RARs to be at an offset of zero within a given file, and that archive applications will look for the RAR's header. I want to implement something similar for an arbitrary binary blob, programmed in Javascript.