{ "info": { "author": "Nikesh Bajaj", "author_email": "nikkeshbajaj@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# LFSR -Linear Feedback Shift Register\n\n### **[Github Page](http://nikeshbajaj.github.io/Linear_Feedback_Shift_Register/)**\n### **[PyPi - project](https://pypi.org/project/pylfsr/)**\n### **[Documentation](https://linear-feedback-shift-register.readthedocs.io/en/latest/index.html)**\n\n

\n \n

\n\n\n# Python\n\n\n### Requirement : *numpy*\n\n## Installation\n\n### with pip\n\n```\npip install pylfsr\n```\n\n### Build from the source\nDownload the repository or clone it with git, after cd in directory build it from source with\n\n```\npython setup.py install\n```\n\n## Examples\n### **Example 1**: 5-bit LFSR with feedback polynomial *x^5 + x^2 + 1*\n\n```\n# import LFSR\nimport numpy as np\nfrom pylfsr import LFSR\n\nL = LFSR()\n\n# print the info\nL.info()\n\n5 bit LFSR with feedback polynomial x^5 + x^2 + 1\nExpected Period (if polynomial is primitive) = 31\nCurrent :\nState : [1 1 1 1 1]\nCount : 0\nOutput bit : -1\nfeedback bit : -1\n```\n\n\n```\nL.next()\nL.runKCycle(10)\nL.runFullCycle()\nL.info()\n```\n\n### Example 2**: 5-bit LFSR with custum state and feedback polynomial\n\n```\nstate = [0,0,0,1,0]\nfpoly = [5,4,3,2]\nL = LFSR(fpoly=fpoly,initstate =state, verbose=True)\nL.info()\ntempseq = L.runKCycle(10)\nL.set(fpoly=[5,3])\n```\n\n### Example 3**: 23-bit LFSR with custum state and feedback polynomial\n\n```\nL = LFSR(fpoly=[23,18],initstate ='random',verbose=True)\nL.info()\nL.runKCycle(10)\nL.info()\nseq = L.seq\n```\n\n### Example 4**: Get the feedback polynomial or list\nReference : http://www.partow.net/programming/polynomials/index.html\n\n```\nL = LFSR()\n# list of 5-bit feedback polynomials\nfpoly = L.get_fpolyList(m=5)\n\n# list of all feedback polynomials as a dictionary\nfpolyDict = L.get_fpolyList()\n```\n\n\n### Changing feedback polynomial in between \n```\nL.changeFpoly(newfpoly =[23,14],reset=False)\nseq1 = L.runKCycle(20)\n\n# Change after 20 clocks\nL.changeFpoly(newfpoly =[23,9],reset=False)\nseq2 = L.runKCycle(20)\n```\n\n### For A5/1 GSM Stream cipher generator\nReference Article: **Enhancement of A5/1**: https://doi.org/10.1109/ETNCC.2011.5958486\n\n```\n# Three LFSRs initialzed with 'ones' though they are intialized with encription key\nR1 = LFSR(fpoly = [19,18,17,14])\nR2 = LFSR(fpoly = [23,22,21,8])\nR3 = LFSR(fpoly = [22,21])\n\n# clocking bits\nb1 = R1.state[8]\nb2 = R1.state[10]\nb3 = R1.state[10]\n\n```\n_______________________________________________________________________________________________\n\n# MATLAB\n\nFolder : https://github.com/Nikeshbajaj/Linear_Feedback_Shift_Register/tree/master/matlabfiles\n\n**Description**\nGenrate randon binary sequence using LFSR for any given feedback taps (polynomial), \nThis will also check Three fundamental Property of LFSR \n1. Balance Property \n2. Runlength Property \n3. Autocorrelation Property\n\n**This MATLAB Code work for any length of LFSR with given taps (feedback polynomial) -Universal, There are three files LFSRv1.m an LFSRv2.m, LFSRv3.m**\n\n### LFSRv1\nThis function will return all the states of LFSR and will check Three fundamental Property of LFSR \n(1) Balance Property (2) Runlength Property (3) Autocorrelation Property\n\n#### EXAMPLE\n```\ns=[1 1 0 0 1] \nt=[5 2]\n[seq c] =LFSRv1(s,t)\n```\n\n### LFSRv2\nThis function will return only generated sequence will all the states of LFSR, no verification of properties are done\nhere. Use this function to avoid verification each time you execute the program.\n#### EXAMPLE\n```\ns=[1 1 0 0 1] \nt=[5 2]\n[seq c] =LFSRv2(s,t)\n```\n\n### LFSRv3 (faster)\n*seq = LFSRv3(s,t,N)*\nthis function generates N bit sequence only. This is faster then other two functions, as this does not gives each state of LFSR\n\n#### EXAMPLE\n```\ns=[1 1 0 0 1] \nt=[5 2]\nseq =LFSRv3(s,t,50)\n```\n\n\n\n## Tips\n* If you want to use this function in middle of any program, use LFSRv2 or LFSRv1 with verification =0. \n* If you want to make it fast for long length of LFSR,use LFSRv3.m \n\n______________________________________\n\n# Contacts:\n\nIf any doubt, confusion or feedback please contact me\n* **Nikesh Bajaj**\n* http://nikeshbajaj.in\n* n.bajaj@qmul.ac.uk\n* bajaj[dot]nikkey [AT]gmail[dot]com\n### PhD Student: Queen Mary University of London & University of Genoa\n______________________________________\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/Nikeshbajaj/Linear_Feedback_Shift_Register/tarball/1.0.4", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Nikeshbajaj/Linear_Feedback_Shift_Register", "keywords": "lfsr linear-feedback-shift-register random generator gf(2)", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pylfsr", "package_url": "https://pypi.org/project/pylfsr/", "platform": "", "project_url": "https://pypi.org/project/pylfsr/", "project_urls": { "Download": "https://github.com/Nikeshbajaj/Linear_Feedback_Shift_Register/tarball/1.0.4", "Homepage": "https://github.com/Nikeshbajaj/Linear_Feedback_Shift_Register" }, "release_url": "https://pypi.org/project/pylfsr/1.0.4/", "requires_dist": [ "numpy" ], "requires_python": "", "summary": "Linear Feedback Shift Register", "version": "1.0.4" }, "last_serial": 5157463, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "de64fe3bc9d2ff056797a91cb3780618", "sha256": "47168fb2171a6b3893cabaacd4d4fe6964e2d52a3d52edf2f0db0f704662fd31" }, "downloads": -1, "filename": "pylfsr-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "de64fe3bc9d2ff056797a91cb3780618", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8735, "upload_time": "2019-04-17T17:24:06", "url": "https://files.pythonhosted.org/packages/ae/55/9fef4b34b7390973c5faff9540b3772629f5f2c337562a9deb122a7310d0/pylfsr-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5eac72107f58aab2a88a9d9e9764ddcd", "sha256": "d58bee10ecdd0cea39ea5d202f0a203723de198692fa700200a377c246b5605e" }, "downloads": -1, "filename": "pylfsr-1.0.1.tar.gz", "has_sig": false, "md5_digest": "5eac72107f58aab2a88a9d9e9764ddcd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8635, "upload_time": "2019-04-17T17:24:08", "url": "https://files.pythonhosted.org/packages/ee/c5/4097cd22a6496390516b8ed5908d1403de87be6321f1b1f1a4dc0844b046/pylfsr-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "ca4ebc3a0dd8581c387d8081ca44be79", "sha256": "1819fe2bfcd1eef12805756293c1508e28b47ead9990f7566a6c69c3d895c1d0" }, "downloads": -1, "filename": "pylfsr-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ca4ebc3a0dd8581c387d8081ca44be79", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8860, "upload_time": "2019-04-17T17:47:02", "url": "https://files.pythonhosted.org/packages/bc/7f/f864e8f3cf725c50ad9bb327debfc30d8e7c8f3448e3b4a0de1f012fb514/pylfsr-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5cb59d72188addf4e777aeb4223ece9d", "sha256": "64f51fcac5ba7b3c7b365af712caa12707e158cbd5a8ea95a52621a4eeb1ffe8" }, "downloads": -1, "filename": "pylfsr-1.0.2.tar.gz", "has_sig": false, "md5_digest": "5cb59d72188addf4e777aeb4223ece9d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8786, "upload_time": "2019-04-17T17:47:03", "url": "https://files.pythonhosted.org/packages/bd/3e/ab983ed3da8804ee91fd1a87a96d55bef73ae216278df4d6065a7e67520b/pylfsr-1.0.2.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "ab9c3f0b759e80fd9396d595dfb354ce", "sha256": "74504ed527b6d2f01cf94cf3e13c0b0fda258261f4a5eabf295265b64fbf1bf0" }, "downloads": -1, "filename": "pylfsr-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "ab9c3f0b759e80fd9396d595dfb354ce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9877, "upload_time": "2019-04-17T23:01:06", "url": "https://files.pythonhosted.org/packages/6b/d6/59968102c0cd2d3445dd3c1b44ff07c9bcf9222471f041187f7a10a3c9a1/pylfsr-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "269121d17a1738802e91db71b0b8dee4", "sha256": "89d6756a8fc8382b8bd2e3031a16c715bcd63fb42a01e9dfb8409d57bf19a3c1" }, "downloads": -1, "filename": "pylfsr-1.0.4.tar.gz", "has_sig": false, "md5_digest": "269121d17a1738802e91db71b0b8dee4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9858, "upload_time": "2019-04-17T23:01:07", "url": "https://files.pythonhosted.org/packages/27/04/3061a8ea94d35eb5890925254d173d0fdfc5cca3f99d97dacf06b17d2171/pylfsr-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ab9c3f0b759e80fd9396d595dfb354ce", "sha256": "74504ed527b6d2f01cf94cf3e13c0b0fda258261f4a5eabf295265b64fbf1bf0" }, "downloads": -1, "filename": "pylfsr-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "ab9c3f0b759e80fd9396d595dfb354ce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9877, "upload_time": "2019-04-17T23:01:06", "url": "https://files.pythonhosted.org/packages/6b/d6/59968102c0cd2d3445dd3c1b44ff07c9bcf9222471f041187f7a10a3c9a1/pylfsr-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "269121d17a1738802e91db71b0b8dee4", "sha256": "89d6756a8fc8382b8bd2e3031a16c715bcd63fb42a01e9dfb8409d57bf19a3c1" }, "downloads": -1, "filename": "pylfsr-1.0.4.tar.gz", "has_sig": false, "md5_digest": "269121d17a1738802e91db71b0b8dee4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9858, "upload_time": "2019-04-17T23:01:07", "url": "https://files.pythonhosted.org/packages/27/04/3061a8ea94d35eb5890925254d173d0fdfc5cca3f99d97dacf06b17d2171/pylfsr-1.0.4.tar.gz" } ] }