Simple scheme to publish data with a private key

us flag

The goal is for Alice to send an encrypted message to Bob. Neither Bob nor anyone else should be able to decode the message. Alice should be be able to decode it, when all data is shown to her. However, Alice cannot store anything related to the message.

Private keys:

  • X1 - random bits
  • X2 - random bits
  • M - large prime number

Transmitted Key:

  • A - random large prime number

To send a message:

  1. Generate random prime A
  2. msg = msg XOR X1
  3. msg = msg * A (mod M)
  4. msg = msg XOR X2
  5. send (msg, A)

To decode:

  1. B = Multiplicative Inverse of A (mod M)
  2. msg = msg XOR x2
  3. msg = msg * B (mod M)
  4. msg = msg XOR x1

The idea is that the multiplication is sandwiched between two XORs which eliminate any sort of identifiable pattern.

Is this a reasonable algorithm or have I made a mistake somewhere?

(Note: I understand that ciphers such as RSA are the industry standard for this kind of problem. However, I wonder if a simpler solution is feasible when the stakes are lower. The use case here is not incredibly high-secure, it is for something like a CAPTCHA service, we can let the server issue a CAPTCHA question and send the answer to the client, asking him to return his answer alongside the encrypted answer, thus eliminating the need for a server-side data store.)

Maarten Bodewes avatar
in flag
I think that reading into AONTs starting from the Wikipedia page would show you schemes that rely on symmetric cryptography alone. Using modular arithmetic or message sized keys can and probably should be avoided if more efficient schemes are feasible.
us flag
Hi Maarten, thanks for your comment, I would like to add that for this application the message is only 32 bits.

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.