Skip to main content

A tool for writing random bytes, encrypting file contents, and hiding encrypted data

Project description

Logo: random data visualization

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.

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 for long-term data storage.
  • Simplicity and no 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):
    • salted and personalized BLAKE2b for hashing keyfiles and passphrases;
    • keyed BLAKE2b for message authentication.
  • Argon2 memory-hard function (RFC 9106) for key stretching and key derivation.
  • ChaCha20 cipher (RFC 7539) 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 with uniform random data (PURBs). 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).
  • ⚠️ 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:

$ tird

screenshot: MENU

Debug

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

$ 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.

Requirements

Install

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

$ pip install tird

Standalone executables (made with PyInstaller) are also available (see Releases).

tird.exe

TODO

Write documentation:

  • Features;
  • User guide;
  • Specification;
  • Design rationale.

Feedback

Feel free to post any questions, feedback or criticisms to the Discussions.

License

This project is licensed under the terms of the Creative Commons Zero v1.0 Universal License (Public Domain Dedication).

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

tird-0.11.0.tar.gz (17.4 kB view hashes)

Uploaded Source

Built Distribution

tird-0.11.0-py3-none-any.whl (14.7 kB view hashes)

Uploaded Python 3

Supported by

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