{ "info": { "author": "Manolo Ramirez T.", "author_email": "manologab@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Security :: Cryptography", "Topic :: System :: Operating System Kernels :: Linux" ], "description": "Python ifalg\n==============\n\n**ifalg** is a Python 3 library to interface with the Linux kernel crypto API.\nThis is generally slower than using a library like OpenSSL or PyCrypto,\nbut it could be useful if you have cryptographic hardware supported by Linux.\n\nFeatures\n========\n\n* For the moment only *skcipher* and *hash* algorithms are supported.\n* Algorithm metadata is parsed from */proc/crypto*\n\nInstallation\n============\n\n*ifalg* should work on any Linux distribution with a modern kernel, in order to use this tool you need to have the folowing options enabled on the kernel:\n\n* CONFIG_CRYPTO_USER_API\n* CONFIG_CRYPTO_USER_API_HASH\n* CONFIG_CRYPTO_USER_API_SKCIPHER\n\nTo install just use pip::\n\n pip install ifalg\n\nSamples\n=======\n\nUsing a hash algorithm::\n\n >>> from ifalg import Hash\n >>> hash = Hash('sha1')\n >>> hash.hexdigest(b'hello world')\n '2aae6c35c94fcfb415dbe95f408b9ce91ee846ed'\n\nUsing a keyed hash algorithm::\n\n >>> from ifalg import Hash\n >>> hash = Hash('cmac(des3_ede)', key=bytes.fromhex('8aa83bf8cbda10620bc1bf19fbb6cd58bc313d4a371ca8b5'))\n >>> hash.hexdigest(bytes.fromhex('6bc1bee22e409f96'))\n '8e8f293136283797'\n\nEncryption and Decryption::\n\n >>> from ifalg import SKCipher\n >>> cipher = SKCipher('cbc(aes)', key=bytes.fromhex('790afba9cfbc095b682666a6999a38ed'), iv=bytes.fromhex('fb1f88c0f23d6aa6dde475c018d7f482'))\n >>> msg = bytes.fromhex('4e0c74c8d67862a9732604f62f4ad316')\n >>> cipherText = cipher.encrypt(msg)\n >>> cipherText\n b'\\x7ftT$Z\\xf4\\xe6|\\xd2)cA\\xf2\\x1d\\xcb\\xa9'\n >>> plainText = cipher.decrypt(cipherText)\n >>> plainText\n b'N\\x0ct\\xc8\\xd6xb\\xa9s&\\x04\\xf6/J\\xd3\\x16'\n >>> plainText == msg\n True\n\nStreaming encryption and decryption::\n\n >>> from ifalg import SKCipherStream\n >>> stream = SKCipherStream('cbc(aes)', key=bytes.fromhex('790afba9cfbc095b682666a6999a38ed'), iv=bytes.fromhex('fb1f88c0f23d6aa6dde475c018d7f482'))\n >>> stream.write(b'0123456789abcdef0123456789abcdef')\n 32\n >>> cipherText = stream.read(32)\n\n\n\nAuthor\n======\n\nManolo Ramirez T manologab@gmail.com\n\nContact\n=======\n\nFor any thoughts about this software, please contact me at manologab@gmail.com.\n\nIf you find a bug or have any idea to improve this tool, please use Github's `issues `.\n\nLicense\n=======\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Manolo Ramirez T.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/manologab/python-ifalg", "keywords": "linux crypto AF_ALG if_alg", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "ifalg", "package_url": "https://pypi.org/project/ifalg/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ifalg/", "project_urls": { "Homepage": "https://github.com/manologab/python-ifalg" }, "release_url": "https://pypi.org/project/ifalg/0.2/", "requires_dist": null, "requires_python": null, "summary": "Library to interface with the Linux kernel crypto API", "version": "0.2" }, "last_serial": 1546343, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "08b9de3ba1c5be68b7b1642f48dd5084", "sha256": "d71e8c5ea6f669f117e8680484f8bb96dedb8edee0f0cb0e5dc81c4151e8fa55" }, "downloads": -1, "filename": "ifalg-0.1.tar.gz", "has_sig": false, "md5_digest": "08b9de3ba1c5be68b7b1642f48dd5084", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7266, "upload_time": "2015-04-11T21:21:23", "url": "https://files.pythonhosted.org/packages/59/3e/12b50046f67e3558ccbe6915be884d27069ddaee29ca11c433179fb914ed/ifalg-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "c0f7e7e630c06014331f9ecfb995b768", "sha256": "b4dcdfd5d1344a56f3f5a7964fa9f7b2ef8c20d40b85795999b67509edd6e72b" }, "downloads": -1, "filename": "ifalg-0.2.tar.gz", "has_sig": true, "md5_digest": "c0f7e7e630c06014331f9ecfb995b768", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10816, "upload_time": "2015-05-13T23:49:04", "url": "https://files.pythonhosted.org/packages/d0/23/b3fb415d8a0061bd8ee9d497a11e1e1acacbd3136593d443b9972d92a1aa/ifalg-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c0f7e7e630c06014331f9ecfb995b768", "sha256": "b4dcdfd5d1344a56f3f5a7964fa9f7b2ef8c20d40b85795999b67509edd6e72b" }, "downloads": -1, "filename": "ifalg-0.2.tar.gz", "has_sig": true, "md5_digest": "c0f7e7e630c06014331f9ecfb995b768", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10816, "upload_time": "2015-05-13T23:49:04", "url": "https://files.pythonhosted.org/packages/d0/23/b3fb415d8a0061bd8ee9d497a11e1e1acacbd3136593d443b9972d92a1aa/ifalg-0.2.tar.gz" } ] }