Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Binary files can be rewritten, too.

To check that the first N transactions in a file weren’t tampered with, you have to either compare each transaction with a backup, or hash them and compare the result with the hash you got earlier.

If, as I suspect, this ledger is append-only, both are fairly simple. If the ledger, say, had 42 lines earlier, do either

    head -42 ledger | diff ledger.copy 
(I’m not sure that’s valid shell, but you get the idea) or

    head -42 ledger | my-super-hash
and compare the hash with one you got earlier.

Also, some OS-es (e.g. Mac OS. See https://developer.apple.com/library/archive/documentation/Sy...) have the notion of append-only files. These, too do not safeguard against somebody rewriting the entire ledger, but they can make it harder to do that tampering.

Finally, I haven’t thought it through, but possibly, you can create a user on your system for your accountant, set the owner of the ledger to that user, and make it impossible for anybody but that user to delete or replace the file.

If that’s possible, it even would protect against reinstalling the system. You could recreate your accountant’s user ID, but not with the same password, so your accountant would still notice.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: