1
0
mirror of synced 2024-11-24 18:24:23 +01:00
mat2 is a metadata removal tool, supporting a wide range of commonly used file formats, written in python3: at its core, it's a library, used by an eponymous command-line interface, and a nautilus extension.
Go to file
2019-11-25 21:56:24 +01:00
data Update logo 2018-10-05 11:13:31 +02:00
doc doc/threat_model: this is about mat2, not mat 2019-07-10 14:36:47 +00:00
dolphin Add an integration with Dolphin 2019-11-25 21:56:24 +01:00
libmat2 Improve a bit the support for ppt files 2019-10-17 23:02:17 +02:00
nautilus Nautilus: Add note that distribution packages ship the extension 2019-07-14 23:07:36 +00:00
tests Copy file permissions 2019-10-13 11:54:47 +02:00
utils/ci/codespell CI: Add job to run codespell, a spell checking software 2019-07-22 13:31:40 -07:00
.gitignore gitignore: exclude all hidden files from being committed 2018-08-24 09:14:05 +02:00
.gitlab-ci.yml Mount a new tmpfs on /tmp and drop all capabilities 2019-10-05 15:21:40 +02:00
.mailmap Add a .mailmap file 2018-09-01 16:12:03 +02:00
.pylintrc Implement lightweight cleaning for png and tiff 2018-10-23 16:22:11 +02:00
CHANGELOG.md Bump the changelog 2019-05-10 22:16:38 +02:00
CONTRIBUTING.md doing a release: this is about mat2, not mat 2019-03-07 12:00:58 +00:00
INSTALL.md INSTALL: Update Debian package status 2019-07-13 14:29:55 -07:00
LICENSE Add LICENSE 2018-03-31 07:00:14 -07:00
mat2 Fix a stacktrace in ./mat2 when the file can't be cleaned 2019-10-17 22:51:00 +02:00
README.md Add a test for nsid cleaning 2019-09-01 13:52:02 +02:00
setup.py Bump the changelog 2019-05-10 22:16:38 +02:00

 _____ _____ _____ ___
|     |  _  |_   _|_  |  Keep your data,
| | | |     | | | |  _|     trash your meta!
|_|_|_|__|__| |_| |___|

This software is currently in beta, please don't use it for anything critical.

Metadata and privacy

Metadata consist of information that characterizes data. Metadata are used to provide documentation for data products. In essence, metadata answer who, what, when, where, why, and how about every facet of the data that are being documented.

Metadata within a file can tell a lot about you. Cameras record data about when a picture was taken and what camera was used. Office documents like PDF or Office automatically adds author and company information to documents and spreadsheets. Maybe you don't want to disclose those information.

This is precisely the job of MAT2: getting rid, as much as possible, of metadata.

MAT2 provides both a command line tool, and a graphical user interface via an extension for Nautilus, the default file manager of GNOME.

Requirements

  • python3-mutagen for audio support
  • python3-gi-cairo and gir1.2-poppler-0.18 for PDF support
  • gir1.2-gdkpixbuf-2.0 for images support
  • gir1.2-rsvg-2.0 for svg support
  • FFmpeg, optionally, for video support
  • libimage-exiftool-perl for everything else
  • bubblewrap, optionally, for sandboxing

Please note that MAT2 requires at least Python3.5.

Running the test suite

$ python3 -m unittest discover -v

And if you want to see the coverage:

$ python3-coverage run --branch -m unittest discover -s tests/
$ python3-coverage report --include -m --include /libmat2/*'

How to use MAT2

usage: mat2 [-h] [-v] [-l] [--check-dependencies] [-V]
            [--unknown-members policy] [-s | -L]
            [files [files ...]]

Metadata anonymisation toolkit 2

positional arguments:
  files                 the files to process

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -l, --list            list all supported fileformats
  --check-dependencies  check if MAT2 has all the dependencies it needs
  -V, --verbose         show more verbose status information
  --unknown-members policy
                        how to handle unknown members of archive-style files
                        (policy should be one of: abort, omit, keep) [Default:
                        abort]
  -s, --show            list harmful metadata detectable by MAT2 without
                        removing them
  -L, --lightweight     remove SOME metadata

Note that MAT2 will not clean files in-place, but will produce, for example, with a file named "myfile.png" a cleaned version named "myfile.cleaned.png".

Notes about detecting metadata

While MAT2 is doing its very best to display metadata when the --show flag is passed, it doesn't mean that a file is clean from any metadata if MAT2 doesn't show any. There is no reliable way to detect every single possible metadata for complex file formats.

This is why you shouldn't rely on metadata's presence to decide if your file must be cleaned or not.

Notes about the lightweight mode

By default, mat2 might alter a bit the data of your files, in order to remove as much metadata as possible. For example, texts in PDF might not be selectable anymore, compressed images might get compressed again, … Since some users might be willing to trade some metadata's presence in exchange of the guarantee that mat2 won't modify the data of their files, there is the -L flag that precisely does that.

Related software

Contact

If possible, use the issues system or the mailing list Should a more private contact be needed (eg. for reporting security issues), you can email Julien (jvoisin) Voisin at julien.voisin+mat2@dustri.org, using the gpg key 9FCDEE9E1A381F311EA62A7404D041E8171901CC.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Copyright 2018 Julien (jvoisin) Voisin julien.voisin+mat2@dustri.org Copyright 2016 Marie Rose for MAT2's logo

The tests/data/dirty_with_nsid.docx file is licensed under GPLv3, and was borrowed from the Calibre project: https://calibre-ebook.com/downloads/demos/demo.docx

Thanks

MAT2 wouldn't exist without:

Many thanks to them!