Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell we insert original_size of file into payload section of manifest.json? #46

Open
woodlyer opened this issue Oct 18, 2024 · 0 comments

Comments

@woodlyer
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant