-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add option to mark paste as private #47
Comments
Some thoughts on these questions:
Remark: the logic to view a private paste should then probably be as follows:
This flow prevents private paste enumeration, which prevents people from finding collisions for the H(password+salt) (this would allow access to random private pastes), and also prevents people from checking if a certain text has been "TorPasted" in a private paste (by checking if that text's sha256 exists).
|
Another scheme that we can use for Paste IDs is I am thinking we should not store a password at all in the backend, only the ciphertext as well as a HMAC to make sure the decryption key is correct and the data have not been tampered with. The encryption key should be derived however from a PBKDF so the flow is like below: ####New Paste:
####Request Paste:
NOTE: The above is just an example, and much more thought should be given into how we will code this. The Finally, about the server being compromised, I realize that this problem cannot of course be solved by TorPaste. What I meant was that if at some point an attacker gets access to all the data in the backend ( |
Ok, this sounds good. Or at least, good enough for the scope of TorPaste :D |
Let's leave this issue open for now until we get more feedback and we also decide on the algorithms we will be using. This is just an initial design. |
Currently TorPaste can benefit from an option to mark pastes as Private. Now the meaning of Private can vary, although the most popular definition seems to be that the paste is password protected, so even if someone has the link, they still can't see the paste, unless they know the password.
Here are some issues we have to discuss before moving on with an implementation:
sha256(paste)
?sha256(paste + password_hash)
?For the second question I think we should store each paste password as a properly hashed password, just like a website would. This can of course be stored in the Paste Metadata.
For the third question, it's kind of tricky: we cannot use JavaScript, therefore if we decide to encrypt the pastes, it has to be done server side. Both encryption and decryption. This is the reason this feature has not been implemented and the
About
page recommends the use of PGP/GPG.For the fourth question, we need to make sure that if the pastes are indeed encrypted, the cryptographic keys never appear in server logs, etc. that an attack could gain access. Therefore the paste password should be sent with a
POST
request. In addition to that, we need to be able to decrypt the pastes only with the correct key, so the decryption key must not be stored anywhere and instead must be derived from the Paste Password, most likely using a PBKDF. If we're using encryption, then we most likely need a HMAC to verify the integrity of the encrypted data.Of course, since our solution is 100% server side, the administrator can modify the code to store the encryption keys, but we should assume that we trust the sysadmin but accept the fact that the server will be compromised at some point.
The text was updated successfully, but these errors were encountered: