This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
EveryOS's profile picture

Question about multi-user file encryption

Started by EveryOS, 29 January 2018 - 07:17 PM
EveryOS #1
Posted 29 January 2018 - 08:17 PM
I don't like posting in this forum, but when I tried to look up my answer long walls of text with non-simple English answers came up.

Lets say I have a single file and I want to encrypt it. Simple enough.
Now I want to give another user the ability to edit the file. I have them enter their desired password, and encrypt it with both keys. A bit less simple, but still doable.

Now let's say the second user wants to edit the file when I am not around.
I still want access to the program, but the encryption system cannot take my password into account as I'm not around to enter it.
And I'm certainly not going to put a loophole into my program that allows it to decrypt my password.

So I guess that my real question is how can I make a file able to be modified and then re-encrypted in such a way that a set key will be able to decrypt it if it does not know that key?
To me this sounds impossible but somebody must know someway around this?
Edited on 29 January 2018 - 07:19 PM
Lupus590 #2
Posted 29 January 2018 - 09:44 PM
I would encrypt the file with a key, this key only works for this file. Every user which can edit this file then has a copy of this key which they encrypt themselves.

When they want to edit a file, they type in their password which gives them that files key which then decrypts the file and opens it for editing.
EveryOS #3
Posted 30 January 2018 - 12:24 AM
Sounds very sensible. THX. But I do still have one question:
So is their copy of the file encryption key also encrypted with their password?
Edited on 30 January 2018 - 12:09 AM
Lupus590 #4
Posted 30 January 2018 - 10:16 AM
Only their copy is encrypted with their password (everyone else having their own). The file itself is only encrypted with the shared key.

I have realised that to allow another user write access both users need to be online, you can fix this with public key encryption. The file key is encrypted with the public key, allowing anyone with edit access to the file to give edit access to others even through they don't know the other persons password.