3 ms·
Cool project. Here is a feature suggestion: One additional feature you can add is a recovery key. You could use a time-limited master recovery key and encrypt
by vivegi 4y ago
Cool project. Here is a feature suggestion:
One additional feature you can add is a recovery key.
You could use a time-limited master recovery key and encrypt the file's data key and store it within the HTML file as an encrypted header.
It of course increases the attack surface because an attacker can then just focus on the recovery key.
But it would help in the scenarios where the passphrase for the datakey is forgotten and you need a way to recover. By supplying the master recovery passphrase, the file's data key/passphrase can be recovered and the content decrypted.
This is a usability versus security tradeoff.
- chrisshroba 4y agoWhat does “time limited” mean here?
- vivegi 4y agoTime-limited i.e., you rotate master key after a fixed time, say 1 month/1 year etc., depending on the use case. During that period the content can be recovered by using the masterkey to unwrap the data key and decipher the content. Beyond that period, if you don't remember the master key, you cannot decrypt the content. The time-period is only a shortcut. So, for personal use, as the OP intended, resetting the masterkey each year would still offer some protection against forgetting the passphrase for the data encryption.
- mprime1 4y agoTime is a finicky concept with computers. Could your time-based scheme be defeated by changing the system clock on the attacker computer?
- vivegi 4y agoAs I explained above, time is not used in the decryption at all. You use a timer to set expiry for the masterkeyphrase. For eg: If I want to encrypt all personal communication with my family, I could use a single master key phrase for the year 2022 (for all personal correspondence). The UI could prompt me when the new year arrives to reset the master keyphrase. There would still be the file level data encryption key phrase. In the following [] denotes a byte sequence and | denotes concatenation of two byte sequences and +/-> denotes a transformation. Encryption [correspondence] -> [masterkey encrypted datakey|datakey encrypted data] Normal Decryption [masterkey encrypted datakey|datakey encrypted data] + [datakey] -> [correspondence] Key recovery (datakey lost/forgotten) [masterkey encrypted datakey|datakey encrypted data] + [masterkey] -> [datakey] Once the datakey is recovered, the encrypted data can be read. We use keyrecovery as a backup. We don't need to worry about clock accuracy for this as the timeframe we are talking about is in the order of days or months. For added security you can use a different keyderivation/encryption method for the masterkey and even a different encryption method. For eg: You could use RSA to encrypt the datakey while you use AES for the data. I hope this clarifies.