7

I am looking for a way to do multi-key encryption with the set number of decryption keys. The goal is to take a file, encrypt it and generate several decryption keys, in order to decrypt several (not just one, but all either) keys must be used.

Use case:

Receive image.jpeg Generate an encrypted image.jpeg.crypt, image.jpeg.key1, image.jpeg.key2, image.jpeg.key3 Distribute keys to three different persons

After this 2 keys must be present to decrypt, but any 2 of the mentioned 3.

In perfect scenario i should be able to say: "Generate X keys, out of which Y keys will be required to decrypt".

P.S. This is not a duplicate of Encryption strategies for multi users access in production systems where any one key decrypts, nor is it a duplicate of Doubling up or cycling encryption algorithms where every key must be provided.

v010dya
  • 183
  • 1
  • 1
  • 6

1 Answers1

13

You are looking for secret sharing algorithms. Once such scheme was proposed by Shamir, called Shamir's secret sharing algorithm.

Quoting from Wikipedia:

... a secret is divided into parts, giving each participant its own unique part, where some of the parts or all of them are needed in order to reconstruct the secret.

Adi
  • 43,808
  • 16
  • 135
  • 167
Jor-el
  • 2,061
  • 17
  • 24