You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Webinterface] Sometimes downloads are scrambled #118
This doesn't always happen, but from time to time I've noticed downloads seem scrambled. This seems to be an issue only very recently and I haven't figured out yet whether it's a broker or webinterface issue.
Meant to post this here, but forgot. I think this is caused by the treasure chunk--webinterface is able to decrypt it for some reason, it doesn't come back "" or NULL like we'd thought it would. I'll add something into #109 that will fix this as well.
@automyr In order to fix this, I was planning on adding a chunk prefix to the file chunks that the webinterface could check for when it decrypts, much like the treasure prefix that I add to the treasure payloads on the brokernode that the webnode uses to figure out which chunks are treasure.
Are there any problems with this approach? Jet mentioned using the tag was also an option.
I think this approach is fine, just add something like "chunk:" or "filedata:" in bytes at the start of the plaintext before passing it through AES.
Beware the Birthday Paradox though, as if the bytestring that we're trying to match is too short, there's a possibility (and not as small as you'd think) that the starting bytes of a wrongly-decrypted ciphertext match our "tag".
That works. We don't need to go too crazy, something 32 bytes long is more than enough to never (never say never, but the probability does approach zero) have to worry about this, and we have more than enough space to accommodate this in one chunk.
Activity
Alisamix commentedon May 12, 2018
This was an issue in the first testnet already - not sure why this happens though.
rfornea commentedon May 15, 2018
Meant to post this here, but forgot. I think this is caused by the treasure chunk--webinterface is able to decrypt it for some reason, it doesn't come back "" or NULL like we'd thought it would. I'll add something into #109 that will fix this as well.
rfornea commentedon May 16, 2018
@automyr In order to fix this, I was planning on adding a chunk prefix to the file chunks that the webinterface could check for when it decrypts, much like the treasure prefix that I add to the treasure payloads on the brokernode that the webnode uses to figure out which chunks are treasure.
Are there any problems with this approach? Jet mentioned using the tag was also an option.
automyr commentedon May 16, 2018
I think this approach is fine, just add something like "chunk:" or "filedata:" in bytes at the start of the plaintext before passing it through AES.
Beware the Birthday Paradox though, as if the bytestring that we're trying to match is too short, there's a possibility (and not as small as you'd think) that the starting bytes of a wrongly-decrypted ciphertext match our "tag".
rfornea commentedon May 16, 2018
I guess a solution to reduce this possibility would be making the prefix as long as possible while still getting 1 kb of data in the chunks?
automyr commentedon May 16, 2018
That works. We don't need to go too crazy, something 32 bytes long is more than enough to never (never say never, but the probability does approach zero) have to worry about this, and we have more than enough space to accommodate this in one chunk.
nullpilot commentedon May 29, 2018
This should be fixed with the gcm-authed chunks.
rfornea commentedon May 29, 2018
This issue was actually fixed when I implemented the prefixes, but I marked the issue as "done" rather than closing it.