{ "info": { "author": "Tim Gabets", "author_email": "tim@gabets.ru", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Communications" ], "description": "# pythales\n\n\nA primitive implementation of [Thales HSM](https://en.wikipedia.org/wiki/Hardware_security_module) hardware security module) simulator. Only the basic (the most popular) HSM commands are implemented:\n\n- A0 - Generate a Key\n- BU - Generate a Key check value \n- CA - Translate PIN from TPK to ZPK \n- CY - Verify CVV/CSC\n- DC - Verify PIN\n- EC - Verify an Interchange PIN using ABA PVV method\n- FA - Translate a ZPK from ZMK to LMK\n- HC - Generate a TMK, TPK or PVK\n- NC - Diagnostics information\n\n## Installation\n\nInstall git and python3:\n```bash\napt-get install git python3 python3-pip\n```\n\nSetup virtual environment for python3 (check the [Manual](https://virtualenvwrapper.readthedocs.io/en/latest/)):\n```bash\nmkvirtualenv pyenv -p /usr/bin/python3\nworkon pyenv\n```\n\nCheck out the code and install requirements:\n```bash\ngit clone https://github.com/timgabets/pythales\ncd pythales\nworkon pyenv\npip3 install -r requirements.txt\n```\n \nRun:\n```bash\ncd examples/\n./hsm_server.py --help # check the options\n./hsm_server.py -h SSSS -d --skip-parity\n```\n\nOutput example:\n```\n# ./hsm_server.py -h SSSS -d --skip-parity\n LMK: DEAFBEEDEAFBEEDEAFBEEDEAFBEEDEAF\n Firmware version: 0007-E000\n Message header: SSSS\n Listening on port 1500\n Connected client: 192.168.56.101:50010\n 17:59:49.278803 << 8 bytes received from 192.168.56.101:50010: \n\t00 06 53 53 53 53 4e 43 ..SSSSNC\n 17:59:49.279338 >> 35 bytes sent to 192.168.56.101:50010:\n \t00 21 53 53 53 53 4e 44 30 30 46 34 45 44 43 38 .!SSSSND00F4EDC8\n \t44 45 42 36 37 46 36 45 32 38 30 30 30 37 2d 45 DEB67F6E280007-E\n\t30 30 30 000\n\t[Response Code ]: [ND]\n\t[Error Code ]: [00]\n\t[LMK Check Value ]: [F4EDC8DEB67F6E28]\n\t[Firmware Version]: [0007-E000]\n 18:01:13.089485 << 108 bytes received from 192.168.56.101:50010: \n\t00 6a 53 53 53 53 44 43 55 43 34 45 44 35 39 37 .jSSSSDCUC4ED597\n\t45 45 30 43 39 36 39 37 31 30 34 45 44 33 39 39 EE0C9697104ED399\n\t42 45 36 46 38 42 38 37 32 37 33 33 36 44 35 30 BE6F8B8727336D50\n\t43 34 37 31 32 38 44 37 31 30 44 46 34 35 30 42 C47128D710DF450B\n\t43 42 32 43 36 34 36 31 42 37 39 33 41 45 36 32 CB2C6461B793AE62\n\t44 46 43 38 44 32 34 32 36 30 31 34 30 37 30 30 DFC8D24260140700\n\t30 30 30 30 30 31 30 31 33 38 34 33 000001013843\t\n\t[TPK ]: [UC4ED597EE0C9697104ED399BE6F8B872]\n\t[PVK Pair ]: [7336D50C47128D710DF450BCB2C6461B]\n\t[PIN block ]: [793AE62DFC8D2426]\n\t[PIN block format code]: [01]\n\t[Account Number ]: [407000000010]\n\t[PVKI ]: [1]\n\t[PVV ]: [3843]\n\tDEBUG: Decrypted pinblock: 0412748FFFFFFFEF\n 18:01:13.090230 >> 10 bytes sent to 192.168.56.101:50010:\n\t00 08 53 53 53 53 44 44 30 30 ..SSSSDD00\n\t[Response Code]: [DD]\n\t[Error Code ]: [00]\n 18:01:13.104389 << 68 bytes received from 192.168.56.101:50010: \n\t00 42 53 53 53 53 43 59 55 31 43 31 45 42 31 30 .BSSSSCYU1C1EB10\n\t39 30 36 38 31 43 43 39 45 36 30 30 33 45 30 35 90681CC9E6003E05\n\t32 31 37 43 37 30 37 37 45 36 34 30 34 31 37 34 217C7077E6404174\n\t30 37 30 30 30 30 30 30 30 31 30 34 3b 31 37 31 070000000104;171\n\t32 32 30 31 2201\n\t[CVK ]: [U1C1EB1090681CC9E6003E05217C7077E]\n\t[CVV ]: [640]\n\t[Primary Account Number]: [4174070000000104]\n\t[Expiration Date ]: [1712]\n\t[Service Code ]: [201]\n 18:01:13.104979 >> 10 bytes sent to 192.168.56.101:50010:\n\t00 08 53 53 53 53 43 5a 30 30 ..SSSSCZ00\n\t[Response Code]: [CZ]\n\t[Error Code ]: [00]\n```\n\nYou may also check [examples](https://github.com/timgabets/pythales/tree/master/examples) for more sophisticated HSM server implementation with some features like command line options parsing etc. The application works as server that may simultaneously serve only one connected client.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/timgabets/pythales", "keywords": "thales hsm", "license": "LGPLv2", "maintainer": "", "maintainer_email": "", "name": "pythales", "package_url": "https://pypi.org/project/pythales/", "platform": "", "project_url": "https://pypi.org/project/pythales/", "project_urls": { "Homepage": "https://github.com/timgabets/pythales" }, "release_url": "https://pypi.org/project/pythales/0.74/", "requires_dist": null, "requires_python": "", "summary": "python thales hsm simulator", "version": "0.74" }, "last_serial": 3376667, "releases": { "0.20": [ { "comment_text": "", "digests": { "md5": "1a4a2c1870b98e2d10bf255097ae486e", "sha256": "b86dd23a06517fa6540da03b9a21d4f88c71400219f6d8cf6fcb8e144563ca6e" }, "downloads": -1, "filename": "pythales-0.20.tar.gz", "has_sig": false, "md5_digest": "1a4a2c1870b98e2d10bf255097ae486e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12557, "upload_time": "2017-05-12T06:31:31", "url": "https://files.pythonhosted.org/packages/14/e2/2d392e342c5d57f58bbd653846dda2dd0966175c8b51fcc59d00b324c74c/pythales-0.20.tar.gz" } ], "0.25": [ { "comment_text": "", "digests": { "md5": "62fa4e98e76adc96b045f3da8a16fb3c", "sha256": "5533170bd9ec133afc7751ffe2746d54ad8ca184b1800e652dc5acf950f03866" }, "downloads": -1, "filename": "pythales-0.25.tar.gz", "has_sig": false, "md5_digest": "62fa4e98e76adc96b045f3da8a16fb3c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14270, "upload_time": "2017-05-12T16:24:22", "url": "https://files.pythonhosted.org/packages/07/1b/84dacc17014b5fd7db6224afe29a095695ae6d72764056e079965cfb8f0d/pythales-0.25.tar.gz" } ], "0.32": [ { "comment_text": "", "digests": { "md5": "c9bfd620064cfac4ca8e298f5da1910b", "sha256": "34dfba8efa6d309e88caed075f973ac6920a38a7b173263f929cae824a7db968" }, "downloads": -1, "filename": "pythales-0.32.tar.gz", "has_sig": false, "md5_digest": "c9bfd620064cfac4ca8e298f5da1910b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15496, "upload_time": "2017-05-15T15:21:34", "url": "https://files.pythonhosted.org/packages/a9/97/6bdd05b4c6666e0b5a3c0c92e4a74935c1e2d5db340802fc464de3f1df65/pythales-0.32.tar.gz" } ], "0.37": [ { "comment_text": "", "digests": { "md5": "793fec753bb28956f768e86632186cf4", "sha256": "5c0627e1ab2da0fd7196d3e7f0c83f44a5d204cf54a8e8cfe9e183845ae0ed99" }, "downloads": -1, "filename": "pythales-0.37.tar.gz", "has_sig": false, "md5_digest": "793fec753bb28956f768e86632186cf4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16751, "upload_time": "2017-05-16T08:24:14", "url": "https://files.pythonhosted.org/packages/90/af/52935b3177236a263311b4800ba9db8ef7beae8b0856dfaef60f89e59e6c/pythales-0.37.tar.gz" } ], "0.50": [ { "comment_text": "", "digests": { "md5": "0697e2ebb02446715ac70f5f7e2c6746", "sha256": "a0517166eb8046dc3e20717e78cd36fdab5ec7611ca3b59f3095c9f4ec759dc4" }, "downloads": -1, "filename": "pythales-0.50.tar.gz", "has_sig": false, "md5_digest": "0697e2ebb02446715ac70f5f7e2c6746", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17587, "upload_time": "2017-05-19T13:24:29", "url": "https://files.pythonhosted.org/packages/85/22/28c8b432f6bb74d5859f2dbf453b7082539bd85d39c0e3f4b47016295cce/pythales-0.50.tar.gz" } ], "0.52": [ { "comment_text": "", "digests": { "md5": "fefc2968141ee3c0d72c82237503952c", "sha256": "0023854eda2b33eee2740f5e1a9c355af72746a07bb433918a9c906a6326f536" }, "downloads": -1, "filename": "pythales-0.52.tar.gz", "has_sig": false, "md5_digest": "fefc2968141ee3c0d72c82237503952c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18259, "upload_time": "2017-05-22T11:51:12", "url": "https://files.pythonhosted.org/packages/2e/f7/f2adb7f237dee04cd0c6964028c8d54d7ae0704b71bb36da0085d68a2398/pythales-0.52.tar.gz" } ], "0.54": [ { "comment_text": "", "digests": { "md5": "1fabe0e43783aa3fc58786ccaa9f1f1c", "sha256": "3ba5dfb092607ea1c4ee862351e8d0225e93f6f2f1e4279e96cb8de26607d324" }, "downloads": -1, "filename": "pythales-0.54.tar.gz", "has_sig": false, "md5_digest": "1fabe0e43783aa3fc58786ccaa9f1f1c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18720, "upload_time": "2017-05-22T14:52:46", "url": "https://files.pythonhosted.org/packages/cb/2e/540d501fb03d3ea02dc9f69869dab287dc7d6d3df66c830b1a0ed69cbc3a/pythales-0.54.tar.gz" } ], "0.55": [ { "comment_text": "", "digests": { "md5": "3fc91bcce65b622496339f678d4a85e0", "sha256": "6bb2189344345280be309ce3bc72d936a5bded9757ae79b481499a8542894650" }, "downloads": -1, "filename": "pythales-0.55.tar.gz", "has_sig": false, "md5_digest": "3fc91bcce65b622496339f678d4a85e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21163, "upload_time": "2017-05-22T15:11:38", "url": "https://files.pythonhosted.org/packages/ac/e6/4ff51022c7262b55f0e15b77e89296c41acd3b66086f665ebdc08458aaab/pythales-0.55.tar.gz" } ], "0.56": [ { "comment_text": "", "digests": { "md5": "778694eedb82b1649a534dd4f3ff37ed", "sha256": "216a78f2fe32a88e3ef2092f36ddd1d3509160dedec2c1fa2d5bedebdb3a9479" }, "downloads": -1, "filename": "pythales-0.56.tar.gz", "has_sig": false, "md5_digest": "778694eedb82b1649a534dd4f3ff37ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21170, "upload_time": "2017-05-26T12:22:41", "url": "https://files.pythonhosted.org/packages/66/3d/807757f0ed2efc28987c549be3e008f03c2d9a3f6bf5c7831dc559cd321b/pythales-0.56.tar.gz" } ], "0.57": [ { "comment_text": "", "digests": { "md5": "e55daa7c5d41f730740d9bef8963e29d", "sha256": "f2254124d63f4131f0def126c4df99061ae6b18ec569180810971c5162c51e22" }, "downloads": -1, "filename": "pythales-0.57.tar.gz", "has_sig": false, "md5_digest": "e55daa7c5d41f730740d9bef8963e29d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20013, "upload_time": "2017-05-26T14:56:50", "url": "https://files.pythonhosted.org/packages/dc/87/3ab16b57026e38161a2aa06693d7a5b2067a14e93ddd9c07a41e9180cd2a/pythales-0.57.tar.gz" } ], "0.60": [ { "comment_text": "", "digests": { "md5": "dd86e06a89b3fa12f739869ebfe0b324", "sha256": "3fb586b5be9cd6f1db5ea41c502a74255415edd2b474f04e080327f2d08a2fd6" }, "downloads": -1, "filename": "pythales-0.60.tar.gz", "has_sig": false, "md5_digest": "dd86e06a89b3fa12f739869ebfe0b324", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20140, "upload_time": "2017-05-30T14:24:41", "url": "https://files.pythonhosted.org/packages/cd/90/ecf797a0ed886461d85e09429d4ba00d14c13e22fa0577b3a2527b159071/pythales-0.60.tar.gz" } ], "0.61": [ { "comment_text": "", "digests": { "md5": "bf5b6d5f08d7c7f5157ea00960d6b5e8", "sha256": "24ad78aa85bfb8f09c8f6a5f331957be28f2f67b2ad23cede6dd152c04064c0b" }, "downloads": -1, "filename": "pythales-0.61.tar.gz", "has_sig": false, "md5_digest": "bf5b6d5f08d7c7f5157ea00960d6b5e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20131, "upload_time": "2017-05-30T14:39:35", "url": "https://files.pythonhosted.org/packages/d9/d0/1aa92105605664d10eb779f93424a7f50f09c366bca46dc9be753fd9cc64/pythales-0.61.tar.gz" } ], "0.62": [ { "comment_text": "", "digests": { "md5": "0ea85bae2c0fffcb586f1a4a5f947350", "sha256": "616dec328a78bfb046d87be7c8ad6d12cbfa19df0b7d24367279a8f2343d7c61" }, "downloads": -1, "filename": "pythales-0.62.tar.gz", "has_sig": false, "md5_digest": "0ea85bae2c0fffcb586f1a4a5f947350", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20150, "upload_time": "2017-05-30T14:54:45", "url": "https://files.pythonhosted.org/packages/bb/6d/78d38026d966b894313ea35fbc1a733f8ddcf18302352d6d5fd4a1d7f4a3/pythales-0.62.tar.gz" } ], "0.63": [ { "comment_text": "", "digests": { "md5": "621b7b9764f478b5e874ab75139dc045", "sha256": "390c1693e92966071724d52cfb56a3b7547ce4a2c9626cbb99d67d335f4af99e" }, "downloads": -1, "filename": "pythales-0.63.tar.gz", "has_sig": false, "md5_digest": "621b7b9764f478b5e874ab75139dc045", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20629, "upload_time": "2017-05-31T15:24:35", "url": "https://files.pythonhosted.org/packages/a6/fe/3cb5055bae042adf41fb0de6388a0a2bfe1a2fb2fde1c9967c192744c217/pythales-0.63.tar.gz" } ], "0.66": [ { "comment_text": "", "digests": { "md5": "0cf0c90c653b1fb8b1956477cf06c854", "sha256": "bfa7036b8c134ee9c8c194b290cd85eaceb280323aee9780eeb15e9a16a686df" }, "downloads": -1, "filename": "pythales-0.66.tar.gz", "has_sig": false, "md5_digest": "0cf0c90c653b1fb8b1956477cf06c854", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20729, "upload_time": "2017-05-31T16:09:02", "url": "https://files.pythonhosted.org/packages/88/b2/c060edac8dafdbb6908c3701a042cb2868932542689f0bca0e7894c7ff31/pythales-0.66.tar.gz" } ], "0.67": [ { "comment_text": "", "digests": { "md5": "da3de55f5b1882a73a4201538e634a9e", "sha256": "e888f3588ab34ca24d606434ca9611c57470ba6d270beb2a54288e874289ce6e" }, "downloads": -1, "filename": "pythales-0.67.tar.gz", "has_sig": false, "md5_digest": "da3de55f5b1882a73a4201538e634a9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20568, "upload_time": "2017-06-09T15:22:58", "url": "https://files.pythonhosted.org/packages/38/d8/3f2bd022d614d86da7dad64d3a0be6da1ade14ab512489b04127a487a9c1/pythales-0.67.tar.gz" } ], "0.68": [ { "comment_text": "", "digests": { "md5": "5941297443f1178c0d81719cf8031cee", "sha256": "397345f48fc214961caa15524a9287f5a47938afb094647f96c4569c5a9a92f9" }, "downloads": -1, "filename": "pythales-0.68.tar.gz", "has_sig": false, "md5_digest": "5941297443f1178c0d81719cf8031cee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20727, "upload_time": "2017-08-08T08:52:11", "url": "https://files.pythonhosted.org/packages/2b/1a/306c1aa9836740a3a1fa923c3d7aa764d2e7953d59b4f6930fdd2c02980f/pythales-0.68.tar.gz" } ], "0.69": [ { "comment_text": "", "digests": { "md5": "c9edb7ff3da7c845336e06e93e5137d3", "sha256": "d0100249f536ecb46c943361de652436ba5e620bd09a298e4a44cb400d632032" }, "downloads": -1, "filename": "pythales-0.69.tar.gz", "has_sig": false, "md5_digest": "c9edb7ff3da7c845336e06e93e5137d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21181, "upload_time": "2017-08-21T14:54:38", "url": "https://files.pythonhosted.org/packages/8e/0a/085957db80bcb118363f78dbf6b5989b15ac59fef4b7ee9ac80bde62eeaa/pythales-0.69.tar.gz" } ], "0.70": [ { "comment_text": "", "digests": { "md5": "49cde0042cfa8c55f401cf1fd56d5f79", "sha256": "9847bbd4de8b0babd7634e0c7d5bb79064f79e19f7254e869b17635e356c830d" }, "downloads": -1, "filename": "pythales-0.70.tar.gz", "has_sig": false, "md5_digest": "49cde0042cfa8c55f401cf1fd56d5f79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21552, "upload_time": "2017-10-04T09:30:08", "url": "https://files.pythonhosted.org/packages/bd/3a/31fc01d5e234b8bab893fc14348fdee7e4ed23304b6533a869932aa1fa75/pythales-0.70.tar.gz" } ], "0.71": [ { "comment_text": "", "digests": { "md5": "c411011ac41fb4798e9d9ec1904fbe1f", "sha256": "d4c753f2a69b31d35fe2bc853d81494c4318914036e7304aed5164a1ff8a2b5a" }, "downloads": -1, "filename": "pythales-0.71.tar.gz", "has_sig": false, "md5_digest": "c411011ac41fb4798e9d9ec1904fbe1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21547, "upload_time": "2017-10-04T09:42:40", "url": "https://files.pythonhosted.org/packages/57/97/b9c31cb7a4758b1ff72d86e1976b769eaaec11c850821c6c70a6522ded0a/pythales-0.71.tar.gz" } ], "0.72": [ { "comment_text": "", "digests": { "md5": "c72ee624814924b21b7937d11319af25", "sha256": "428d74120fc729fc2341492d20b3ce0c9eca2a974067d4b3897768ee427e1ba4" }, "downloads": -1, "filename": "pythales-0.72.tar.gz", "has_sig": false, "md5_digest": "c72ee624814924b21b7937d11319af25", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21656, "upload_time": "2017-10-30T08:33:17", "url": "https://files.pythonhosted.org/packages/63/fa/fdaaf2c4ee90e35728ca7ef39587d0d23f97d9dbb05b16ebbd839232db57/pythales-0.72.tar.gz" } ], "0.73": [ { "comment_text": "", "digests": { "md5": "0e421ab9a63667d0247d42d8163a1396", "sha256": "aff54c3e2b4acc893c42062b1cad78711500b828dbca73913eb022dbb6c78db5" }, "downloads": -1, "filename": "pythales-0.73.tar.gz", "has_sig": false, "md5_digest": "0e421ab9a63667d0247d42d8163a1396", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22432, "upload_time": "2017-11-30T07:53:51", "url": "https://files.pythonhosted.org/packages/c7/e7/111e5ddddb76f311fa953224a93ce19a4a611e1f0fec342241d24e131bba/pythales-0.73.tar.gz" } ], "0.74": [ { "comment_text": "", "digests": { "md5": "d267834b6aab260537bcf67cfff78bea", "sha256": "0a4a32a3fc08d5e1225967e33c7cf492102cca6ea1241eabf4d7a8f947578c42" }, "downloads": -1, "filename": "pythales-0.74.tar.gz", "has_sig": false, "md5_digest": "d267834b6aab260537bcf67cfff78bea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22441, "upload_time": "2017-11-30T08:19:44", "url": "https://files.pythonhosted.org/packages/df/e9/02dd32f6f10e02e9ee9df53eeca035097f4a74b13804406f80f1f3ed9756/pythales-0.74.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d267834b6aab260537bcf67cfff78bea", "sha256": "0a4a32a3fc08d5e1225967e33c7cf492102cca6ea1241eabf4d7a8f947578c42" }, "downloads": -1, "filename": "pythales-0.74.tar.gz", "has_sig": false, "md5_digest": "d267834b6aab260537bcf67cfff78bea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22441, "upload_time": "2017-11-30T08:19:44", "url": "https://files.pythonhosted.org/packages/df/e9/02dd32f6f10e02e9ee9df53eeca035097f4a74b13804406f80f1f3ed9756/pythales-0.74.tar.gz" } ] }