Home > Riddles > Trunks and padlocks without shared key

Trunks and padlocks without shared key

Pure logicLevel 3 · Intermediate · ●●●○○

You and I are far away and can only send trunks to each other by courier.

  • Each one has their own padlock and their own key.
  • If a trunk travels without a lock, what it carries can be stolen.
  • We do not have a shared secret key.

How can I send you information so that the trunk never travels open and only you can read its contents at the end?

Hints

Show hints
  1. The open (keyless) lock looks like a public key: anyone can use it to lock/encrypt.
  2. Analogy with current cryptography: n=pq is published as part of the public key.
  3. Answer (3-trip protocol): You add your lock B (A+B remain) and return it to me.

Solution

Show full solution

Answer (3-trip protocol):

  1. I put the message in the trunk and close it with my A lock. I send it to you.
  2. You add your B lock (A+B left) and return it to me.
  3. I remove A and send it back to you (only B remains).
  4. You remove B and read the content.

In no section does the trunk travel open.
Analogy with current cryptography:

  • The open padlock (without key) looks like a public key: anyone can use it to lock/encrypt.
  • The key of the padlock looks like the private key: only the owner can open/decrypt it.

What role does the prime number have?
In RSA there are no physical locks: there is modular arithmetic.

  • Large cousins ​​$p,q$ are chosen.
  • $n=pq$ is published as part of the public key.
  • Safety depends on the difficulty of factoring $n$ to recover $p,q$.

Important: it is not identical to RSA
They are conceptually similar, but different:

  1. The trunk protocol uses round trip (multiple steps); RSA allows single-send encryption with the recipient's public key.
  2. The trunk involves a physical operation of “removing my lock, leaving yours”; In cryptography this is formalized with mathematical functions.3. In real systems there is authentication and signatures to prevent impersonation (MITM), something that the puzzle simplifies.

Conclusion: It is an excellent insight into asymmetric cryptography, but not a complete modern cryptographic protocol.


Related riddles

Keep practicing

If you enjoyed this one, try more pure-logic riddles, explore this theme, browse the full archive, or read the riddle-solving guide.

← Previous: The two ropes · Next: The nine points →