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
crypt: adding metadata (including hashes) to crypt files #3667
Add a fixed size metadata block at the start of crypt files. This should store metadata (eg checksums, original file name, original modification date). (Maybe this block should be at the end as we will definitely have hashes by then when uploading?)
Crypt (v0) currently has a small 32 byte header
8 bytes magic string RCLONE\x00\x00
24 bytes Nonce (IV)
I'd propose increasing this for crypt (v1) to 1k, 2k or 4k (not decided which)
8 bytes magic string RCLONE\x00\x01
24 bytes Nonce (IV)
24 bytes Nonce (IV) for the metadata just in case we ever want to overwrite it
1024 -24 -24 - 8 bytes of secretbox encrypted data (or maybe 2048 or 4096)
Storing the hashes for the crypted data would solve the "crypt has no checksums" problem. Storing other metadata is useful for upcoming metadata storage features.
A fixed size block makes it very easy to seek in crypt files, and allows calculation of the length of the file without having to read it which is a significant advantage
This is backwards incompatible with crypt v0 files. It might be possible to design the remote so it could read both v0 and v1 files.
If file name encryption is in use then we could potentially have a different suffix other than .bin for v1 files.
Otherwise the listings may get the wrong sizes for a mixture of v0 and v1 files. This can probably be worked around to make syncs work correctly but rclone mount will almost certainly have problems.
An idea from the forum could also keep this data in a sidecar file for backwards compatibility and have a process which downloads the data to create the hash and the sidecar file.
Reacted by thestigma, Guilherme, 1024mb, Ming, OEOT, ad34574, kapitainsky, Edouard Hur, Diana, Florian Kaiser and 1 more
I encourage other readers to give their input on how essential you would consider seamless back-compatibility to be. It may be possible, but it is at least going to be tricky and/or may have limitations or require compromises (details not quite known at this point).
Without seamless back-compatibility you'd need keep new and old formats in separate locations and using a separate remote (either a new type of crypt remote, or with an option in the remote config). over time you can of course migrate over completely to gain the full benefits of the new improvements.
In my personal opinion this would at worst an organizational inconvenience and not such a big deal, but please share your own thoughts so we can get a feel for how much time and effort it is worth putting into this aspect.
8 bytes magic string RCLONE\x00\x01
24 bytes Nonce (IV)
4 byte metadata SIZE
24 bytes Nonce (IV) for the metadata just in case we ever want to overwrite it
SIZE bytes of secretbox encrypted data
8 bytes magic string RCLONE\x00\x01
24 bytes Nonce (IV)
4 byte metadata SIZE
24 bytes Nonce (IV) for the metadata just in case we ever want to overwrite it
SIZE bytes of secretbox encrypted data
Where encrypted data can be a json file..
That would work perfectly well, however that means rclone would have to read the metadata for all directory listings to work out the size of the underlying file. I'm trying to avoid this by having fixed size metadata.
It wouldn't be the end of the world but it would, for example, mean that just looking at a directory in rclone mount would end up reading a chunk of every file in the directory which would be quite slow.
Reacted by Ivan Andreev, Luigi 'Comio' Mantellini, Pratham Singh and Guilherme
I think a newer version of rclone should always be able to seamlessly read an older encrypted file. It may not have all of the metadata, but it should read it without argument. I think a "nice-to-have" would be if an older rclone version could read a newer file, but that may be harder
What about writing a separate metadata file with the same name plus some extension? Then you can have variable sized metadata files and can support backends that do not accept a range of data (are there any?). You do not want to download a large encrypted file just to get the first few bytes
@Jwink3101 this is a sensible suggestion. A separate metadata file with the existing file format is backwards compatible and means we don't have to read files to do a directory listing.
It is a bit more complex to manage, and we'd need some way of telling data and metadata files apart. For name encryption this could be a different extension other than .bin. Not sure how this would work otherwise.
I note also that the chunker backend can do this now if the only metadata you are interested in is a sha1 or md5 hash.
cync also has an operational mode in which directories are encrypted files too. The file representing the directory contains a list of the files belonging to the directory. All actual files are stored in a git-like folders structure by generating a simple UUID for each file. The UUID is split into folder and file name. The first two or four hex digits of the UUID are used as directory, the rest as a file name. In other words, all visible filenames and directories are in two level directory structure. Because of the randomness, the file tree is very balanced.
I am wondering, is it possible to implement this approach on top of crypt? If that's of interest, I have an older version of cync, which is in Go, trying to port it might not be too hard.
What about extended file attributes? Most remotes support them. They also handle those calls more effectively than file data (usually cached / indexed and not charged against file reads the same way).
I would make sure to encrypt both the key and value using the remote key / pair to maintain a high level of security.
Could also also use xattrs locally to sync meta (vfs).
Each choice you have (header in file, separate file, extended attribute) will ultimately not work with some remotes. Might as well use the solution that was meant for this kind of thing (extended attributes), and as more remotes catch up to what I would consider as a "modern standard" rclone can implement its "optimal" solution against them.
I don't have the data on which remotes do / don't support xattrs, but I have to imagine the the bulk of users are using remotes that do.
tldr: i brought the idea for writing the hash inside a additional file and ncw brought the idea for embedding hash into the head/foot of the file
One of the fundamental challenges I see with separate files is that they are at the lowest layers "separate" and are treated as such by the underlying providers. Atomicity is an important factor in data. Most providers are setup to handle a atomicity at a single file level (including meta for the file). The file moves, gets backed up, written, read, etc. -- bringing with it its "whole self" so to say (including meta). Creating a secondary file is fraught with consistency challenges -- especially if we start looking at storing critical data at some point.
If the choice isn't for extended attributes I would definitely say a fixed header on a file is the way to go.
the idea was providing a hash file for data who are already uploaded (download data, create hash file, upload the hash file, throw away the temp download) and do a hash head for new uploaded data. Correct @ncw?
the problem is, how will you provide a hash head for already uploaded data... in my case i have uploaded my backup (5TB) a week ago and i needed 4 weeks 24/7 full upload....
for that the next idea from me was that we would need one or two more commands:
download data create hash file and upload hash file
download data create hash and upload data with hash head.
so you can give people with bad internet access (and big backup) the possibility to decide if they want to add the header or just an additional file.
I had started writing something entirely different but after re-reading the thread, I felt it would better clarifying some questions before commenting further:
Does the proposed new header (2K/4K) have space reserved for future use, or will it be used/filled-up in its entirety from the get-go?
It will have space for future use.
Do the sidecar suggestions have to do with migrating v0 encrypted files to v1, or is the suggestion to have sidecar files permanently to store the v1 information?
My preference would be not to have sidecar files and use them only for migration.
I can see the clear logic in having one sidecar per file (for whatever use, whether it'd be migration or permanently). I don't, however, see the logic in having one sidecar per folder. I think it makes far too many assumptions regarding the architecture of the underlying remote (what is a folder anyway?) and the use case. It would have to be one sidecar per file, or one sidecar for the entire remote as I see it, to be as elegant and simple as possible, unless I have misunderstood something.
One file with per directory enters us into a world of pain with locking concurrent accesses and increases the risk factor when things go wrong so it isn't my favourite idea, but maybe could be made to work with a log structured directory of modifications or something like that.
I'm wondering for storing hashes in the metadata: As far as I know, this would be the first remote where rclone actually calculates and stores the hashes. Which hashes would we store? The ones of the source remote? Or do we read through the files and calculate all hashes (that are currently implemented in rclone)? Also, do we leave extra space in the metadata for future hash types?
I think storing just the ones from the source remote is bad since then we get a different crypt file depending on which remote we copy from. So we'd have to read through each file and hash it with all algorithms, and then read through the file again when copying? Or do we make this configurable with a flag such as "--crypt-force-rehash" to enforce storing all hashes, and by default just storing the ones from the source remote?
I like the idea of having a 1:1 mapping of original files to encrypted files more since this makes atomicity and concurrency of transactions simpler. However, if we were to add hash types in the future, then it is simpler to add these to metadata sidecars (by replacing the sidecars) instead of replacing all the files and their headers. So how would we deal with adding more hashes in the future when using file headers?
Also, if we don't always store all hash types, this would mean that the hash type availability doesn't depend on the backend type anymore, but it would be a per-file property.
I'm wondering for storing hashes in the metadata: As far as I know, this would be the first remote where rclone actually calculates and stores the hashes.
Actually we do this in S3 for example, we store the hash of chunked files as metadata.
Which hashes would we store? The ones of the source remote?
The ones on the source remote are the only sensible option. However if the source remote is local it could be anything... Pragmatically you might say we are going to store the MD5SUM and/or the SHA1SUM which could cover nearly all source remotes.
Or do we read through the files and calculate all hashes (that are currently implemented in rclone)?
That is what will happen with the local backend unless we do something different!
Also, do we leave extra space in the metadata for future hash types?
It needs to be extensible, yes
I think storing just the ones from the source remote is bad since then we get a different crypt file depending on which remote we copy from. So we'd have to read through each file and hash it with all algorithms, and then read through the file again when copying? Or do we make this configurable with a flag such as "--crypt-force-rehash" to enforce storing all hashes, and by default just storing the ones from the source remote?
Rclone in general uses hashes from the source and if the source hasn't got the right hash, uses nothing. Reading the file twice (or making a copy on disk) isn't very desirable, though we do do it in Jottacloud which requires the MD5SUM before uploading the data.
I like the idea of having a 1:1 mapping of original files to encrypted files more since this makes atomicity and concurrency of transactions simpler.
Aye.
However, if we were to add hash types in the future, then it is simpler to add these to metadata sidecars (by replacing the sidecars) instead of replacing all the files and their headers.
Replacing a block of a file is impossible on just about all remotes without re-uploading it...
So how would we deal with adding more hashes in the future when using file headers?
We would add them to new files only.
Also, if we don't always store all hash types, this would mean that the hash type availability doesn't depend on the backend type anymore, but it would be a per-file property.
This is also the case at the moment. The remote might support MD5 and SHA1 but any file is at liberty not to have those hashes and return an empty string.
After thinking about this a bit, here's my thoughts:
Being able to quickly and easily get the hash while listing (ie. lsjosn) is essential for my purposes. I think the best way to do this for any backends that support it would be through any metadata system the service provides. For example, Google Drive has custom file properties which as I understand can be read while listing files. I would guess many others backends provide similar functionality.
One major advantage to doing it this way is that it would be backwards compatible, although the hashes obviously wouldn't be available for existing files.
Some other thoughts:
The hash value should definitely be encrypted in the metadata. I think the hash value stored in the meta data should also be ignored if the file size changes or if the hash sum from the underlying backend changes (where available), as this would mean the file was modified outside rclone and the hash is no longer valid. If those values are also stored in the encrypted metadata, rclone could easily check the value and ignore the hash if they don't match.
When crypted files are copied outside of the crypt remote, rclone should probably preserve any such attributes it adds, such that if you copy RemoteA to RemoteB, RemoteAencrypted and RemoteBencrypted will both have the same meta data preserved. This might only be possible with the same remote. Actually, I think crypt-server-side-across-configs makes this unnecessary.
I did some research, and it looks like the majority of cloud backends do have some kind of custom properties/metadata that can be attached to files (and in some cases even directories). Some of them can even include them while listing the files, which would be very useful for being able to list hashes while listing the files.
Is the thinking to reserve a specific property of the metadata for rclone? Even by reserving just a single property, rclone should be able to store a few properties/details by utilizing JSON. For instance, rclone can store the information whether the file is preceded by a header in one of these properties. This way all content related information, like encryption/compression algorithm chain, the nonces, etc, can go in the header.
Yes we could store hashes in the metadata, but we'd probably want to encrypt them otherwise that is a definite info leak.
Agreed, crypt should have encrypted metadata.
One suggestion for when storing hashes in crypt, would be to also store the hash of the underlying backend (ie. md5 with Google Drive) in the hash. Something vaguely like:
To add metadata, I am experimenting with the local backend. There are a couple of questions, which I am not sure how to address best:
To store the data, is an extended attribute, like user.rclone a good choice? The value should be binary?
Any thoughts how the backend should expose this metadata? Is a new method in the global ObjectInfo a reasonable choice? Something like the Metadata function below:
// ObjectInfo provides read only information about an object.
type ObjectInfo interface {
DirEntry
// Fs returns read only access to the Fs that this object is part of
Fs() Info
// Hash returns the selected checksum of the file
// If no checksum is available it returns ""
Hash(ctx context.Context, ty hash.Type) (string, error)
// Storable says whether this object can be stored
Storable() bool
// Additional metadata
Metadata() []byte
}
To add metadata, I am experimenting with the local backend. There are a couple of questions, which I am not sure how to address best:
To store the data, is an extended attribute, like user.rclone a good choice? The value should be binary?
I would expect the metadata to be stored under user.rclone.* with each metadata item with its own key
Any thoughts how the backend should expose this metadata? Is a new method in the global ObjectInfo a reasonable choice? Something like the Metadata function below:
// ObjectInfo provides read only information about an object.
type ObjectInfo interface {
DirEntry
// Fs returns read only access to the Fs that this object is part of
Fs() Info
// Hash returns the selected checksum of the file
// If no checksum is available it returns ""
Hash(ctx context.Context, ty hash.Type) (string, error)
// Storable says whether this object can be stored
Storable() bool
// Additional metadata
Metadata() []byte
}
I'd expect this
Metadata() map[string]string
Note that this needs to be an optional method...
We'd also need a corresponding set metadata option
This is an interesting discussion and I’m wondering if there are any newer insights or design directions on this topic.
I’m working on a new virtual remote called raid3 that also transforms data, so hashes and other properties from the underlying storage backends cannot be used directly, or cannot be used at all. This creates a similar requirement for a backend‑agnostic metadata mechanism.
For object size, crypt’s fixed‑size header makes it easy to derive the plaintext size from the encrypted object size. For a RAID3‑style virtual remote the logical size can likewise be derived from the tuple of underlying remotes.
For hashes, a raid3 remote could append a fixed‑size footer containing the hash value. When the hash is needed, rclone cat --tail N on the composite object would read that footer from the underlying storage providers (at least two reads, because RAID3 requires at least two working remotes).
I’m trying to decide whether to implement a raid3‑specific footer format, or whether there is any emerging consensus about a common mechanism for virtual/transforming remotes to store extra metadata (e.g. something that crypt, chunker, RAID‑like remotes could eventually share).
In the context of crypt, the RAID3 approach might also be interesting as a building block: the hash could be stored in a way where a single storage provider cannot use it for brute‑force attacks, i.e. the hash is effectively protected.
Activity
thestigma commentedon Oct 26, 2019
I encourage other readers to give their input on how essential you would consider seamless back-compatibility to be. It may be possible, but it is at least going to be tricky and/or may have limitations or require compromises (details not quite known at this point).
Without seamless back-compatibility you'd need keep new and old formats in separate locations and using a separate remote (either a new type of crypt remote, or with an option in the remote config). over time you can of course migrate over completely to gain the full benefits of the new improvements.
In my personal opinion this would at worst an organizational inconvenience and not such a big deal, but please share your own thoughts so we can get a feel for how much time and effort it is worth putting into this aspect.
comio commentedon Oct 26, 2019
Why don't add something like:
Where encrypted data can be a json file..
ncw commentedon Oct 26, 2019
That would work perfectly well, however that means rclone would have to read the metadata for all directory listings to work out the size of the underlying file. I'm trying to avoid this by having fixed size metadata.
It wouldn't be the end of the world but it would, for example, mean that just looking at a directory in
rclone mountwould end up reading a chunk of every file in the directory which would be quite slow.Jwink3101 commentedon Nov 15, 2019
I think a newer version of rclone should always be able to seamlessly read an older encrypted file. It may not have all of the metadata, but it should read it without argument. I think a "nice-to-have" would be if an older rclone version could read a newer file, but that may be harder
What about writing a separate metadata file with the same name plus some extension? Then you can have variable sized metadata files and can support backends that do not accept a range of data (are there any?). You do not want to download a large encrypted file just to get the first few bytes
ncw commentedon Nov 16, 2019
@Jwink3101 this is a sensible suggestion. A separate metadata file with the existing file format is backwards compatible and means we don't have to read files to do a directory listing.
It is a bit more complex to manage, and we'd need some way of telling data and metadata files apart. For name encryption this could be a different extension other than
.bin. Not sure how this would work otherwise.I note also that the
chunkerbackend can do this now if the only metadata you are interested in is a sha1 or md5 hash.comio commentedon Nov 16, 2019
Just an idea: Can you add a key index in order to use many encryption keys inside rclone.conf?
ivannp commentedon Dec 21, 2019
For the cync utility, a simple protobuf header is added to every file. The format is:
cync also has an operational mode in which directories are encrypted files too. The file representing the directory contains a list of the files belonging to the directory. All actual files are stored in a git-like folders structure by generating a simple UUID for each file. The UUID is split into folder and file name. The first two or four hex digits of the UUID are used as directory, the rest as a file name. In other words, all visible filenames and directories are in two level directory structure. Because of the randomness, the file tree is very balanced.
I am wondering, is it possible to implement this approach on top of crypt? If that's of interest, I have an older version of cync, which is in Go, trying to port it might not be too hard.
tcf909 commentedon Jun 17, 2020
What about extended file attributes? Most remotes support them. They also handle those calls more effectively than file data (usually cached / indexed and not charged against file reads the same way).
I would make sure to encrypt both the key and value using the remote key / pair to maintain a high level of security.
Could also also use xattrs locally to sync meta (vfs).
Each choice you have (header in file, separate file, extended attribute) will ultimately not work with some remotes. Might as well use the solution that was meant for this kind of thing (extended attributes), and as more remotes catch up to what I would consider as a "modern standard" rclone can implement its "optimal" solution against them.
I don't have the data on which remotes do / don't support xattrs, but I have to imagine the the bulk of users are using remotes that do.
</2 cents>
Xyz00777 commentedon Jun 20, 2020
For your information, ncw and I had a conversation in the forum:
https://forum.rclone.org/t/crypt-hash-possible/17101/16
eventually somebody have additional ideas or anything
tldr: i brought the idea for writing the hash inside a additional file and ncw brought the idea for embedding hash into the head/foot of the file
tcf909 commentedon Jun 21, 2020
One of the fundamental challenges I see with separate files is that they are at the lowest layers "separate" and are treated as such by the underlying providers. Atomicity is an important factor in data. Most providers are setup to handle a atomicity at a single file level (including meta for the file). The file moves, gets backed up, written, read, etc. -- bringing with it its "whole self" so to say (including meta). Creating a secondary file is fraught with consistency challenges -- especially if we start looking at storing critical data at some point.
If the choice isn't for extended attributes I would definitely say a fixed header on a file is the way to go.
Xyz00777 commentedon Jun 21, 2020
the idea was providing a hash file for data who are already uploaded (download data, create hash file, upload the hash file, throw away the temp download) and do a hash head for new uploaded data. Correct @ncw?
the problem is, how will you provide a hash head for already uploaded data... in my case i have uploaded my backup (5TB) a week ago and i needed 4 weeks 24/7 full upload....
for that the next idea from me was that we would need one or two more commands:
so you can give people with bad internet access (and big backup) the possibility to decide if they want to add the header or just an additional file.
11 remaining items
ncw commentedon Aug 20, 2020
It will have space for future use.
My preference would be not to have sidecar files and use them only for migration.
One file with per directory enters us into a world of pain with locking concurrent accesses and increases the risk factor when things go wrong so it isn't my favourite idea, but maybe could be made to work with a log structured directory of modifications or something like that.
quexten commentedon Nov 7, 2020
I'm wondering for storing hashes in the metadata: As far as I know, this would be the first remote where rclone actually calculates and stores the hashes. Which hashes would we store? The ones of the source remote? Or do we read through the files and calculate all hashes (that are currently implemented in rclone)? Also, do we leave extra space in the metadata for future hash types?
I think storing just the ones from the source remote is bad since then we get a different crypt file depending on which remote we copy from. So we'd have to read through each file and hash it with all algorithms, and then read through the file again when copying? Or do we make this configurable with a flag such as "--crypt-force-rehash" to enforce storing all hashes, and by default just storing the ones from the source remote?
I like the idea of having a 1:1 mapping of original files to encrypted files more since this makes atomicity and concurrency of transactions simpler. However, if we were to add hash types in the future, then it is simpler to add these to metadata sidecars (by replacing the sidecars) instead of replacing all the files and their headers. So how would we deal with adding more hashes in the future when using file headers?
Also, if we don't always store all hash types, this would mean that the hash type availability doesn't depend on the backend type anymore, but it would be a per-file property.
ncw commentedon Nov 9, 2020
Actually we do this in S3 for example, we store the hash of chunked files as metadata.
The ones on the source remote are the only sensible option. However if the source remote is local it could be anything... Pragmatically you might say we are going to store the MD5SUM and/or the SHA1SUM which could cover nearly all source remotes.
That is what will happen with the local backend unless we do something different!
It needs to be extensible, yes
Rclone in general uses hashes from the source and if the source hasn't got the right hash, uses nothing. Reading the file twice (or making a copy on disk) isn't very desirable, though we do do it in Jottacloud which requires the MD5SUM before uploading the data.
Aye.
Replacing a block of a file is impossible on just about all remotes without re-uploading it...
We would add them to new files only.
This is also the case at the moment. The remote might support MD5 and SHA1 but any file is at liberty not to have those hashes and return an empty string.
JrMasterModelBuilder commentedon Jun 11, 2021
After thinking about this a bit, here's my thoughts:
Being able to quickly and easily get the hash while listing (ie.
lsjosn) is essential for my purposes. I think the best way to do this for any backends that support it would be through any metadata system the service provides. For example, Google Drive has custom file properties which as I understand can be read while listing files. I would guess many others backends provide similar functionality.One major advantage to doing it this way is that it would be backwards compatible, although the hashes obviously wouldn't be available for existing files.
Some other thoughts:
The hash value should definitely be encrypted in the metadata. I think the hash value stored in the meta data should also be ignored if the file size changes or if the hash sum from the underlying backend changes (where available), as this would mean the file was modified outside rclone and the hash is no longer valid. If those values are also stored in the encrypted metadata, rclone could easily check the value and ignore the hash if they don't match.
When crypted files are copied outside of the crypt remote, rclone should probably preserve any such attributes it adds, such that if you copy RemoteA to RemoteB, RemoteAencrypted and RemoteBencrypted will both have the same meta data preserved. This might only be possible with the same remote.Actually, I thinkcrypt-server-side-across-configsmakes this unnecessary.JrMasterModelBuilder commentedon Jun 11, 2021
I did some research, and it looks like the majority of cloud backends do have some kind of custom properties/metadata that can be attached to files (and in some cases even directories). Some of them can even include them while listing the files, which would be very useful for being able to list hashes while listing the files.
1fichier:
Amazon Drive:
Amazon S3:
Backblaze B2:
Box:
Citrix ShareFile:
Dropbox:
Enterprise File Fabric:
Google Cloud Storage:
Google Drive:
HDFS:
Hubic, Swift:
Jottacloud:
Koofr:
Mail.ru Cloud:
Mega:
Microsoft Azure Blob Storage:
Microsoft OneDrive:
OpenDrive:
QingStor:
pCloud:
premiumize.me:
put.io:
Seafile:
SugarSync:
Tardigrade:
WebDAV:
Yandex Disk:
Zoho Workdrive:
ivannp commentedon Jul 19, 2021
Is the thinking to reserve a specific property of the metadata for rclone? Even by reserving just a single property, rclone should be able to store a few properties/details by utilizing JSON. For instance, rclone can store the information whether the file is preceded by a header in one of these properties. This way all content related information, like encryption/compression algorithm chain, the nonces, etc, can go in the header.
ncw commentedon Jul 27, 2021
@JrMasterModelBuilder nice table - thanks :-)
I have an idea for making a proper metadata system for rclone and that will be very useful.
Yes we could store hashes in the metadata, but we'd probably want to encrypt them otherwise that is a definite info leak.
JrMasterModelBuilder commentedon Aug 7, 2021
Agreed, crypt should have encrypted metadata.
One suggestion for when storing hashes in crypt, would be to also store the hash of the underlying backend (ie. md5 with Google Drive) in the hash. Something vaguely like:
Ek( base64(sha1(file)) + '|' + base64(md5(cryptk(file))) )Then rclone could check if the underlying backend reports a matching hash and only use/output the hash from the encrypted metadata if it matches.
ivannp commentedon Aug 8, 2021
To add metadata, I am experimenting with the local backend. There are a couple of questions, which I am not sure how to address best:
To store the data, is an extended attribute, like user.rclone a good choice? The value should be binary?
Any thoughts how the backend should expose this metadata? Is a new method in the global ObjectInfo a reasonable choice? Something like the Metadata function below:
ncw commentedon Aug 14, 2021
@ivanp wrote:
I would expect the metadata to be stored under
user.rclone.*with each metadata item with its own keyI'd expect this
Note that this needs to be an optional method...
We'd also need a corresponding set metadata option
tuzzmaniandevil commentedon Apr 11, 2023
Hey @ncw , Has there been any progress on this idea?
dslijepcevic commentedon Jun 2, 2023
This idea does indeed sound great, @ncw is there any active development maybe going on in the background since the last post from 2 years ago?
disconnect5852 commentedon Jan 8, 2024
@ncw Will be this implemented in the foreseeable future, or we should search for workarounds, like hasher overlay?
Breschling commentedon Feb 2, 2026
This is an interesting discussion and I’m wondering if there are any newer insights or design directions on this topic.
I’m working on a new virtual remote called raid3 that also transforms data, so hashes and other properties from the underlying storage backends cannot be used directly, or cannot be used at all. This creates a similar requirement for a backend‑agnostic metadata mechanism.
For object size, crypt’s fixed‑size header makes it easy to derive the plaintext size from the encrypted object size. For a RAID3‑style virtual remote the logical size can likewise be derived from the tuple of underlying remotes.
For hashes, a raid3 remote could append a fixed‑size footer containing the hash value. When the hash is needed,
rclone cat --tail Non the composite object would read that footer from the underlying storage providers (at least two reads, because RAID3 requires at least two working remotes).I’m trying to decide whether to implement a raid3‑specific footer format, or whether there is any emerging consensus about a common mechanism for virtual/transforming remotes to store extra metadata (e.g. something that crypt, chunker, RAID‑like remotes could eventually share).
In the context of crypt, the RAID3 approach might also be interesting as a building block: the hash could be stored in a way where a single storage provider cannot use it for brute‑force attacks, i.e. the hash is effectively protected.