Skip to main content

Cryptoluggage allows to keep encrypted secrets (e.g., passwords) and files

Project description

cryptoluggage

Cryptoluggage allows you to store your secrets (for example, passwords) and private files encrypted inside a single, portable file.

Cryptoluggage itself has been tested on Linux and, to a lesser extent, on Windows.

Installation

pip install cryptoluggage

Running

After installation, you can run the cl command or python -m cryptoluggage <arguments>

Usage:

To create a new Luggage:

cl create luggage_path

To open an existing Luggage:

cl open luggage_path

Security model

Cryptoluggage uses strong encryption (AES-256 in CBC mode) to protect your data. The encryption key is derived from your passphrase using PBKDF2 with a high iteration count (1 million by default) and a random salt (24 bytes by default). This makes brute-force attacks computationally expensive, and very difficult for sufficiently strong passphrases. Random IVs are used for each encryption operation to ensure that identical plaintexts produce different ciphertexts, further enhancing security.

Luggage structure

Each Luggage is a sqlite3 database with a single table token_store containing 2 columns, id and token. The id field is an integer that identifies the contents of the token field, and token is a blob that contains the secret data.

IDs -3, -2 and -1 are always present:

  • -1: The Luggage's cryptographic parameters. These include a random salt and the number of iterations used to derive the master cryptographic key from the user's passphrase. By default, PBKDF2 with 1 million iterations and a 24-byte random salt are used.

    Notes:

    • This entry is the only one not encrypted; these parameters are not secret and they are needed to perform decryption.
    • From version 3.1.0 onwards, this field is stored in JSON format. In previous versions, it was stored using pickle, which could be dangerous if the database file was tampered with. You can load Luggages created with older versions using the --legacy flag when opening them, but beware of the security implications if the file integrity cannot be guaranteed.
    • Versions prior to 3.1.0 used a salt length of 16 bytes, which was deemed safe enough by OWASP. The salt length is not automatically updated when opening an older Luggage.
  • -2: The Luggage's secret texts. Each secret has a unique name associated with it, and arbitrary UTF-8 contents. The token field contains an encrypted representation of all secrets, structured as a dictionary indexed by name. Encryption of this secret dictionary is performed using the master cryptographic key. Each time the secrets are updated, a new random IV is generated for encryption.

    Notes:

    • Attackers with access to this field can infer the total amount of secret information, but not the number of secrets, their names or contents.
    • Internally, pickle is used to store the dictionary of secrets. However,
      • decryption (and thus pickle.loads) is only performed after successful HMAC verification, so the integrity of the data is guaranteed. Thus, an attacker that tampers with this field cannot trigger arbitrary code execution without knowing the passphrase or encryption key.
      • From version 3.1.0 onwards, even if the passphrase is compromised, arbitrary code execution is made more difficult by using a custom restricted unpickler.
  • -3: The Luggage's secret file system structure. A tree of Dirs and leaf Files is stored here, representing the files and directories in the Luggage. Each File and Directory has a name, and Files have arbitrary binary contents. This entry contains only the structure of the file system (i.e., names and hierarchy), while the actual contents of each File are stored in separate DB entries (those with positive IDs). Encryption of this structure is performed using the master cryptographic key. Each time the structure is altered, a new random IV is generated for encryption.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cryptoluggage-3.1.1.tar.gz (39.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cryptoluggage-3.1.1-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file cryptoluggage-3.1.1.tar.gz.

File metadata

  • Download URL: cryptoluggage-3.1.1.tar.gz
  • Upload date:
  • Size: 39.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cryptoluggage-3.1.1.tar.gz
Algorithm Hash digest
SHA256 8bb61e7e5049223370d9fa83bd4fe893496247d3dc1c11900a4dd8ef3eddaf58
MD5 5d9f7f256dcc1c3a1f3c3b4062c5f377
BLAKE2b-256 0101befdf6fa6e1fe39c06a1482af8f36da6c3508824ac9002bdfcd558e89bcb

See more details on using hashes here.

File details

Details for the file cryptoluggage-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: cryptoluggage-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cryptoluggage-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 445a51a123ef5997fd763eda6cefb5e45f5420e5dd5418eab30bf57f2af74b2e
MD5 d4bfc975f5549bcd268512675c2ab42b
BLAKE2b-256 8b60c01efa9c0c563a3f1911523f641b4c96261f836610fb6ed7064552fa43f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page