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.2.tar.gz (41.1 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.2-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cryptoluggage-3.1.2.tar.gz
  • Upload date:
  • Size: 41.1 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.2.tar.gz
Algorithm Hash digest
SHA256 36ed1b5717ad6b9a7460fe1d9e400a93f0ed2a86b1b94feb775bb5aec3488278
MD5 7f5ff4149099a229f65a18b5891427ff
BLAKE2b-256 2cacd5c9dfedca10c52eec42418d83e47cf22d69dd4c96db9b6b9b246fcd2d7c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cryptoluggage-3.1.2-py3-none-any.whl
  • Upload date:
  • Size: 21.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dc8e8537a2607a8a97b76a702564ac146074d116f6ee9dd3b0584d3507821d2c
MD5 c253955c85a98fe43fa10c4883752830
BLAKE2b-256 1031463f7abc9fe03fb7fa62e588f482d523ee93f3dffb63fd8ae0fe5ba8294a

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