Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For emergencies: share part of pass with 4 people, decryptable with 2 persons

Let's say I have a password:

AAABBBCCCDDD I could easily give person A the first part (AAA), person B the second part and so on.

But is there an option any two of the four people can decrypt/form the password from a part of text I give them? Obviously, from only the parts AAA and DDD the password can not be formed.

How? :)

like image 920
Karel Avatar asked Apr 23 '11 17:04

Karel


1 Answers

This is known as "Secret sharing", "Key splitting" or "Key distribution", and can be done with some public key cryptography algorithms.

Here are a few links on the subject:

  • Wikipedia article: Key distribution
  • Wikipedia article: Secret sharing

An easy way to do 2 out of 4 would be to split the key into 4 pieces, and distribute 3 pieces to everyone. The distributed parts would know which parts they have.

Here's a sample distribution:

  1. 1+2+3
  2. 1+2+4
  3. 1+3+4
  4. 2+3+4

As you can see, no matter which two people you pick, they will always have all four pieces. There are more mathematical methods the more people and combinations you get to, but it is certainly doable.

like image 167
Lasse V. Karlsen Avatar answered Sep 18 '22 23:09

Lasse V. Karlsen