{"id":30361471,"url":"https://github.com/tulliolo/bip39","last_synced_at":"2026-06-29T15:31:09.195Z","repository":{"id":160936046,"uuid":"604241175","full_name":"tulliolo/bip39","owner":"tulliolo","description":"A Bip39 library, with a CLI and a collection of tools.","archived":false,"fork":false,"pushed_at":"2023-05-14T10:45:19.000Z","size":734,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T09:22:18.098Z","etag":null,"topics":["bip39","bitcoin","cryptography","entropy","mnemonic","python","seed","steganography","wallet"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tulliolo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-20T16:25:03.000Z","updated_at":"2025-02-16T17:29:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"8252d38b-6ce7-41a5-9fab-b626fad019ba","html_url":"https://github.com/tulliolo/bip39","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tulliolo/bip39","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tulliolo%2Fbip39","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tulliolo%2Fbip39/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tulliolo%2Fbip39/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tulliolo%2Fbip39/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tulliolo","download_url":"https://codeload.github.com/tulliolo/bip39/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tulliolo%2Fbip39/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34933498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bip39","bitcoin","cryptography","entropy","mnemonic","python","seed","steganography","wallet"],"created_at":"2025-08-19T16:03:21.203Z","updated_at":"2026-06-29T15:31:09.189Z","avatar_url":"https://github.com/tulliolo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bip39\nA Bip39 library, with a CLI and a collection of tools.\n\nThis project provides a full implementation of the [Bip39 specs](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki), along with a CLI that offers some mnemonic key management tools such as:\n- **generate** and **validate** mnemonics;\n- **correct** the last word according to the checksum (e.g. when a mnemonic is generated by rolling dices);\n- **transform** (and **restore**) mnemonics, e.g. to create side-wallets hiding the original;\n- **hide** or **reveal** a mnemonic in an image file, with a steganography algorithm.\n\nFor further details, please refer to the [documentation folder](https://github.com/tulliolo/bip39/wiki).\n\n**For security reasons, it is highly recommended to run the CLI on an offline system, without any Internet or LAN connection.**\n\n## Requirements\npython 3.9+\n\n## Installation\nThis project is distributed on [PyPI](https://pypi.org/):\n```\npip install tulliolo.bip39\n```\n\n## Usage Examples\nHere are some examples of using the library and CLI.\n\n### CLI\n**Generate** a new 24 words mnemonic:\n```\n$ bip39-cli generate -s 24\n******************\n* bip39-cli v0.2 *\n******************\n\ngenerating a 24 words mnemonic...\n\ngenerate success!\nview fresh drink impulse doctor wise another smoke license collect unaware immense normal trick second owner subway bright chaos upper ribbon kite debris quote\n```\n\n**Validate** a mnemonic, fixing the checksum:\n```\n$ bip39-cli validate -f\n******************\n* bip39-cli v0.2 *\n******************\n\nenter a mnemonic:\n₿ view fresh drink impulse doctor wise another smoke license collect unaware immense\ninvalid checksum | expected: 0 | obtained: c\n\nvalidation success... with fixed checksum:\nview fresh drink impulse doctor wise another smoke license collect unaware hybrid\n```\n\n**Transform** and **restore** a mnemonic with a _negative_ (default) transformation:\n```\n$ bip39-cli transform\n******************\n* bip39-cli v0.2 *\n******************\n\nenter a mnemonic\n₿ view fresh drink impulse doctor wise another smoke license collect unaware hybrid\n\napplying negative transformation...\n\ntransformation success!\narmy permit rude miss sausage adjust wait creek learn sponsor bean mixed\n\n$ bip39-cli transform\n******************\n* bip39-cli v0.2 *\n******************\n\nenter a mnemonic\n₿ army permit rude miss sausage adjust wait creek learn sponsor bean mixed\n\napplying negative transformation...\n\ntransformation success!\nview fresh drink impulse doctor wise another smoke license collect unaware hybrid\n```\n\n**Encrypt** a mnemonic and **hide** it in an image with steganography:\n```\n$ bip39-cli steganography encode -i tests/data/test_image.jpg -o tests/data/output/\n******************\n* bip39-cli v0.2 *\n******************\n\nenter a mnemonic:\n₿ view fresh drink impulse doctor wise another smoke license collect unaware hybrid\n\nenter a password to encrypt the mnemonic (or leave blank):\n₿ \ninsert again...:\n₿ \nencrypting mnemonic...\n\nencoding image...\n\nencoding success!\ntests/data/output/test_image_horizontal_20230510-120631.png\n```\n\n**Reveal** a mnemonic from an image with steganography and **decrypt** it:\n```\n$ bip39-cli steganography decode -i tests/data/output/test_image_horizontal_20230510-120631.png \n******************\n* bip39-cli v0.2 *\n******************\n\nenter a password to decrypt the mnemonic (or leave blank):\n₿ \ninsert again...:\n₿ \n\ndecoding image...\ndecoding success!\n\ndecrypting mnemonic...\ndecrypting success!\nview fresh drink impulse doctor wise another smoke license collect unaware hybrid\n```\n\n### Library\n**Generate** a 12 words mnemonic:\n\n```\nfrom tulliolo.bip39.mnemonic import Mnemonic\n\nmnemonic = Mnemonic.generate(12)\nprint(\" \".join(mnemonic.value))\n\nabsent deny citizen next velvet where mixture glimpse deposit sentence hat manual\n```\n\n**Import** a mnemonic and fix the checksum:\n```\nfrom tulliolo.bip39.mnemonic import Mnemonic\n\nmnemonic = Mnemonic.from_value(\"view fresh drink impulse doctor wise another smoke license collect unaware immense\", fix_checksum=True)\nprint(mnemonic.info)\n\n{'entropy': 'f3eb990c391405f8c266668125b3b1b8', 'checksum': '0', 'value': {1: 'view', 2: 'fresh', 3: 'drink', 4: 'impulse', 5: 'doctor', 6: 'wise', 7: 'another', 8: 'smoke', 9: 'license', 10: 'collect', 11: 'unaware', 12: 'hybrid'}}\n```\n\nGenerate the **seed**, that can be later used to generate bip32 wallets:\n```\nfrom tulliolo.bip39.mnemonic import Mnemonic\n\nseed = Mnemonic.generate(24).encode(passphrase=\"my_optional_passphrase\")\nprint(seed.hex())\n\nd24027e4b7dae545b95dca96a7b8e539e0a0d7ae2ef6cd2247e346907f7b842bb93d2268ee3bd28eede481b0ddab0b44f04ed49b4a4904ee7882677dd2677ac2\n```\n\n**Transform** and **restore** a mnemonic with a _mirror_ transformation:\n```\nfrom tulliolo.bip39.mnemonic import Mnemonic\nfrom tulliolo.bip39.utils.transformation import Transformation\n\nmnemonic_o = Mnemonic.from_value(\"view fresh drink impulse doctor wise another smoke license collect unaware hybrid\")\nmnemonic_t = mnemonic_o.transform(Transformation.MIRROR)\nprint(mnemonic_t.value)\n\n('budget', 'hover', 'hard', 'actress', 'grid', 'canoe', 'leader', 'agree', 'order', 'luggage', 'invest', 'paddle')\n\nmnemonic_t = mnemonic_t.transform(Transformation.MIRROR)\nassert mnemonic_o == mnemonic_t\nprint(mnemonic_t.value)\n\n('view', 'fresh', 'drink', 'impulse', 'doctor', 'wise', 'another', 'smoke', 'license', 'collect', 'unaware', 'hybrid')\n```\n\n**Encrypt** a mnemonic and **hide** it in an image with steganography:\n```\nimport pathlib\nfrom tulliolo.bip39.utils import encryption, steganography\n\nwords = \"view fresh drink impulse doctor wise another smoke license collect unaware hybrid\"\n\n# encrypt words\nwords = encryption.encrypt(words, \"my_password\")\n\n# create paths\ninput_file = pathlib.Path(\"tests/data/test_image.jpg\")\noutput_path = pathlib.Path(\"tests/data/output\")\n\n# hide message\noutput_file = steganography.encode(words, input_file, output_path)\nprint(output_file)\n\ntests/data/output/test_image_horizontal_20230513-103831.png\n```\n\n**Reveal** a mnemonic from an image with steganography and **decrypt** it:\n```\nimport pathlib\nfrom tulliolo.bip39.utils import encryption, steganography\n\n# create path\ninput_file = pathlib.Path(\"tests/data/output/test_image_horizontal_20230513-103831.png\")\n\n# reveal message\nmessage = steganography.decode(input_file)\n\n# decrypt message\nmessage = encryption.decrypt(message, \"my_password\").decode(\"utf-8\")\nprint(message)\n\nview fresh drink impulse doctor wise another smoke license collect unaware hybrid\n```\n\n## Disclaimer\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftulliolo%2Fbip39","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftulliolo%2Fbip39","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftulliolo%2Fbip39/lists"}