I have a scenario where semi-sensitive [1] data for a corporate web application is to be stored in the browser's localized storage (Indexed DB to be specific, via JavaScript).
The intention is to encrypt the data (AES 256) at the server level with a "master" key/passphrase, but then send a 'time-bombed' generated key that would enable decrypting the data... but only for a certain amount of time - e.g. 2-4 hours.
I've been led to believe that this is possible - however I haven't found any documentation indicating how to generate temporary keys.
If this concept is possible a link to, or indication of what the API/method call would be named would be helpful. If this is possible, but only in other encryption schemes (e.g. SHA-512?) I'd be grateful for a nudge in the right direction.
[1] - No credit cards, financial or other scary stuff. Just things that the user might not want a casual person walking by to be able to read. Yes I'm fully aware that "security" and "JavaScript" should likely not be uttered in the same sentence but this is all HTML5 offers.
k
and ciphertextc
gives the same result as calling it in six weeks with keyk
and ciphertextc
). AES is also symmetric; you can only decrypt with the key it was encrypted with. You're looking for a higher-level system than AES.D(k,c)
now, I can run it whenever, assuming I havek
andc
. The only way to have a key expire is to force someone to forget the key, forget the ciphertext, or make decryption impossible without talking to a server under your control (but once they decrypt it once, they can keep that data and decrypt it again later).