Encrypt File Names on crypt google drive?

#1

I have 2 seperate crypt google drives on 2 seperate accounts. Both have the same data but the gcrypt: does not have filename encryption and the gcrypt2: has the filename encryption=standard. Is there any way to rename gcrypt: files in accordance with gcrypt2: files or something else to make gcrypt: also filename encrypted without having to redownload and upload everything(without using much bandwidth).
I have 5.5 TB data on each drive.

0 Likes

#2

I found something here but could not really understand the steps that @calisro gave : Is there any way to "rename" all files to the new Encryption "obfuscate"?

0 Likes

#3

I’ve never tried it. But what I was saying was essentially if all you need to do is rename, you just need a list of what they are now and list of what they need to be and use the move command.

0 Likes

#4

oh ok…ill try to figure it out…
do you know a way to get list of files with encrypted name and normal name side by side from a drive.
If so I can simply do that on my crypt remote which already has filename encryption and then use the move command to rename files on remote which does not have encryption

0 Likes

#5

Try this link
https://rclone.org/commands/rclone_lsjson/

0 Likes

#6

Was able to get List of files with normal name and encrypted name using this. But couldnt understand how to use move command to rename files.

0 Likes

#7
Rclone move remote1:some/file remote1:<encrypted>/<name>   

I’d make sure it works with a few files and are readable by the encrypted remote before you start writing a script though.

0 Likes

#8

what should be the format for the json file which I have extracted?
the file which has normal name and encrypted name

0 Likes

#9

I’m not sure what you mean. You’re just using this to feed into a script to parse it so you can generate the move commands. Depends on how you want to script it.

0 Likes

#10

oh all right. I will have to create a script myself. I thought rclone could do this automatically. I can try to make the script have basic programming knowledge. Lets see.

0 Likes

#11

rclone doesn’t currently do this itself. Looking at this, i’d like to see the encrypted path also added to the lsjson command. If that was there, this would be far easier to script. Currently you can only get the regular path which will make it more difficult to generate.

0 Likes

#12

Can do it folder by folder then if I am able to make the script. Still better than copying everything again.

0 Likes

#13

@ncw What do you think of adding the encypted path to the lsjson?

Created an issue for this.

0 Likes

#14

If the encrypted path can be added, it would just take a few lines of code to create a full move script I believe. Simply parse each json line and generate move commands.

0 Likes

#15

Doesn’t the --encrypted flag do this already? Or maybe I’ve mis-understood!

0 Likes

#16

Hi. No. This is the difference:

{“Path”:“Documents/Housedocs”,“Name”:“Housedocs”,“EncryptedPath”:“etcsuehl8qm43cdbu49v84i4so/q9pkp83ude9l7ahem29gs35tf8”,“Encrypted”:“q9pkp83ude9l7ahem29gs35tf8”,“Size”:-1,“MimeType”:“inode/directory”,“ModTime”:“2017-05-18T12:56:11.683Z”,“IsDir”:true},

Without the addition of the path, we only know the encrypted name and not where that actually exists in the encrypted tree.

The field ‘encrypted’ from the json output is simply the file or directory name:
item.Encrypted = cipher.EncryptDirName(path.Base(entry.Remote())

Of course, this would only be relevant if someone uses that switch though.

0 Likes

#17

I was testing this out and I first renamed 1 file. But I am unable to see the file if I mount the remote with standard file name encryption turned on. I can see the file with it turned off but then the file is encrypted. Any suggestions :confused:

0 Likes

#18

I don’t know for sure if the encryption is different of the actual file between the methods. I would have guess that as long as you’re using the same key it would have worked but I’ve never tried it. If you don’t see it and you’re only toggling the two then likely they are different.

0 Likes

#19

I figured it out. I was doing rename from crypt remote to crypt remote when I should have done it from basic drive remote to drive remote.
Only issue I am facing is if I mount a folder once(with filename encryption) but without renaming the files it shows me no files even after I rename the files, but changing the name of the folder itself does the trick.
Probably something to do with rclone keeping a copy of directory contents in cache or something.

0 Likes

#20

Oh, I see - thanks

0 Likes