Treat decryption failure as a read error?
I noticed while reading https://github.com/klauspost/reedsolomon:
The final (and important) part is to be able to reconstruct missing shards. For this to work, you need to know which parts of your data is missing. The encoder does not know which parts are invalid, so if data corruption is a likely scenario, you need to implement a hash check for each shard. If a byte has changed in your set, and you don't know which it is, there is no way to reconstruct the data set.
So I thought I'd give it a try and deliberately changed a bit in a test backup. Unfortunately, this resulted in the restore not working (removing the file entirely allowed the restore to succeed, as expected). It seems like the problem is that if the decrypt step fails, the entire restore is aborted. I guess ideally, the decryption failure ought to be treated the same as if the remote shard was missing. Maybe there's a way to fix my restore script?
uindex | backlog 8 {
backlog 4 multireader(
a=cp(/path/to/a)
b=cp(/path/to/b)
c=cp(/path/to/c)
) |
cmd gpg --args --to --decode |
uchecksum |
group 3 |
uparity 2 1 |
cmd unxz
} |
join -
(sorry I keep filing issues, I think the concept is pretty cool and I'm attempting to use scat
to backup my own files...)