Decrypting messages addressed to a group of users using web browser storage
An end-to-end mechanism is disclosed herein for transporting encrypted messages over hypertext transport protocol (HTTP) sent to a group of recipients. In particular, the disclosed mechanism receives a message (e.g., as an input from a user) and encrypts that message using an encryption mechanism with a key unique to a particular user and to the message (e.g., different messages are encrypted using different keys). The encrypted message is then stored in a generated object along with other metadata needed for message processing. Once the object is generated, it is signed and encoded into a binary representation that is then sent to a server. The server system receives the binary representation and decodes it back into the object. The metadata of the object is then used to route the message to the correct recipient applications for decryption.
1 . One or more non-transitory computer-readable media with instructions stored thereon that when executed by one or more processors cause the one or more processors to:
receive, using an application executed within a web browser, an encrypted message object, wherein the encrypted message object comprises an encrypted message generated by a user within a group of users, and wherein the encrypted message is addressed to the group of users;
decode the encrypted message object into an encrypted message and message metadata;
retrieve, from web browser storage, a first key generation secret that was generated by a key generation algorithm for the user, wherein the key generation algorithm generates, using a key generation secret, a new key generation secret and a new decryption key for message decryption;
receive, from the key generation algorithm based on inputting the first key generation secret, a second key generation secret and a first decryption key;
decrypt the encrypted message using the first decryption key into a decrypted message;
store, within the web browser storage, the second key generation secret, wherein the second key generation secret is stored in association with the group of users; and
cause the decrypted message to be generated for display in the web browser.
2 . The one or more non-transitory computer-readable media of claim 1 , wherein the instructions for retrieving, from the web browser storage, the first key generation secret generated by the key generation algorithm further cause the one or more processors to:
access, within the web browser storage, a binary tree associated with the group of users; and
retrieve the first key generation secret from the binary tree with the web browser storage.
3 . The one or more non-transitory computer-readable media of claim 2 , wherein the instructions further cause the one or more processors to:
retrieve the binary tree from the web browser storage; and
decrypt the binary tree.
4 . The one or more non-transitory computer-readable media of claim 3 , wherein the instructions for storing, within the web browser storage, the new key generation secret further cause the one or more processors to:
locate, within the binary tree retrieved from the web browser storage, a leaf node associated with the user; and
replace the first key generation secret with the new key generation secret within the binary tree in the web browser storage.
5 . The one or more non-transitory computer-readable media of claim 1 , wherein the instructions for receiving, using the application executed within the web browser, the encrypted message object, further cause the one or more processors to receive a binary representation or a string representation of the encrypted message object.
6 . The one or more non-transitory computer-readable media of claim 1 , wherein the instructions further cause the one or more processors to decode the encrypted message object encoded in a binary representation or a string representation into the encrypted message and message metadata.
7 . The one or more non-transitory computer-readable media of claim 1 , wherein the instructions further cause the one or more processors to:
access, within the web browser storage, an encrypted binary tree that stores (1) a plurality of user identifiers of a plurality of users associated with the group of users and (2) a plurality of key generation secrets, wherein each key generation secret of the plurality of key generation secrets is a last generated key generation secret for a corresponding user;
decrypt the encrypted binary tree into a data structure representing a binary tree;
replace the first key generation secret within a leaf node associated with the user with the new key generation secret;
encrypt an updated binary tree; and
store the updated binary tree in the web browser storage.
8 . A method for decrypting messages, the method comprising:
receiving, using an application executed within a web browser, an encrypted message object, wherein the encrypted message object comprises an encrypted message generated by a user within a group of users, and wherein the encrypted message is addressed to the group of users;
decoding the encrypted message object into an encrypted message and message metadata;
retrieving, from web browser storage, a first key generation secret that was generated by a key generation algorithm for the user, wherein the key generation algorithm generates, using a key generation secret, a new key generation secret and a new decryption key for message decryption;
receiving, from the key generation algorithm based on inputting the first key generation secret, a second key generation secret and a first decryption key;
decrypting the encrypted message using the first decryption key into a decrypted message;
storing, within the web browser storage, the second key generation secret, wherein the second key generation secret is stored in association with the group of users; and
causing the decrypted message to be generated for display in the web browser.
9 . The method of claim 8 , wherein retrieving, from the web browser storage, the first key generation secret generated by the key generation algorithm further comprises:
accessing, within the web browser storage, a binary tree associated with the group of users; and
retrieving the first key generation secret from the binary tree with the web browser storage.
10 . The method of claim 9 , further comprising:
retrieving the binary tree from the web browser storage; and
decrypting the binary tree.
11 . The method of claim 10 , wherein storing, within the web browser storage, the new key generation secret further comprises:
locating, within the binary tree retrieved from the web browser storage, a leaf node associated with the user; and
replacing the first key generation secret with the new key generation secret within the binary tree in the web browser storage.
12 . The method of claim 8 , wherein receiving, using the application executed within the web browser, the encrypted message object, further comprises receiving a binary representation or a string representation of the encrypted message object.
13 . The method of claim 8 , further comprising decoding the encrypted message object encoded in a binary representation or a string representation into the encrypted message and message metadata.
14 . The method of claim 8 , further comprising:
accessing, within the web browser storage, an encrypted binary tree that stores ( 1 ) a plurality of user identifiers of a plurality of users associated with the group of users and ( 2 ) a plurality of key generation secrets, wherein each key generation secret of the plurality of key generation secrets is a last generated key generation secret for a corresponding user;
decrypting the encrypted binary tree into a data structure representing a binary tree;
replacing the first key generation secret within a leaf node associated with the user with the new key generation secret;
encrypting an updated binary tree; and
storing the updated binary tree in the web browser storage.
15 . A system comprising:
one or more processors; and
one or more non-transitory computer-readable media with instructions stored thereon that when executed by the one or more processors cause the one or more processors to:
receive, using an application executed within a web browser, an encrypted message object, wherein the encrypted message object comprises an encrypted message generated by a user within a group of users, and wherein the encrypted message is addressed to the group of users;
decode the encrypted message object into an encrypted message and message metadata;
retrieve, from web browser storage, a first key generation secret that was generated by a key generation algorithm for the user, wherein the key generation algorithm generates, using a key generation secret, a new key generation secret and a new decryption key for message decryption;
receive, from the key generation algorithm based on inputting the first key generation secret, a second key generation secret and a first decryption key;
decrypt the encrypted message using the first decryption key into a decrypted message;
store, within the web browser storage, the second key generation secret, wherein the second key generation secret is stored in association with the group of users; and
cause the decrypted message to be generated for display in the web browser.
16 . The system of claim 15 , wherein the instructions for retrieving, from the web browser storage, the first key generation secret generated by the key generation algorithm further cause the one or more processors to:
access, within the web browser storage, a binary tree associated with the group of users; and
retrieve the first key generation secret from the binary tree with the web browser storage.
17 . The system of claim 16 , wherein the instructions further cause the one or more processors to:
retrieve the binary tree from the web browser storage; and
decrypt the binary tree.
18 . The system of claim 17 , wherein the instructions for storing, within the web browser storage, the new key generation secret further cause the one or more processors to:
locate, within the binary tree retrieved from the web browser storage, a leaf node associated with the user; and
replace the first key generation secret with the new key generation secret within the binary tree in the web browser storage.
19 . The system of claim 15 , wherein the instructions for receiving, using the application executed within the web browser, the encrypted message object, further cause the one or more processors to receive a binary representation or a string representation of the encrypted message object.
20 . The system of claim 15 , wherein the instructions further cause the one or more processors to decode the encrypted message object encoded in a binary representation or a string representation into the encrypted message and message metadata.