Package: cotary
cotaryCotary allows you to prove that you have a document without releasing it.MotivationThe following scenario describes the motivation for this simple tool:
Alice as an idea that she wants to use; either by publishing it in an article or paper or using it in a product. But she needs help; so she asks Bob to collaborate with her. Alice's idea is so good, though, that she is afraid that Bob will steal the idea from her and not involve her.To counter this, she needs proof that she had the idea first; but without releasing the idea to the public yet. So she writes a simple draft of her ideas including all important ingredients, calculates a cryptographic hashH(d)of this documentdand stores the document it in a safe place. Before talking to Bob, she publishes the hash. SinceHis one-way, her ideas are still safe.In case Bob tries to use Alice's ideas without her approval, she can at a later stage release the documentdto the world. Since everyone can check that her previously published hashH(d)belongs to the document, she now proved that she had the ideas in the document before talking to Bob.Cotary(code notary) makes this process for Alice very easy. Simply executecotaryon a file and it will publish a cryptographically secure hash on your Twitter account. This tweet with a timestamp and the hash proves you had the file at time of publishing.This shows averysimple use case of hash functions and how to use them in practice.Installationcotary currently only support python3. python2 is not supported. Thus, make sure you usepipfor your python3 environment; sometime it is calledpip3. On some systems, the python3 executable is calledpython3instead ofpython. In those cases, you can usepython3 -m pipinstead of just callingpipto make sure you have the right version.Installation from PyPIcotary isavailable on PyPIso installation is very easy using pip:Make sure you havepip installedfor your python3 environment.$ python3 -m pip install --user cotaryOmit--userto install it system-wide.Now, thecotaryexecutable should be in your PATH and ready to use.Installation from sourcePip can be used to install from source, as well. Thesetup.pyfile contains everything pip needs to know, so you can install your local copy of the source easily:Make sure you havepip installedfor your python3 environment.$ python3 -m pip install --user .Omit--userto install it system-wide.Now, thecotaryexecutable should be in your PATH and ready to use.ConfigurationConfiguration of Twitter APIs is done using a yaml config file.
At the moment, these are the options. Default config file is in~/.config/cotary/config.yaml.twitter:message:'Iownafilewithchecksum{checksum}(cotary)'# The following are twitter API keys. Get them from https://dev.twitter.com/appsconsumer:key:nullsecret:nullaccess_token:key:nullsecret:nullUsageusage: cotary [-h] [-c] [--config [CONFIG]] [-q] [file]

Publish the checksum of a file on Twitter.

positional arguments:
  file               File for which to publish checksum. If none is given,
                     read from stdin

optional arguments:
  -h, --help         show this help message and exit
  -c, --calc_only    Only calculate and print the checksum, do not publish it
  --config [CONFIG]  Use given config instead of ~/.local/cotary/config.yaml
  -q, --quiet        Do not print any messagesExample$ cotary README.md 
checksum: openssl_sha256:66ca5ae6f1f3760ad7258cc1d1e906ec8853a0e4da2b2de42f55036cffe8f8a2
Status published at 2019-01-16 15:18:38Leads to this Twitter message: