by tptacek · 9y ago · 0 comments
What could possibly go right?
You don't exactly need clairvoyance to predict this outcome.
If you don't trust that IPFS is providing you with the correct content, then you also can't trust that it's providing you with the correct code.
If you don't trust the IPFS node, it could just ship off your decryption key to a remote server. There is no getting around trusting IPFS to work correctly. And if you trust IPFS to work correctly then there is no benefit to authenticated encryption.
But you can run your own IPFS node locally. Then you're only trusting it as much as you trust your local system. If you don't trust your local system then you can't trust anything.
Also, while I have you, I recommend you use SJCL for generating random bytes in response to this: https://github.com/jes/hardbin/issues/1.[2]
On a meta note, can I ask why you didn't go with something like Tahoe-Lafs[3] if you were looking for a secure, decentralized file store system? I don't immediately know that it would have been better per se, but I'm not quite sure what IPFS provides that you can't get otherwise.
EDIT: I'm not trying to grief you here, but there are three people in this thread already (myself included) who know security very well (professionally so), and I want to point out comments like this one and the GitHub issue that was opened are good-faith attempts at that.
__________________________________________________________________
1. https://ipfs.io/ipfs/QmR7GSQM93Cx5eAg6a6yRzNde1FQv7uL6X1o4k7...
2. https://bitwiseshiftleft.github.io/sjcl/doc/symbols/sjcl.prn...
Hash functions can provide integrity against accidental errors or very simple manipulations related to XORing the message or digest. This might not be useful against an active attacker, but technically speaking it is a (weak) form of integrity, which is why we use checksums.
Message authentication codes (MACs) are required to assure integrity against active attackers because you need to elevate to authentication, and hash functions cannot provide authentication (at least not on their own). Authentication is a stronger notion in security than integrity because it simultaneously guarantees and requires integrity - there is no point in having integrity without authentication, because you'd be assuring data integrity without assuring the data origin, which short circuits the integrity problem for an attacker. Conversely, you can't have authentication without data integrity because an attacker could simply forge the data origin.