Why use cryptography? If I understand the problem statement correctly, there’s a simpler solution. When a prisoner wants to go to sleep, they signal and a guard walks over and renders them unconscious, presumably using drugs. Since we know that nobody would go to sleep outside of jail, you can figure out who is who by counting the number of times they’ve been sedated.
(This is vulnerable to troubles telling who is who at the start, but so is any knowledge-based method. This is also vulnerable to people falling asleep outside, but so is any knowledge based method. It’s also fairly dangerous, given that most drugs capable of rendering somebody unconscious are dangerous; however, giving guards some training and then handwaving away or saying the society isn’t concerned by the (minimal) danger sounds reasonable. It assumes certain things about going to sleep and drugs that may not be true in this universe, but it at least sounds reasonable- and this is fiction.)
Sedatives would cause physical sleep, and the reason people share bodies in this world is because having your body be asleep will cause your soul to be eaten by insubstantial demons. Sleeping-while-someone-else-pilots-your-body is safe in large part because it cuts off interventions regarding your soul from outside sources—demons, drugs, magic, etc.
Also, this method relies on cooperative criminals, not just cooperative cohabitors-with-criminals. The criminal has an incentive to make being in jail really inconvenient for their cohabitor—by, for instance, not notifying anyone before going to sleep. They’re already in jail, so making their cohabitor mad at them has limited power to make their situation worse, but if the guards wind up having to imprison the cohabitor too to be safe, the cohabitor might work on ways to get out.
Moving one person in with another person is already very magically challenging; this might not be strictly impossible but your average community would not have access to even one person who could do it. Perhaps this would be a good last resort on a national level for anyone with a demonstrated propensity to actually escape, or whose escape would be particularly dreadful.
Why use cryptography? If I understand the problem statement correctly, there’s a simpler solution. When a prisoner wants to go to sleep, they signal and a guard walks over and renders them unconscious, presumably using drugs. Since we know that nobody would go to sleep outside of jail, you can figure out who is who by counting the number of times they’ve been sedated.
(This is vulnerable to troubles telling who is who at the start, but so is any knowledge-based method. This is also vulnerable to people falling asleep outside, but so is any knowledge based method. It’s also fairly dangerous, given that most drugs capable of rendering somebody unconscious are dangerous; however, giving guards some training and then handwaving away or saying the society isn’t concerned by the (minimal) danger sounds reasonable. It assumes certain things about going to sleep and drugs that may not be true in this universe, but it at least sounds reasonable- and this is fiction.)
Sedatives would cause physical sleep, and the reason people share bodies in this world is because having your body be asleep will cause your soul to be eaten by insubstantial demons. Sleeping-while-someone-else-pilots-your-body is safe in large part because it cuts off interventions regarding your soul from outside sources—demons, drugs, magic, etc.
Also, this method relies on cooperative criminals, not just cooperative cohabitors-with-criminals. The criminal has an incentive to make being in jail really inconvenient for their cohabitor—by, for instance, not notifying anyone before going to sleep. They’re already in jail, so making their cohabitor mad at them has limited power to make their situation worse, but if the guards wind up having to imprison the cohabitor too to be safe, the cohabitor might work on ways to get out.
I suppose reallocating cohabitors (say, criminals with criminals) is out of the question?
Moving one person in with another person is already very magically challenging; this might not be strictly impossible but your average community would not have access to even one person who could do it. Perhaps this would be a good last resort on a national level for anyone with a demonstrated propensity to actually escape, or whose escape would be particularly dreadful.