From 51e13ba93bd2a6860d3abcfa8ab010c95d29d43f Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Sun, 9 Mar 2025 14:33:04 +0000 Subject: [PATCH] Update README.md --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index f35cd73..161e717 100644 --- a/README.md +++ b/README.md @@ -393,9 +393,6 @@ alpha = DeepFace.represent("img1.jpg")[0]["embedding"] # user tower # encrypt source embedding encrypted_alpha = cs.encrypt(alpha) -# remove cryptosystem and plain alpha not to be leaked in cloud -del cs, alpha - # restore the cryptosystem in cloud with only public key cloud_cs = LightPHE(algorithm_name = "Paillier", precision = 19, key_file = "public.txt") @@ -409,14 +406,10 @@ encrypted_cosine_similarity = encrypted_alpha @ beta with pytest.raises(ValueError, match="must have private key"): cloud_cs.decrypt(encrypted_cosine_similarity) -# restore the cryptosystem on-prem with secret key -cs = LightPHE(algorithm_name = "Paillier", precision = 19, key_file = "secret.txt") - # decrypt similarity calculated_similarity = cs.decrypt(encrypted_cosine_similarity)[0] # verification -threshold = 0.68 # cosine distance threshold for VGG-Face and cosine print("same person" if calculated_similarity >= 1 - threshold else "different persons") ```