Your rating: None Average: 4.9 (9 votes)

Unlocking and mounting encrypted SD-cards automatically

The necessary steps to prepare an SD-card are described at (TJC).

crypto-sdcard solely protects "data at rest" on SD-cards, i.e. specifically when the device is locked or switched off (and the SD-card may be taken out), as the "key"-files reside unencrypted on fixed, internal mass storage of the device.


  • For devices (e.g. Jolla 1 phones aka "sbj"), which need Qualcomm's qcrypto kernel module to be loaded in order to support modern cryptographic schemes as e.g. XTS, a separate edition is provided.
    For all other devices, this generic edition shall be used.
  • Do reboot before using crypto-sdcard.
  • These RPM packages contain newer versions of the configuration files originally posted at TJC, which are now hosted at Github.
  • "Key"-file path and names are:
    • For Cryptsetup LUKS:
    • For Cryptsetup "plain":
    • A specific "<UUID>" can be obtained by executing
      blkid -c /dev/null -s UUID -o value /dev/<device-name>
      with e.g. "mmcblk1p2" as "<device-name>".
  • For discussing the necessary preparation of SD-cards (i.e., partitioning and formatting them, plus the usage of Cryptsetup and creating "key"-files), please use the corresponding thread on TJC.
  • For discussing crypto-sdcard's specific configuration files and its RPM packaging, please use its issue tracker at Github.
  • Issues with these RPM packages or the configuration files they install shall also be filed at crypto-sdcard's issue tracker at Github.
  • As this web-page at OpenRepos exists merely for distributing crypto-sdcard packaged for SailfishOS, there is no need for issuing comments here.


  • These configuration files do not alter, replace or delete any extant files.
  • Support of encrypted partitions and whole devices.
  • Support for (µ)SD-cards and USB-attached storage (if supported by device hardware and Operating System).
  • Interoperable with SailfishOS GUI apps (see details).
  • Support for Cryptsetup LUKS and Cryptsetup "plain".
    • Note that SailfishOS just recently (with v3.0.3) switched to Cryptsetup 2, and so did most (desktop) Linux distributions. For interoperability with extant Linux installations and commonality with SailfishOS before v3.0.3, which provide Cryptsetup 1.x (therefore only support LUKSv1 headers), the "partitioning guide" aims at creating LUKSv1 headers.
    • As Cryptsetup reads the cryptography parameters from the LUKS header and Cryptsetup 2 supports both v1 and v2 headers, crypto-sdcard shall work fine with any LUKS header version and parameters, which are valid for the installed Cryptsetup version.
    • For Cryptsetup "plain" (only to be used, when "plausible deniability" is a must), crypto-sdcard has to provide the cryptography parameters and uses "-h sha1 -s 256 -c aes-xts-plain" by default. While these parameters are optimised for speed, low power consumption, interoperability and sufficiently strong security for the next decade (including the specific use of SHA1 for hashing a pass-file down to 160 bits), other parameters may be set for unlocking Cryptsetup "plain" in /etc/systemd/system/cryptosd-plain@.service
  • Start mounting encrypted (partitions on) SD-card via udisks at the earliest sensible time: Right after udisks2.service has started.
  • Unmount before udisks2 begins stopping, hence achieving a clean unmount.
  • Ensure, that AlienDalvik begins starting after mounting succeeded, to allow for android_storage on SD-card. Even more importantly this also ensures, that unmounting occurs only after AlienDalvik is completely stopped.
    Nevertheless, these configuration files are also applicable to devices without AlienDalvik installed.
  • Boot time is not significantly prolonged, as unlocking encrypted partitions per Cryptsetup occurs in parallel to starting udisks2; after both succeeded, all mount operations are also started concurrently.
  • Versions below 1.0: Create / try to rectify the "compatibility symlink" in order to allow older apps seamlessly accessing encrypted (partitions on) SD-cards at their new (since SailfishOS 2.2.0) mount point.


Application versions: 
File crypto-sdcard-0.6-2.noarch.rpm10.68 KB26/01/2019 - 20:05
File crypto-sdcard-0.6-3.noarch.rpm10.08 KB26/01/2019 - 20:05
File crypto-sdcard-1.0-4.noarch.rpm9.31 KB12/10/2019 - 16:59
File crypto-sdcard-1.2.2-43.noarch.rpm26.36 KB25/01/2020 - 17:50
File crypto-sdcard-1.2.5-46.noarch.rpm26.16 KB16/10/2020 - 11:56
File crypto-sdcard-1.3.1-4.sfos321regular.noarch.rpm26.28 KB23/10/2020 - 13:27
File crypto-sdcard-1.3.1-4.sfos340regular.noarch.rpm26.25 KB23/10/2020 - 13:27

A plain changelog is provided at the bottom of crypto-sdcard's README at Github and changes to the RPM packaging are coarsely documented in its release comments there.


zipotron's picture

Hello! I had it working good, but after update system to os3.4 is not automonting at boot any more, I updated the app too, I did the steps of the forum again, but no way to make it work again... any idea? Thanks!

fooxl's picture

See this issue. You have to edit some files.

olf's picture

Thank you @fooxl to provide a link to this issue here.

Meanwhile I fixed the breakage SFOS 3.4.0 brought (by the help of some analysis and testing from @fuchsmich) in sfos-upgrade-1.3.1-1.sfos340.noarch.rpm

yeoldegrove's picture

This is a killer feature app. Writing this from a fully encrypred Sailfish 3.3 phone.

olf's picture

BTW, crypto-sdcard is in "maintenance mode" since version 1.0, as it appears to be stable and feature complete for its users.
That means there will be no new releases, unless bugs are reported (preferably at Github) or a new SailfishOS release breaks it.

fooxl's picture

What is the reason it's not compatible with SFOS 3.0?

olf's picture

v0.5-4 and later versions should install flawlessly under SFOS 3.0.0.
Do you have issues installing crypto-sdcard?