SEAL icon indicating copy to clipboard operation
SEAL copied to clipboard

Sharing a private key

Open patriciaOrtuno28 opened this issue 3 years ago • 4 comments

Hello, I wanted to find a way to share a private key between devices safely. I thought about encrypting a 0 in device A and sending that ciphertext to device B. In this location, I wanted to add that encrypted 0 to B's private key and, back in A's device, substract it. I don't think a ciphertext can be added to a private key, but it was the closest representation of an XOR I could think of. I was wondering if anybody knew a way to share that private key safely between devices, maybe wrapping it inside another key, or if the sum between ciphertexts and keys is viable. Thank you in advance.

patriciaOrtuno28 avatar Jul 14 '22 10:07 patriciaOrtuno28

For example to encrypt the SEAL's key using other symmetric/asymmetric crypto (AES or RSA)?

fionser avatar Jul 15 '22 08:07 fionser

For example to encrypt the SEAL's key using other symmetric/asymmetric crypto (AES or RSA)?

I was trying to avoid that. What I was thinking of was the addition between the Ciphertext of a 0 with the Plaintext of a secret key. The issue would be the size of that Plaintext. I'm not sure how to split the key into chunks that fit the maximum size of the Plaintext. The size is so large that I get an error of "plain is not valid for encryption parameters".

patriciaOrtuno28 avatar Jul 15 '22 11:07 patriciaOrtuno28

Hello, I wanted to find a way to share a private key between devices safely. I thought about encrypting a 0 in device A and sending that ciphertext to device B. In this location, I wanted to add that encrypted 0 to B's private key and, back in A's device, substract it. I don't think a ciphertext can be added to a private key, but it was the closest representation of an XOR I could think of. I was wondering if anybody knew a way to share that private key safely between devices, maybe wrapping it inside another key, or if the sum between ciphertexts and keys is viable. Thank you in advance.

In my opinion, the best way to share a private key is using Shamir's Secret Sharing algorithm https://www.geeksforgeeks.org/shamirs-secret-sharing-algorithm-cryptography/ I hope it helps you.

gelintonx avatar Jul 17 '22 12:07 gelintonx

You can take a look at how key switching keys, i.e., relinearization keys and Galois keys, are generated. That could be your example of encrypting a secret key using SEAL. But overall for communication and computation efficiency, one would use AES to encrypt data if no homomorphic functionality is planned.

WeiDaiWD avatar Jul 20 '22 17:07 WeiDaiWD