[question] Self-repairing files?

Is there such a thing as a self-repairing file? That is, a file format that retains it's original structure and exact data contents even if edited, say, with a hex editor? Is such a thing possible without OS intervention or some sort of external checksum?

#238722

i think most anti-virus software does this, so yes, it's possible. how do they do it? **** if i know!

#238737

If it is an executable, code that alters itself is mostly detected as a virus.

Files can not alter themselves unless they contain small amounts of code and get the operating system to treat themselves as executables, again a perfect definition for an 'infected' file. Self healing or inoculation capabilities would need to use the same mechanisms as trojans do, and hence could be easily spotted by non-sophisticated antiviral software.

However, one can make a file to retain its data by increasing its redundance: editing odd bits and bytes would not change the carried information, as in holography. This would require an external app to read the redundant data and restore the scrambled content and write it back.

Let me hazard a guess: You altered a file with an hex editor and swoop it resetted to its original state? There's something like Windows file protection getting in the way.

#238764

Thanks for the replies.

@herd - Actually, no. I'm dealing with some legal issues regarding medical information files. Part of the regulations require the data to be "immutable." So, I was just tossing around some ideas about how to make sure that a final copy of data can be verified as the absolute final and be completely unalterable once it has been transmitted over a network.

@Both of you - Interesting that you should mention viri. I hadn't considered what Windows would do with such a beast. This will require a hell of a lot of R&D.

#238975

I'm dealing with some legal issues regarding medical information files. Part of the regulations require the data to be "immutable." So, I was just tossing around some ideas about how to make sure that a final copy of data can be verified as the absolute final and be completely unalterable once it has been transmitted over a network.

Consider employing stock solutions for this: Transferring the data as encrypted XML and base64 encoding binary content does not harm that much. IMO, "immutable" means that the data does not protect itself, but is resistant to tampering, e.g. with embedded check sums so that applications that deal with it easily can discover if it has been tampered with. Again, signing the data with the private key of the issuer and decoding the signature with the commonly known public key is the temporary state of the art. Although I am not very fond of .Net, it provides stock solutions for XML signing. Other libraries exist in the domain of OpenSSL implementations. The market also provides a wide range of key-generating and signing hardware like USB-tokens or web content scrambling servers. It really depends on what scale you want to push these files around.

#239048

Ahh, I see. The scale is immediately national, but potentially global - if I catch your meaning. We're also considering biometric signing in addition to other "stock" secure solutions. And you're correct about the definition of immutable - I just wanted to see how far it could be pushed with current technology without becoming a barrier to rapid information exchange.

#239083

Also, you may want to investigate XML Digital Signatures. In short, it allows a content provider to digitally sign an XML document to verify that they are the original source. If you want some examples (either of implementation in .Net, or of final output), lemme know.

@herd: if XMLDSIG is what you were referring to, sorry to step on your toes :)

Forgot to mention - these signatures can be pretty much any form of signature you care to name, so could be based on your biometric data, if you so desire...

#247033

You need a program that checks the file integrity... if the file isn't ok the program will rewrite it.

#254255

Maybe he's talking about smth like Reedman-Solomon codes

#254332