Okay here are my requirements.

I need a solution that can do the following.

Lets say I have an encrypted piece of text with the value "20".

and I have UserA and UserB

I give UserA the Keys (/5 and /2), meaning divide by 5 and divide by 2. I give UserB the Key (/10 and /1) meaning divide by 10 and divide by 1.

using both operations, both UserA and UserB can arrive at the same result the un-encrypted text of "2".

The first operation could be their "SessionID, the second could be a corresponding key for the Session". Two different users, using two different "Keys" can decrypt the ciphertext using two different but equal operations.

Is there something similar in cryptography where you can provide different keys or functions and arrive at the same result and is cryptographically secure.

  • $\begingroup$ Use TLS + server-side user authentication. $\endgroup$
    – dchest
    Jan 2, 2013 at 13:24
  • $\begingroup$ TLS doesn't encrypt the plain in sight content, it encrypts it over the wire. The decryption needs to occur on the client side. i.e within a javascript function in a browser. I can use a server to provide a combination values that can be used in decryption but the constraint is that the page must be pre-encrypted and in plain sight. i.e publicly browse able. $\endgroup$
    – Andrew
    Jan 2, 2013 at 16:29
  • 1
    $\begingroup$ I guess one way of looking at this problem would be if there is a file that is encrypted once but can be decrypted using many different unique keys stackoverflow.com/questions/597188/… $\endgroup$
    – Andrew
    Jan 2, 2013 at 17:35
  • 2
    $\begingroup$ Encrypt content with a randomly generated key. Encrypt this key for each user with a user-specific key. $\endgroup$
    – dchest
    Jan 2, 2013 at 23:01
  • 1
    $\begingroup$ @Andrew User1 can give away decrypted plaintext without revealing any keys anyway. Perhaps, you can tell us what kind of problem you're trying to solve? $\endgroup$
    – dchest
    Jan 3, 2013 at 11:43

1 Answer 1


The answer in the comments from dchest is probably the most standard. Encrypt the page with a single, random key. Then encrypt that key for each user using the shared secret that you hold with that user.

It is unclear whether this meets your needs as it is unclear exactly what your needs are.

With that in mind, a fairly advanced way you could get the functionality you require is with Ciphertext-Policy Attribute Based Encryption. It is very complex and would require a lot to describe in this answer (and I don't even know if it meets your needs as they seem to not be fully defined at this point).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.