Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encrypt the original SACC file before saving it to disk #58

Open
arthurmloureiro opened this issue Oct 4, 2024 · 0 comments
Open

Encrypt the original SACC file before saving it to disk #58

arthurmloureiro opened this issue Oct 4, 2024 · 0 comments
Assignees
Labels
data-vector blinding Issues related to data-vector blinding enhancement

Comments

@arthurmloureiro
Copy link
Contributor

To avoid accidental unblinding, we should encrypt the original sacc file before saving it. We should also save the encryption key in a text file and provide the user with a smokescreen function to decrypt (unblind) the original SACC.

Tagging @jablazek and @jessmuir for comments :)

@arthurmloureiro arthurmloureiro added enhancement data-vector blinding Issues related to data-vector blinding labels Oct 4, 2024
@arthurmloureiro arthurmloureiro self-assigned this Oct 4, 2024
arthurmloureiro added a commit that referenced this issue Oct 18, 2024
Related to #58

Add encryption and decryption functionalities for SACC files.

* **Encryption and Decryption**:
  - Add `generate_encryption_key`, `encrypt_data`, and `decrypt_data` methods in `src/smokescreen/datavector.py`.
  - Modify `save_concealed_datavector` method to encrypt the SACC file before saving.
  - Add `decrypt_sacc_file` function in `src/smokescreen/datavector.py`.

* **Main Function**:
  - Update `main` function in `src/smokescreen/__main__.py` to handle encryption and decryption.
  - Add `decrypt`, `encrypted_file_path`, and `encryption_key_path` arguments to the `main` function.

* **Tests**:
  - Add tests for `generate_encryption_key`, `encrypt_data`, and `decrypt_data` methods in `tests/test_datavector.py`.
  - Add tests for the modified `save_concealed_datavector` method.
  - Add tests for `decrypt_sacc_file` function.

* **Documentation**:
  - Add a section in `docs/source/usage.rst` to document the encryption and decryption functionalities.

* **Dependencies**:
  - Add `cryptography` as a dependency in `pyproject.toml` and `environment.yml`.

Needs testing if the Fernet lib actually works with sacc!

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/LSSTDESC/Smokescreen/issues/58?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-vector blinding Issues related to data-vector blinding enhancement
Projects
None yet
Development

No branches or pull requests

1 participant