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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cryptoluggage-3.1.3.tar.gz
  • Upload date:
  • Size: 41.2 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.3.tar.gz
Algorithm Hash digest
SHA256 d015702520d1945971b4fec4099bf43a67f42c0cf24ca8e32b68b2a74092a363
MD5 bc3afc0cbc0bd80fdb44429b31aaecdc
BLAKE2b-256 1b71e5fb375ba403c5d2eb9635d975b9cb2e2420dd00031a475139ea784233e5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cryptoluggage-3.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5b17f27c9d708e44e6e19bb1d411c35bf697b2739ef5da3d5197edfabbcfdd55
MD5 e72a2279b0e3a0ed3ef62a266ca2cc88
BLAKE2b-256 092412411f21d1917ab5bb16f6c9aadd7581fbe23d38f7c6e9e03f0456da6afe

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