Skip to content

Encryption on Linux

Ray Luo edited this page Sep 18, 2020 · 2 revisions

Overview

Encryption on Linux is available by using libsecret to connect to secret service running on your Linux machine.

Secret service is only available when running in a desktop environment. It won't be available when remotely connected to a Linux machine, such as via an SSH connection.

Dependency

MSAL Extensions for Python uses PyGObject to talk to libsecret. But pip install pygobject would typically fail, until you install its dependencies first. For example, on a Debian Linux, you would need:

sudo apt install libgirepository1.0-dev libcairo2-dev python3-dev gir1.2-secret-1
pip install pygobject

Please refer to installation details of PyGObject project.

In case you would wonder:

Our dependency list is slightly different than what you would read from the official PyGObject project, because:

  • The PyGObject is a general interface. An app would need some other dependency to perform the real job.
  • The official PyGObject document gears toward GUI apps, so it would mention underlying dependencies such as gir1.2-gtk-3.0, which is harmless yet unnecessary for encryption.
  • Our encryption would need gir1.2-secret-1. If you just follow the official PyGObject installation guide, our Persistence layer (which implements the encryption) would then emit a run-time error to ask for gir1.2-secret-1 anyway.