tird


Nametird JSON
Version 0.11.0 PyPI version JSON
download
home_pagehttps://github.com/hakavlad/tird
SummaryA tool for writing random bytes, encrypting file contents, and hiding encrypted data
upload_time2024-04-26 10:41:59
maintainerNone
docs_urlNone
authorAlexey Avramov
requires_python>=3.6
licenseCC0
keywords encryption hiding
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Logo: random data visualization](https://raw.githubusercontent.com/hakavlad/tird/main/images/logo.png)

# tird

`tird` *(an acronym for "this is random data")* is a tool for writing random bytes, encrypting file contents, and hiding encrypted data.

`tird` can create files with random data, overwrite file contents with random data, encrypt file contents and comments, hide encrypted data among random data, minimize metadata leakage, and can provide some forms of [plausible deniability](https://en.wikipedia.org/wiki/Plausible_deniability#Use_in_cryptography).

## Goals

- Providing protection for individual files, including:
  - symmetric encryption;
  - reducing metadata leakage;
  - hiding encrypted data;
  - plausible deniability.
- Providing a stable encryption format with no [cryptographic agility](https://en.wikipedia.org/wiki/Cryptographic_agility) for long-term data storage.
- Simplicity and no [feature creep](https://en.wikipedia.org/wiki/Feature_creep): refusal to implement features that are not directly related to primary security goals.

## Cryptographic primitives

`tird` uses the following cryptographic primitives:
- `BLAKE2` ([RFC 7693](https://datatracker.ietf.org/doc/html/rfc7693.html)):
  - salted and personalized `BLAKE2b` for hashing keyfiles and passphrases;
  - keyed `BLAKE2b` for message authentication.
- `Argon2` memory-hard function ([RFC 9106](https://datatracker.ietf.org/doc/html/rfc9106/)) for key stretching and key derivation.
- `ChaCha20` cipher ([RFC 7539](https://datatracker.ietf.org/doc/html/rfc7539)) for data encryption.

## Encrypted file format

`tird` encrypted files (cryptoblobs) are indistinguishable from uniform random data and have no identifiable headers. `tird` produces cryptoblobs contain bilateral [randomized padding](https://en.wikipedia.org/wiki/Padding_(cryptography)#Randomized_padding) with uniform random data ([PURBs](https://en.wikipedia.org/wiki/PURB_(cryptography))). This minimizes metadata leaks from the file format and makes it possible to hide cryptoblobs among other random data.

Cryptoblob structure:

```
                     512 B        0+ B
                 +——————————+———————————————+
                 | Comments | File contents |
                 +——————————+———————————————+
  16 B    0+ B   |     Plaintext/Payload    |  64 B      0+ B     16 B
+——————+—————————+——————————————————————————+—————————+—————————+——————+
| Salt | Padding |        Ciphertext        | MAC tag | Padding | Salt |
+——————+—————————+——————————————————————————+—————————+—————————+——————+
|  Random bytes  |     Random-looking bytes           |  Random bytes  |
+————————————————+————————————————————————————————————+————————————————+
```

## Tradeoffs and limitations

- `tird` does not support public-key cryptography.
- `tird` does not support file compression.
- `tird` does not support ASCII armored output.
- `tird` does not support Reed–Solomon error correction.
- `tird` does not support splitting the output into chunks.
- `tird` does not support low-level device reading and writing when used on MS Windows (devices cannot be used as keyfiles, cannot be overwritten, cannot be encrypted or hidden).
- `tird` does not provide a graphical user interface.
- `tird` does not provide a password generator.
- `tird` does not wipe sensitive data from the heap.
- `tird` can only encrypt one file per iteration. Encryption of directories and multiple files is not supported.
- `tird` does not fake file timestamps (atime, mtime, ctime).
- `tird` encryption speed is not very fast: up to 180 MiB/s (in my tests).

## Warnings

- ⚠️ The author is not a cryptographer.
- ⚠️ `tird` has not been independently audited.
- ⚠️ `tird` probably won't help much when used in a compromised environment.
- ⚠️ `tird` probably won't help much when used with short and predictable keys.
- ⚠️ Keys may leak into the swap space.
- ⚠️ `tird` always releases unverified plaintext (violates [The Cryptographic Doom Principle](https://moxie.org/2011/12/13/the-cryptographic-doom-principle.html)).
- ⚠️ `tird` does not sort digests of keyfiles and passphrases in constant time.
- ⚠️ Development is not complete, there may be backward compatibility issues in the future.

## Usage

You don't need to remember command line options to use `tird`.

Just start `tird`, select a menu option, and then answer the questions that `tird` will ask:

```bash
$ tird
```

![screenshot: MENU](https://i.imgur.com/h2KG9iy.png)

## Debug

Start `tird` with the option `--debug` or `-d` to look under the hood while the program is running:

```bash
$ tird -d
```

Enabling debug messages additionally shows:
- opening and closing file descriptors;
- real paths to opened files;
- moving file pointers using the seek() method;
- salts, passphrases, digests, keys, nonces, tags;
- some other info.

## Tutorial

See [here](https://github.com/hakavlad/tird/blob/main/docs/tutorial/README.md).

## Requirements

- Python >= 3.6
- [PyNaCl](https://pypi.org/project/PyNaCl/) >= 1.2.0 (provides `Argon2`)
- [PyCryptodomex](https://pypi.org/project/pycryptodomex/) >= 3.6.2 (provides `ChaCha20`)

## Install

Install `python3` and `python3-pip` (or `python-pip`), then run

```bash
$ pip install tird
```

Standalone executables (made with [PyInstaller](https://pyinstaller.org/en/stable/)) are also available (see [Releases](https://github.com/hakavlad/tird/releases)).

![tird.exe](https://i.imgur.com/3ls7OOe.png)

## TODO

Write documentation:
- Features;
- User guide;
- Specification;
- Design rationale.

## Feedback

Feel free to post any questions, feedback or criticisms to the [Discussions](https://github.com/hakavlad/tird/discussions).

## License

This project is licensed under the terms of the [Creative Commons Zero v1.0 Universal License](https://github.com/hakavlad/tird/blob/main/LICENSE) (Public Domain Dedication).



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hakavlad/tird",
    "name": "tird",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "encryption hiding",
    "author": "Alexey Avramov",
    "author_email": "hakavlad@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/23/f6/85dbdf25a55588defcd48aa53fe8bb6ce65e9ef3a7a7432e5fceaafa441e/tird-0.11.0.tar.gz",
    "platform": null,
    "description": "![Logo: random data visualization](https://raw.githubusercontent.com/hakavlad/tird/main/images/logo.png)\n\n# tird\n\n`tird` *(an acronym for \"this is random data\")* is a tool for writing random bytes, encrypting file contents, and hiding encrypted data.\n\n`tird` can create files with random data, overwrite file contents with random data, encrypt file contents and comments, hide encrypted data among random data, minimize metadata leakage, and can provide some forms of [plausible deniability](https://en.wikipedia.org/wiki/Plausible_deniability#Use_in_cryptography).\n\n## Goals\n\n- Providing protection for individual files, including:\n  - symmetric encryption;\n  - reducing metadata leakage;\n  - hiding encrypted data;\n  - plausible deniability.\n- Providing a stable encryption format with no [cryptographic agility](https://en.wikipedia.org/wiki/Cryptographic_agility) for long-term data storage.\n- Simplicity and no [feature creep](https://en.wikipedia.org/wiki/Feature_creep): refusal to implement features that are not directly related to primary security goals.\n\n## Cryptographic primitives\n\n`tird` uses the following cryptographic primitives:\n- `BLAKE2` ([RFC 7693](https://datatracker.ietf.org/doc/html/rfc7693.html)):\n  - salted and personalized `BLAKE2b` for hashing keyfiles and passphrases;\n  - keyed `BLAKE2b` for message authentication.\n- `Argon2` memory-hard function ([RFC 9106](https://datatracker.ietf.org/doc/html/rfc9106/)) for key stretching and key derivation.\n- `ChaCha20` cipher ([RFC 7539](https://datatracker.ietf.org/doc/html/rfc7539)) for data encryption.\n\n## Encrypted file format\n\n`tird` encrypted files (cryptoblobs) are indistinguishable from uniform random data and have no identifiable headers. `tird` produces cryptoblobs contain bilateral [randomized padding](https://en.wikipedia.org/wiki/Padding_(cryptography)#Randomized_padding) with uniform random data ([PURBs](https://en.wikipedia.org/wiki/PURB_(cryptography))). This minimizes metadata leaks from the file format and makes it possible to hide cryptoblobs among other random data.\n\nCryptoblob structure:\n\n```\n                     512 B        0+ B\n                 +\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\n                 | Comments | File contents |\n                 +\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\n  16 B    0+ B   |     Plaintext/Payload    |  64 B      0+ B     16 B\n+\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014+\n| Salt | Padding |        Ciphertext        | MAC tag | Padding | Salt |\n+\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014+\n|  Random bytes  |     Random-looking bytes           |  Random bytes  |\n+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014+\n```\n\n## Tradeoffs and limitations\n\n- `tird` does not support public-key cryptography.\n- `tird` does not support file compression.\n- `tird` does not support ASCII armored output.\n- `tird` does not support Reed\u2013Solomon error correction.\n- `tird` does not support splitting the output into chunks.\n- `tird` does not support low-level device reading and writing when used on MS Windows (devices cannot be used as keyfiles, cannot be overwritten, cannot be encrypted or hidden).\n- `tird` does not provide a graphical user interface.\n- `tird` does not provide a password generator.\n- `tird` does not wipe sensitive data from the heap.\n- `tird` can only encrypt one file per iteration. Encryption of directories and multiple files is not supported.\n- `tird` does not fake file timestamps (atime, mtime, ctime).\n- `tird` encryption speed is not very fast: up to 180 MiB/s (in my tests).\n\n## Warnings\n\n- \u26a0\ufe0f The author is not a cryptographer.\n- \u26a0\ufe0f `tird` has not been independently audited.\n- \u26a0\ufe0f `tird` probably won't help much when used in a compromised environment.\n- \u26a0\ufe0f `tird` probably won't help much when used with short and predictable keys.\n- \u26a0\ufe0f Keys may leak into the swap space.\n- \u26a0\ufe0f `tird` always releases unverified plaintext (violates [The Cryptographic Doom Principle](https://moxie.org/2011/12/13/the-cryptographic-doom-principle.html)).\n- \u26a0\ufe0f `tird` does not sort digests of keyfiles and passphrases in constant time.\n- \u26a0\ufe0f Development is not complete, there may be backward compatibility issues in the future.\n\n## Usage\n\nYou don't need to remember command line options to use `tird`.\n\nJust start `tird`, select a menu option, and then answer the questions that `tird` will ask:\n\n```bash\n$ tird\n```\n\n![screenshot: MENU](https://i.imgur.com/h2KG9iy.png)\n\n## Debug\n\nStart `tird` with the option `--debug` or `-d` to look under the hood while the program is running:\n\n```bash\n$ tird -d\n```\n\nEnabling debug messages additionally shows:\n- opening and closing file descriptors;\n- real paths to opened files;\n- moving file pointers using the seek() method;\n- salts, passphrases, digests, keys, nonces, tags;\n- some other info.\n\n## Tutorial\n\nSee [here](https://github.com/hakavlad/tird/blob/main/docs/tutorial/README.md).\n\n## Requirements\n\n- Python >= 3.6\n- [PyNaCl](https://pypi.org/project/PyNaCl/) >= 1.2.0 (provides `Argon2`)\n- [PyCryptodomex](https://pypi.org/project/pycryptodomex/) >= 3.6.2 (provides `ChaCha20`)\n\n## Install\n\nInstall `python3` and `python3-pip` (or `python-pip`), then run\n\n```bash\n$ pip install tird\n```\n\nStandalone executables (made with [PyInstaller](https://pyinstaller.org/en/stable/)) are also available (see [Releases](https://github.com/hakavlad/tird/releases)).\n\n![tird.exe](https://i.imgur.com/3ls7OOe.png)\n\n## TODO\n\nWrite documentation:\n- Features;\n- User guide;\n- Specification;\n- Design rationale.\n\n## Feedback\n\nFeel free to post any questions, feedback or criticisms to the [Discussions](https://github.com/hakavlad/tird/discussions).\n\n## License\n\nThis project is licensed under the terms of the [Creative Commons Zero v1.0 Universal License](https://github.com/hakavlad/tird/blob/main/LICENSE) (Public Domain Dedication).\n\n\n",
    "bugtrack_url": null,
    "license": "CC0",
    "summary": "A tool for writing random bytes, encrypting file contents, and hiding encrypted data",
    "version": "0.11.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/hakavlad/tird/issues",
        "Documentation": "https://github.com/hakavlad/tird/blob/main/README.md",
        "Homepage": "https://github.com/hakavlad/tird"
    },
    "split_keywords": [
        "encryption",
        "hiding"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7b4aa3ad7689344f4567cbb04f4762a444c7f59983cc983c8c6a0eb37587f71b",
                "md5": "df6e904eb04c2c4447e61e09bac4f67c",
                "sha256": "4c9d47434a7d37fdc5a0f2c0d17d47c8ff741e467b66a6e3adc9afbd1ff01d88"
            },
            "downloads": -1,
            "filename": "tird-0.11.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "df6e904eb04c2c4447e61e09bac4f67c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 14730,
            "upload_time": "2024-04-26T10:41:57",
            "upload_time_iso_8601": "2024-04-26T10:41:57.834521Z",
            "url": "https://files.pythonhosted.org/packages/7b/4a/a3ad7689344f4567cbb04f4762a444c7f59983cc983c8c6a0eb37587f71b/tird-0.11.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23f685dbdf25a55588defcd48aa53fe8bb6ce65e9ef3a7a7432e5fceaafa441e",
                "md5": "b0bec5bcc320cb3c819092a6dd14742f",
                "sha256": "03b94722c6f1e80c0651dab3822420311952d48975b7218fbcffe059821abc42"
            },
            "downloads": -1,
            "filename": "tird-0.11.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b0bec5bcc320cb3c819092a6dd14742f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 17368,
            "upload_time": "2024-04-26T10:41:59",
            "upload_time_iso_8601": "2024-04-26T10:41:59.838141Z",
            "url": "https://files.pythonhosted.org/packages/23/f6/85dbdf25a55588defcd48aa53fe8bb6ce65e9ef3a7a7432e5fceaafa441e/tird-0.11.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-26 10:41:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hakavlad",
    "github_project": "tird",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tird"
}
        
Elapsed time: 0.25069s