{ "info": { "author": "Sundar Nagarajan", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "poly1305\\_aes\n=============\n\nPython extension module wrapping poly1305aes by Daniel Bernstein\n\nThis module is a simple wrapper around the poly1305aes HMAC algorithm by\nDaniel J. Bernstein (http://cr.yp.to/mac.html)\n\nWhat is a HMAC (Hash-based Message Authentication Code)?\n--------------------------------------------------------\n\nFrom wikipedia\n(https://en.wikipedia.org/wiki/Hash-based_message_authentication_code):\n\nIn cryptography, a keyed-hash message authentication code (HMAC) is a\nspecific construction for calculating a message authentication code\n(MAC) involving a cryptographic hash function in combination with a\nsecret cryptographic key. As with any MAC, it may be used to\nsimultaneously verify both the data integrity and the authentication of\na message. Any cryptographic hash function, such as MD5 or SHA-1, may be\nused in the calculation of an HMAC; the resulting MAC algorithm is\ntermed HMAC-MD5 or HMAC-SHA1 accordingly. The cryptographic strength of\nthe HMAC depends upon the cryptographic strength of the underlying hash\nfunction, the size of its hash output, and on the size and quality of\nthe key.\n\nWhat is poly1305?\n-----------------\n\nFrom http://cr.yp.to/mac.html:\n\nPoly1305-AES is a state-of-the-art secret-key message-authentication\ncode suitable for a wide variety of applications. Poly1305-AES computes\na 16-byte authenticator of a message of any length, using a 16-byte\nnonce (unique message number) and a 32-byte secret key. Attackers can't\nmodify or forge messages if the message sender transmits an\nauthenticator along with each message and the message receiver checks\neach authenticator.\n\nPoly1305-AES has several useful features:\n\n- Guaranteed security if AES is secure. There's a theorem guaranteeing\n that the security gap is extremely small (n/2^(102) per forgery\n attempt for 16n-byte messages) even for long-term keys (2^64\n messages). The only way for an attacker to break Poly1305-AES is to\n break AES.\n- Cipher replaceability. If anything does go wrong with AES, users can\n switch from Poly1305-AES to Poly1305-AnotherFunction, with an\n identical security guarantee.\n- Extremely high speed. My Poly1305-AES software takes just 3843 Athlon\n cycles, 5361 Pentium III cycles, 5464 Pentium 4 cycles, 4611 Pentium\n M cycles, 8464 PowerPC 7410 cycles, 5905 PowerPC RS64 IV cycles, 5118\n UltraSPARC II cycles, or 5601 UltraSPARC III cycles to verify an\n authenticator on a 1024-byte message. Poly1305-AES offers consistent\n high speed, not just high speed for one favored CPU.\n- Low per-message overhead. My Poly1305-AES software takes just 1232\n Pentium 4 cycles, 1264 PowerPC 7410 cycles, or 1077 UltraSPARC III\n cycles to verify an authenticator on a 64-byte message. Poly1305-AES\n offers consistent high speed, not just high speed for long messages.\n Most competing functions are designed for long messages and don't pay\n attention to short-packet performance.\n- Key agility. Poly1305-AES can fit thousands of simultaneous keys into\n cache, and remains fast even when keys are out of cache. Poly1305-AES\n offers consistent high speed, not just high speed for single-key\n benchmarks. Almost all competing functions use a large table for each\n key; as the number of keys grows, those functions miss the cache and\n slow down dramatically.\n- Parallelizability and incrementality. Poly1305-AES can take advantage\n of additional hardware to reduce the latency for long messages, and\n can be recomputed at low cost for a small modification of a long\n message.\n- No intellectual-property claims. I am not aware of any patents or\n patent applications relevant to Poly1305-AES.\n- Guaranteed security, cipher replaceability, and parallelizability are\n provided by the standard polynomial-evaluation Wegman-Carter-MAC\n framework. Within that framework, hash127-AES achieved extremely high\n speed at the expense of a large table for each key.\n- The big advantage of Poly1305-AES is key agility: extremely high\n speed without any key expansion. Other standard MACs are slower and\n less secure than Poly1305-AES. Specifically, HMAC-MD5 is slower and\n doesn't have a comparable security guarantee; CBC-MAC-AES is much\n slower and has a weaker security guarantee. Both HMAC-MD5 and\n CBC-MAC-AES are breakable within 2^64 messages.\n\nLICENSE:\n========\n\nFollowing D.J. Bernstein's code license, this code is also released into\nthe public domain. See LICENSE file.\n\nThe 'c' directory contains the unmodified source code for poly1305aes\nfrom https://cr.yp.to/mac/poly1305aes-20050218.tar.gz.\n\nEXAMPLES:\n=========\n\n::\n\n from poly1305_aes import (\n get_key, authenticate, verify\n )\n msg = 'Hello world'\n kr = get_key()\n auth = authenticate(kr, msg)\n\n bad_kr = get_key()\n bad_auth = authenticate(kr, msg + '1')\n bad_msg = msg + '1'\n\n print('Good: %s\\nBad auth: %s\\nBad kr: %s\\nBad msg: %s' % (\n str(verify(auth, kr, msg)),\n str(verify(bad_auth, kr, msg)),\n str(verify(auth, bad_kr, msg)),\n str(verify(auth, kr, bad_msg))\n ))\n\nAlternately, run the test script that is shipped:\n\n::\n\n python -m poly1305_aes.test\n\nTo run a simple benchmark:\n\n::\n\n python -m poly1305_aes.benchmark\n\nINSTALLATION:\n=============\n\nUsing pip:\n\n::\n\n pip install 'git+https://github.com/sundarnagarajan/py_poly1305aes.git'\n\nUsing setup.py:\n\n::\n\n python setup.py install\n\nBUILD / INSTALL REQUIREMENTS:\n=============================\n\n*GNU/Linux:*\n\n- Python: Tested on 2.7.6, 3.4.3, pypy 2.7.10 (pypy 4.0.1)\n- cffi >= 1.0.0\n- six - Python.h (libpython-dev on Debian-like systems)\n- gcc (build-essential on Debian-like systems)\n\nTODO:\n=====\n\nDan Bernsteins code contains optimizations for:\n\n- x86 (Intel)\n- x86 (Pentium Pro)\n- x86 (Athlon)\n- UltraSparc II and III\n- PowerPC, PPC64\n\nMy code only supports generic x86. To support the additional platforms\nwill require:\n\n- Detect CPU type accurately\n- Change c\\_src\\_files in setup.py based on CPU type\n- Change c\\_hdr in poly1305\\_aes.poly1305.py based on CPU type\n- Change get\\_key(), authenticate() and verify() to call different\n functions in shared\n- Test on the different CPUs (I only have access to x86!)", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/sundarnagarajan/py_poly1305aes.git/tree/0.13.39", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sundarnagarajan/py_poly1305aes.git", "keywords": null, "license": "License :: OSI Approved :: MIT License", "maintainer": null, "maintainer_email": null, "name": "poly1305_aes", "package_url": "https://pypi.org/project/poly1305_aes/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/poly1305_aes/", "project_urls": { "Download": "https://github.com/sundarnagarajan/py_poly1305aes.git/tree/0.13.39", "Homepage": "https://github.com/sundarnagarajan/py_poly1305aes.git" }, "release_url": "https://pypi.org/project/poly1305_aes/0.13.39/", "requires_dist": null, "requires_python": null, "summary": "Python wrapper for Poly1305aes HMAC", "version": "0.13.39" }, "last_serial": 2339118, "releases": { "0.13.37": [ { "comment_text": "", "digests": { "md5": "95effdf9b23ad543f3dc6b92c72a9482", "sha256": "aa3d0fadee057c3d152c02e17a6a10a1b49194277d57dbf41efc96dc3313173f" }, "downloads": -1, "filename": "poly1305_aes-0.13.37.tar.gz", "has_sig": false, "md5_digest": "95effdf9b23ad543f3dc6b92c72a9482", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 216195, "upload_time": "2016-03-26T21:01:11", "url": "https://files.pythonhosted.org/packages/63/a1/20e6fcf2d0c46b45623725edeee55423a292e8a1aece1e1fd6ca7f561ee6/poly1305_aes-0.13.37.tar.gz" } ], "0.13.38": [ { "comment_text": "", "digests": { "md5": "6f1fd3b0c04c3b36798464015e7de3f0", "sha256": "247e111556b8d6284dae462784aaef438a3524fcffda50a46328c0b099413a95" }, "downloads": -1, "filename": "poly1305_aes-0.13.38.tar.gz", "has_sig": false, "md5_digest": "6f1fd3b0c04c3b36798464015e7de3f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 216657, "upload_time": "2016-03-27T01:25:21", "url": "https://files.pythonhosted.org/packages/b1/7f/ea87cc650bdd591b611c3c45006fa90538590cf21f37799151dc769d0711/poly1305_aes-0.13.38.tar.gz" } ], "0.13.39": [ { "comment_text": "", "digests": { "md5": "413ceafb61f2b884398f6b7ae09bc8eb", "sha256": "677933c1ec7ed8148a3193b9f8b2a9d330b11a9a58f4ead208025c36dcbc04dc" }, "downloads": -1, "filename": "poly1305_aes-0.13.39.tar.gz", "has_sig": false, "md5_digest": "413ceafb61f2b884398f6b7ae09bc8eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 216579, "upload_time": "2016-09-12T23:05:54", "url": "https://files.pythonhosted.org/packages/c4/e2/7377038b17467e026deb2017654cb4fb0a1991405604c2c8dc8be317b56f/poly1305_aes-0.13.39.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "413ceafb61f2b884398f6b7ae09bc8eb", "sha256": "677933c1ec7ed8148a3193b9f8b2a9d330b11a9a58f4ead208025c36dcbc04dc" }, "downloads": -1, "filename": "poly1305_aes-0.13.39.tar.gz", "has_sig": false, "md5_digest": "413ceafb61f2b884398f6b7ae09bc8eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 216579, "upload_time": "2016-09-12T23:05:54", "url": "https://files.pythonhosted.org/packages/c4/e2/7377038b17467e026deb2017654cb4fb0a1991405604c2c8dc8be317b56f/poly1305_aes-0.13.39.tar.gz" } ] }