spec
spec copied to clipboard
Shell we insert original_size of file into payload section of manifest.json?
like this:
"payload": {
"type": "reference",
"url": "0.payload",
"protocol": "zip",
"isEncrypted": true,
"mimeType": "application/pdf",
"tdf_spec_version:": "x.y.z",
"original_size": 1024000 // insert the original size of file before encryption to here.
}
Now, we can get the original file size from encryptionInformation->segments.
It's an array, but low efficiency.
When the file is very big(larger than 64GB), manifest.json will be very big.
"segments": [{
"encryptedSegmentSize": 131100,
"hash": "ZTc0OWUyZDA2NzM2YjkwNGY2YjBmMWU3NTI3YWQxOTI=",
"segmentSize": 131072
}, {
"encryptedSegmentSize": 131100,
"hash": "YjZhYWRkNzFiMDQyZDE2N2Y4ZmJhNTJkZWQzODQxZDI=",
"segmentSize": 131072
},
...
Imagine the use case. tdf file is on the server. We use FUSE to load and decrypt it. When user ls the file, we should show the right file size before encryption. It's low efficiency to get it from manifest.json, especially when the file is very big.
tdf is a good thing. It can be used in big data security.
Maybe tdf need some little update?