3 ms·
I disagree. It is far better to use a String like approach and use a structure that includes the length of the next written object. I believe that a simple sa
by mjevans 11y ago
I disagree. It is far better to use a String like approach and use a structure that includes the length of the next written object.
I believe that a simple sacrifice of a little more storage would also make that easier to split out. Pre-pad the message up to pad size zeros and then a pseudo-random number of additional pad objects (1 to n). Next you would store either the offset of the start or end, as well as the length of the payload (start would probably be easier to verify). With that structure it should be difficult to craft a payload message that looked like a valid message for the log.
- Someone 11y agoI don't quite understand what approach you are advocating, but for me "it should be difficult to craft a payload message that looked like a valid message for the log." is not good enough for a system service.
- mjevans 11y agoThis is a back of the napkin grade design; refine it and/or develop a proof for your specific use case. Can you see any way it would be obviously incorrect? I could not when I wrote it, but I did not take the much greater effort of /proving/ it was a correct design. (which much like crypto algorithms, should also be done on an implementation by implementation basis)