{ "info": { "author": "Dusan Klinec", "author_email": "dusan.klinec@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Security" ], "description": "Booltest\n========\n\n|Build Status|\n\nBoolean PRNG tester - analysing statistical properties of PRNGs.\n\nRandomness tester based on our paper published at `Secrypt\n2017 `__\n\nHow does it work?\n-----------------\n\nBooltest generates a set of boolean functions, computes the expected\nresult distribution when evaluated on truly random data and compares\nthis to the evaluation on the data being tested.\n\nPip installation\n----------------\n\nBooltest is available via ``pip``:\n\n::\n\n pip install booltest\n\nLocal installation\n------------------\n\nFrom the local dir:\n\n::\n\n pip install --upgrade --find-links=. .\n\nThe engine\n----------\n\nBooltest does the heavy lifting with the native python extension\n`bitarray\\_ph4 `__\n\nBitarray operations are performed effectively using fast operations\nimplemented in C.\n\nExperiments\n===========\n\nFirst launch\n------------\n\nThe following commands generate two different files, random and\nzero-filled. Both are tested, the difference between files should be\nevident.\n\n::\n\n dd if=/dev/urandom of=random-file.bin bs=1024 count=$((1024*10))\n dd if=/dev/zero of=zero-file.bin bs=1024 count=$((1024*10))\n\n booltest --degree 2 --block 256 --top 128 --tv $((1024*1024*10)) --rounds 0 random-file.bin\n booltest --degree 2 --block 256 --top 128 --tv $((1024*1024*10)) --rounds 0 zero-file.bin\n\nJava random\n-----------\n\nAnalyze output of the ``java.util.Random``, use only polynomials in the\nspecified file. Analyze 100 MB of data:\n\n::\n\n booltest --degree 2 --block 512 --top 128 --tv $((1024*1024*100)) --rounds 0 \\\n --poly-file data/polynomials/polynomials-randjava_seed0.txt \\\n randjava_seed0.bin\n\nReference statistics\n--------------------\n\nIn order to test reference statistics of the test we computed polynomial\ntests on input vectors generated by ``AES-CTR(SHA256(random_32bit()))``\n- considered as random data source. The ``randverif.py`` was used.\n\nThe first hypothesis to verify is the following: under null hypothesis\n(uniform input data), zscore test is input data size invariant. In other\nwords, the zscore result of the test is not influenced by amount of data\nprocessed.\n\nTo verify the first hypothesis we analyzed 1000 different test vectors\nof sizes 1 and 10 MB for various settings\n(``block \\in {128, 256} x deg \\in {1, 2, 3} x comb_deg \\in {1, 2, 3}``)\nand compared results. The test was performed with\n``assets/test-aes-size.sh``.\n\nSecond test is to determine reference zscore value for random data. For\nthis we performed 100 different tests on 10 MB AES input vectors in all\ntest combinations:\n``block \\in {128, 256, 384, 512} x deg \\in {1, 2, 3} x comb_deg \\in {1, 2, 3}``.\n\nAura testbed\n------------\n\nTestbed = battery of functions (e.g., ESTREAM, SHA3 candidates, ...)\ntested with various polynomial parameters (e.g.,\n``block \\in {128, 256, 384, 512} x deg \\in {1, 2, 3} x comb_deg \\in {1, 2, 3}``).\n\nEAcirc generator is invoked during the test to generate output from\nbattery functions. If switch ``--data-dir`` is used ``testbed.py`` will\ntry to look up output there first.\n\nIn order to start EACirc generator you may need to compile it on the\nmachine you want to test on. Instructions for compilation are on the\nbottom of the page. In order to invoke the generator you need to setup\nenv\n\n::\n\n module add mpc-0.8.2\n module add gmp-4.3.2\n module add mpfr-3.0.0\n module add cmake-3.6.2\n export PATH=~/local/gcc-5.2.0/bin:$PATH\n export LD_LIBRARY_PATH=~/local/gcc-5.2.0/lib:$LD_LIBRARY_PATH\n export LD_LIBRARY_PATH=~/local/gcc-5.2.0/lib64:$LD_LIBRARY_PATH\n\nIn order to start ``testbed.py`` there is a script\n``assets/aura-para.sh``. It performs the env setup, prepares\ndirectories, spawns multiple testing processes.\n\nParallelization is done in a simple way. Each test has an index. This\norder is randomized and each process from the batch takes the job that\nbelongs to him (e.g. 10 processes, process #5 takes each 5th job). If\nthe ordering is not favorable for in some way (e.g., one process is\ngetting too much heavy jobs - deg3, combdeg 3) just change the seed of\nthe test randomizer.\n\nResult of each test is stored in a separate file.\n\nStandard functions -> batteries\n-------------------------------\n\nThe goal of this experiment is to assess standard test batteries (e.g.,\nNIST, Dieharder, TestU01) how well they perform on the battery of round\nreduced functions (e.g., ESTREAM, SHA3 candidates, ...)\n\nFor the testing we use Randomness Testing Toolkit (RTT) from the EACirc\nproject. The ``testbatteries.py`` prepares data for functions to test\nand the main bash script that submits tests to RTT.\n\n::\n\n python booltest/testbatteries.py --email ph4r05@gmail.com --threads 3 \\\n --generator-path ~/eacirc/generator/generator \\\n --result-dir ~/_nni/home/ph4r05/testdata/ \\\n --data-dir ~/_nni/home/ph4r05/testdata/ \\\n --script-data /home/ph4r05/testdata \\\n --matrix-size 1 10 100 1000\n\nRandC\n-----\n\nTest found distinguishers on RandC for 1000 different random seeds:\n\n::\n\n python booltest/randverif.py --test-randc \\\n --block 384 --deg 2 \\\n --tv $((1024*1024*10)) --rounds 0 --tests 1000 \\\n --poly-file polynomials-randc-linux.txt \\\n > ~/output.txt\n\nIn order to generate CSV from the output:\n\n::\n\n python csvgen.py output.txt > data.csv\n\nJava tests - version\n====================\n\n::\n\n openjdk version \"1.8.0_121\"\n OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13)\n OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)\n Ubuntu 16.04.1 LTS (Xenial Xerus)\n\nEgenerator speed benchmark\n--------------------------\n\nTable summarizes function & time needed to generate 10 MB of data.\n\n+---------------+---------+------------------+\n| Function | Round | Time (sec) |\n+===============+=========+==================+\n| AES | 4 | 2.12984800339 |\n+---------------+---------+------------------+\n| ARIRANG | 4 | 9.43074584007 |\n+---------------+---------+------------------+\n| AURORA | 5 | 0.810596942902 |\n+---------------+---------+------------------+\n| BLAKE | 3 | 0.839290142059 |\n+---------------+---------+------------------+\n| Cheetah | 7 | 0.924134969711 |\n+---------------+---------+------------------+\n| CubeHash | 3 | 36.8423719406 |\n+---------------+---------+------------------+\n| DCH | 3 | 3.34326887131 |\n+---------------+---------+------------------+\n| DECIM | 7 | 51.946573019 |\n+---------------+---------+------------------+\n| DynamicSHA | 9 | 1.33032679558 |\n+---------------+---------+------------------+\n| DynamicSHA2 | 14 | 1.14816212654 |\n+---------------+---------+------------------+\n| ECHO | 4 | 2.15773296356 |\n+---------------+---------+------------------+\n| Fubuki | 4 | 1.81450080872 |\n+---------------+---------+------------------+\n| Grain | 4 | 67.9190270901 |\n+---------------+---------+------------------+\n| Grostl | 5 | 2.10276603699 |\n+---------------+---------+------------------+\n| Hamsi | 3 | 7.09616398811 |\n+---------------+---------+------------------+\n| Hermes | 3 | 1.46782112122 |\n+---------------+---------+------------------+\n| JH | 8 | 3.51690793037 |\n+---------------+---------+------------------+\n| Keccak | 4 | 1.31340193748 |\n+---------------+---------+------------------+\n| Lesamnta | 5 | 2.08995699883 |\n+---------------+---------+------------------+\n| LEX | 5 | 0.789785861969 |\n+---------------+---------+------------------+\n| Luffa | 8 | 2.70372700691 |\n+---------------+---------+------------------+\n| MD6 | 11 | 2.13406395912 |\n+---------------+---------+------------------+\n| Salsa20 | 4 | 0.845487833023 |\n+---------------+---------+------------------+\n| SIMD | 3 | 7.54037189484 |\n+---------------+---------+------------------+\n| Tangle | 25 | 1.43553209305 |\n+---------------+---------+------------------+\n| TEA | 8 | 0.981395959854 |\n+---------------+---------+------------------+\n| TSC-4 | 14 | 8.33323192596 |\n+---------------+---------+------------------+\n| Twister | 9 | 1.38356399536 |\n+---------------+---------+------------------+\n\nInstallation\n============\n\nScipy installation with pip\n---------------------------\n\n::\n\n pip install pyopenssl\n pip install pycrypto\n pip install git+https://github.com/scipy/scipy.git\n pip install --upgrade --find-links=. .\n\nVirtual environment\n-------------------\n\nIt is usually recommended to create a new python virtual environment for\nthe project:\n\n::\n\n virtualenv ~/pyenv\n source ~/pyenv/bin/activate\n pip install --upgrade pip\n pip install --upgrade --find-links=. .\n\nAura / Aisa on FI MU\n--------------------\n\n::\n\n module add cmake-3.6.2\n module add gcc-4.8.2\n\nPython 2.7.14\n-------------\n\nBooltest does not work with lower Python version. Use ``pyenv`` to\ninstall a new Python version. It internally downloads Python sources and\ninstalls it to ``~/.pyenv``.\n\n::\n\n git clone https://github.com/pyenv/pyenv.git ~/.pyenv\n echo 'export PYENV_ROOT=\"$HOME/.pyenv\"' >> ~/.bashrc\n echo 'export PATH=\"$PYENV_ROOT/bin:$PATH\"' >> ~/.bashrc\n echo 'eval \"$(pyenv init -)\"' >> ~/.bashrc\n exec $SHELL\n pyenv install 2.7.14\n pyenv local 2.7.14\n\nGCC 5.2\n-------\n\nInstalling a new GCC with C++ 11 support.\nhttp://bakeronit.com/2015/11/04/install\\_gcc/\n\n::\n\n wget http://ftp.gnu.org/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2\n tar -xjvf gcc-5.2.0.tar.bz2\n\n module add mpc-0.8.2\n module add gmp-4.3.2\n module add mpfr-3.0.0\n\n mkdir -p ~/local/gcc-5.2.0\n cd local\n mkdir gcc-build # objdir\n cd gcc-build\n ../../gcc-5.2.0/configure --prefix=~/local/gcc-5.2.0/ --enable-languages=c,c++,fortran,go --disable-multilib\n make -j4 # spend a long time\n make install\n\n # Add either to ~/.bashrc or just invoke on shell\n export PATH=~/local/gcc-5.2.0/bin:$PATH\n export LD_LIBRARY_PATH=~/local/gcc-5.2.0/lib:$LD_LIBRARY_PATH\n export LD_LIBRARY_PATH=~/local/gcc-5.2.0/lib64:$LD_LIBRARY_PATH\n\nCompiling EACirc generator on Aura/Aisa\n---------------------------------------\n\n::\n\n module add mpc-0.8.2\n module add gmp-4.3.2\n module add mpfr-3.0.0\n module add cmake-3.6.2\n export PATH=~/local/gcc-5.2.0/bin:$PATH\n export LD_LIBRARY_PATH=~/local/gcc-5.2.0/lib:$LD_LIBRARY_PATH\n export LD_LIBRARY_PATH=~/local/gcc-5.2.0/lib64:$LD_LIBRARY_PATH\n\n cd ~/eacirc\n mkdir -p build && cd build\n CC=gcc CXX=g++ cmake ..\n make\n\n.. |Build Status| image:: https://travis-ci.org/ph4r05/polynomial-distinguishers.svg?branch=master\n :target: https://travis-ci.org/ph4r05/polynomial-distinguishers\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ph4r05/polynomial-distinguishers", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "booltest", "package_url": "https://pypi.org/project/booltest/", "platform": "", "project_url": "https://pypi.org/project/booltest/", "project_urls": { "Homepage": "https://github.com/ph4r05/polynomial-distinguishers" }, "release_url": "https://pypi.org/project/booltest/0.2.0/", "requires_dist": [ "pycrypto (>=2.6.1)", "requests", "setuptools (>=1.0)", "six", "cmd2 (>=0.6.9)", "psutil", "pid (>=2.0.1)", "blessed (>=1.14.1)", "future", "coloredlogs", "scipy", "numpy", "bitstring", "bitarray-ph4", "ufx", "filelock", "repoze.lru", "py-cpuinfo", "nose; extra == 'dev'", "pep8; extra == 'dev'", "tox; extra == 'dev'", "Sphinx (>=1.0); extra == 'docs'", "sphinx-rtd-theme; extra == 'docs'", "sphinxcontrib-programoutput; extra == 'docs'" ], "requires_python": "", "summary": "Booltest: Polynomial randomness tester", "version": "0.2.0" }, "last_serial": 4444498, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b2c81b5363e9496d25ebd08ddfd6d8e4", "sha256": "4fb6f1079e39d42560efeab5f154474a17492bb19674d31f368ca8a38d692cb6" }, "downloads": -1, "filename": "booltest-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b2c81b5363e9496d25ebd08ddfd6d8e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 45811, "upload_time": "2017-11-11T17:59:26", "url": "https://files.pythonhosted.org/packages/21/68/b02e841f9a290c71f7e59fdc5bd46497bbbfd0fd12349cc5ef97a3482f8d/booltest-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "31589eaf335e223cda954afff5b2f62e", "sha256": "b58e2268c242211dcca250650385bc0d8b547a5e8ae8c483d5c4097d2c353ca4" }, "downloads": -1, "filename": "booltest-0.1.1.tar.gz", "has_sig": false, "md5_digest": "31589eaf335e223cda954afff5b2f62e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46481, "upload_time": "2017-11-11T18:48:14", "url": "https://files.pythonhosted.org/packages/1b/ae/3dcfd3b034ba5ed417ee764ab8e0f51c7eb387c8e7a24ec8d61902078bfa/booltest-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "0d0e7b6947d9dc7dc2ded68ffa083716", "sha256": "45278aebb360262bcd70a07f4545c91aa340f8c471f12ea660e92100da4b1a57" }, "downloads": -1, "filename": "booltest-0.1.2.tar.gz", "has_sig": false, "md5_digest": "0d0e7b6947d9dc7dc2ded68ffa083716", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46773, "upload_time": "2017-11-11T21:16:29", "url": "https://files.pythonhosted.org/packages/47/28/8eb659a3ee348a8f9ef328fe47cc2176a8b3f1472ef91749a9e7bdc51eca/booltest-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "90ca2a5e2daffa8ae09085622c41b538", "sha256": "db1bd96543829f14b97e89a69d2431544fe52e6e23973f87f9186cd71fc052d6" }, "downloads": -1, "filename": "booltest-0.2.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "90ca2a5e2daffa8ae09085622c41b538", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 73380, "upload_time": "2018-11-02T12:45:14", "url": "https://files.pythonhosted.org/packages/20/a0/0c196143bfde739a44ff9632fb9d5ae4156800e0fcc059104de8ee2d6e8a/booltest-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "da4e8b59f3d2d7360035fb15d2080de4", "sha256": "f731a1448c423b6728bb75be805eb1fc2bc998cbe57f0f544e961d1df2c7fc3e" }, "downloads": -1, "filename": "booltest-0.2.0.tar.gz", "has_sig": true, "md5_digest": "da4e8b59f3d2d7360035fb15d2080de4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 75161, "upload_time": "2018-11-02T12:45:16", "url": "https://files.pythonhosted.org/packages/cb/d8/869234853c8a54c9071b5cdcaab983af8940c5c5ae3fa68921a667c031df/booltest-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "90ca2a5e2daffa8ae09085622c41b538", "sha256": "db1bd96543829f14b97e89a69d2431544fe52e6e23973f87f9186cd71fc052d6" }, "downloads": -1, "filename": "booltest-0.2.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "90ca2a5e2daffa8ae09085622c41b538", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 73380, "upload_time": "2018-11-02T12:45:14", "url": "https://files.pythonhosted.org/packages/20/a0/0c196143bfde739a44ff9632fb9d5ae4156800e0fcc059104de8ee2d6e8a/booltest-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "da4e8b59f3d2d7360035fb15d2080de4", "sha256": "f731a1448c423b6728bb75be805eb1fc2bc998cbe57f0f544e961d1df2c7fc3e" }, "downloads": -1, "filename": "booltest-0.2.0.tar.gz", "has_sig": true, "md5_digest": "da4e8b59f3d2d7360035fb15d2080de4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 75161, "upload_time": "2018-11-02T12:45:16", "url": "https://files.pythonhosted.org/packages/cb/d8/869234853c8a54c9071b5cdcaab983af8940c5c5ae3fa68921a667c031df/booltest-0.2.0.tar.gz" } ] }