# Logistic regression, Federated Learning, Homomorphic encryption

**URL:** <https://openfhe.discourse.group/t/logistic-regression-federated-learning-homomorphic-encryption/1710>\
**Category:** Library Questions\
**Created:** [November 10, 2024, 1:30pm UTC](https://openfhe.discourse.group/t/logistic-regression-federated-learning-homomorphic-encryption/1710 "2024-11-10T13:30:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashuradhipathi](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Ashuradhipathi](https://openfhe.discourse.group/u/Ashuradhipathi)\
**Post date:** [November 10, 2024, 1:30pm UTC](https://openfhe.discourse.group/t/logistic-regression-federated-learning-homomorphic-encryption/1710/1 "2024-11-10T13:30:19Z")

</div>

I was working on replicating this [Repo](https://github.com/thecrabsterchief/Federated-Learning-meets-Homomorphic-Encryption/blob/main/encrypted_learning.ipynb), using openfhe in logistic regression to encrypt and decrypt weights and am facing difficulties in doing so in kaggle. I am facing permission issues, and also this error

```auto
File /opt/conda/lib/python3.10/site-packages/openfhe/ __init__.py:1
----> 1 from .openfhe import *

ImportError: libOPENFHEpke.so.1: cannot open shared object file: No such file or directory 

```

Can anyone help me in replicating the given notebook?

the use of library was done in **23rd cell**

```auto
from openfhe_lib.ckks.openFHE import * 

# === Generate Key-pairs of CKKS Context ===
generate_keys()

```

In cell **24th**  
`encrypt_weights(model_params, self.enc_file)` in `encrypted_model_params` and `decrypt_weights("/enc_aggregator_weight_server.txt")` in `decrypted_model_params`

---

<div class="post-metadata">

**Author:** ![dsuponitskiy-duality](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@dsuponitskiy-duality](https://openfhe.discourse.group/u/dsuponitskiy-duality)\
**Post date:** [November 12, 2024, 2:20pm UTC](https://openfhe.discourse.group/t/logistic-regression-federated-learning-homomorphic-encryption/1710/2 "2024-11-12T14:20:48Z")

</div>

@Ashuradhipathi You should follow [these installation instructions](https://github.com/openfheorg/openfhe-python?tab=readme-ov-file#linux). The same instructions mention 2 environment variables you should also set: **PYTHONPATH** and **LD\_LIBRARY\_PATH**.
