{"id":16648611,"url":"https://github.com/clach04/jenc-py","last_synced_at":"2026-02-09T20:03:29.691Z","repository":{"id":252706237,"uuid":"841202289","full_name":"clach04/jenc-py","owner":"clach04","description":"Python package for jenc/Markor decryption/encryption","archived":false,"fork":false,"pushed_at":"2024-11-28T13:08:13.000Z","size":53,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-17T21:49:35.557Z","etag":null,"topics":["aes","aes-256","aes-encryption","aes-gcm-encryption","aes256-gcm","cryptography","decryption","encryption","encryption-decryption","gcm","java","jenc","markor","pbkdf2withhmacsha512","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/jenc/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clach04.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":"2024-08-11T22:53:41.000Z","updated_at":"2025-08-26T02:25:33.000Z","dependencies_parsed_at":"2024-11-28T14:21:12.665Z","dependency_job_id":"c581de43-eea9-4ef9-8b0c-804581cdd60d","html_url":"https://github.com/clach04/jenc-py","commit_stats":null,"previous_names":["clach04/jenc-py"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/clach04/jenc-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clach04%2Fjenc-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clach04%2Fjenc-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clach04%2Fjenc-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clach04%2Fjenc-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clach04","download_url":"https://codeload.github.com/clach04/jenc-py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clach04%2Fjenc-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29279300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T19:05:41.198Z","status":"ssl_error","status_checked_at":"2026-02-09T19:05:37.449Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aes","aes-256","aes-encryption","aes-gcm-encryption","aes256-gcm","cryptography","decryption","encryption","encryption-decryption","gcm","java","jenc","markor","pbkdf2withhmacsha512","python"],"created_at":"2024-10-12T09:05:03.453Z","updated_at":"2026-02-09T20:03:29.673Z","avatar_url":"https://github.com/clach04.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jenc-py\n\njenc/Markor decrypt/encrypt library\n\nhttps://github.com/clach04/jenc-py\n\n**IMPORTANT** before using the optionally encryption features,\nensure that it is legal in your country to use the specific encryption ciphers.\nSome countries have also have restrictions on import, export, and usage see http://www.cryptolaw.org/cls-sum.htm\n\nThe aim is to have a pure python (with crypto dependencies) library that is able to read/write .jenc files as used by [Markor](https://github.com/gsantner/markor)\nwhich uses the [jenc](https://github.com/opensource21/jpencconverter) format decrypt/encrypt Java library.\n\n  * [Getting Started](#getting-started)\n    + [Regular install](#regular-install)\n    + [Without a source code checkout](#without-a-source-code-checkout)\n    + [From a source code checkout](#from-a-source-code-checkout)\n  * [Examples](#examples)\n    + [Command line Encrypt / Decrypt](#command-line-encrypt---decrypt)\n      - [Command line Decrypt](#command-line-decrypt)\n      - [Command line Encrypt](#command-line-encrypt)\n    + [Example Encrypt / Decrypt in memory](#example-encrypt---decrypt-in-memory)\n  * [jenc file format](#jenc-file-format)\n    + [jenc file format - V001](#jenc-file-format---v001)\n    + [jenc file format - U001](#jenc-file-format---u001)\n\n\u003csmall\u003e\u003ci\u003e\u003ca href='http://ecotrust-canada.github.io/markdown-toc/'\u003eTable of contents generated with markdown-toc\u003c/a\u003e\u003c/i\u003e\u003c/small\u003e\n\n\n## Getting Started\n\n### Regular install\n\n    pip install jenc\n\n### Without a source code checkout\n\nPicking up the latest version\n\n    pip uninstall jenc; python -m pip install --upgrade git+https://github.com/clach04/jenc.git\n\n### From a source code checkout\n\n    # pip uninstall jenc\n    # python -m pip install -r requirements.txt\n    # TODO requirements_optional.txt\n    python -m pip install -e .\n\n#### Run test suite\n\n    python -m jenc.tests.testsuite\n    python -m jenc.tests.testsuite -v\n\n## Examples\n\n### Command line Encrypt / Decrypt\n\nHelp:\n\n    Usage: [options] in_filename\n\n    Command line tool to encrypt/decrypt; .jenc / Markor / jpencconverter files\n\n    Options:\n      --version             show program's version number and exit\n      -h, --help            show this help message and exit\n      -o FILE, --output=FILE\n                            write output to FILE\n      -d, --decrypt         decrypt in_filename\n      -e, --encrypt         encrypt in_filename\n      -E ENVVAR, --envvar=ENVVAR\n                            Name of environment variable to get password from\n                            (defaults to JENC_PASSWORD) - unsafe\n      -p PASSWORD, --password=PASSWORD\n                            password, if omitted but OS env JENC_PASSWORD is set\n                            use that, if missing prompt - unsafe\n      -P PASSWORD_FILE, --password_file=PASSWORD_FILE\n                            file name where password is to be read from, trailing\n                            blanks are ignored\n      -j JENC_VERSION, --jenc-version=JENC_VERSION, --jenc_version=JENC_VERSION\n                            jenc version to use, case sensitive\n      -v, --verbose\n      -s, --silent          if specified do not warn about stdin using\n\n\n#### Command line Decrypt\n\nTo stdout\n\n    # Test V001 file from jpencconverter\n    python -m jenc -p geheim jenc\\tests\\data\\Test3.md.jenc\n\nTo a file named `output.txt`\n\n    python -m jenc -p geheim jenc\\tests\\data\\Test3.md.jenc -o output.txt\n\n\n#### Command line Encrypt\n\nEncrypt stdin, into `output.txt.jenc`\n\n    echo hello| python -m jenc --encrypt -p geheim - -o output.txt.jenc\n    echo hello| python -m jenc -e        -p geheim - -o output.txt.jenc\n\n### Example Encrypt / Decrypt in memory\n\nTest jenc file https://github.com/opensource21/jpencconverter/blob/master/src/test/encrypted/Test3.md.jenc\nTest password `geheim` from https://github.com/opensource21/jpencconverter/blob/master/src/test/resources/application.properties\n\n    import jenc\n\n    password = 'geheim'  # same password used in demos for Java version https://github.com/opensource21/jpencconverter/tree/master/src/test/encrypted\n    encrypted_bytes = jenc.encrypt(password, b\"Hello World\")\n    plaintext_bytes = jenc.decrypt(password, encrypted_bytes)\n\n\n## jenc file format\n\nThere are multiple versions V001 (and the old U001).\n\nTL;DR [AES-256-GCM (No Padding)](https://en.wikipedia.org/wiki/Galois/Counter_Mode), using KDF [pbkdf2-hmac-sha512](https://en.wikipedia.org/wiki/PBKDF2) with 10000 iterations.\n\nFile format:\n\n  * 4 bytes - define the version.\n  * nonce bytes - bytes as nonce for cipher depends. The length depends on the version. 32-bytes for latest version.\n  * salt bytes - bytes to salt the password. The length depends on the version. 64-bytes for latest version.\n  * content bytes - the encrypted content-bytes.\n\nFrom the original Java code for jpencconverter it appears that strings are converted to/from UTF-8 (i.e. passwords and plaintext).\n\n### jenc file format - V001\n\nFrom Python code:\n\n    # note CamelCase to match https://github.com/opensource21/jpencconverter/blob/f65b630ea190e597ff138d9c1ffa9409bb4d56f7/src/main/java/de/stanetz/jpencconverter/cryption/JavaPasswordbasedCryption.java#L229\n    'keyFactory': 'PBKDF2WithHmacSHA512',\n    'keyIterationCount': 10000,  # this is probably too small/few in 2024\n    'keyLength': 256,\n    'keyAlgorithm': 'AES',\n    'keySaltLength': 64,  # in bytes\n    'cipher': 'AES/GCM/NoPadding',\n    'nonceLenth': 32,  # nonceLenth (sic.) == Nonce Length, i.e. IV length # in bytes\n\n### jenc file format - U001\n\nFrom Python code:\n\n    'U001': {  # NOTE Deprecated, i.e. not recommended\n        'keyFactory': JENC_PBKDF2WithHmacSHA1,\n        'keyIterationCount': 10000,  # this is probably too small/few in 2024\n        'keyLength': 256,\n        'keyAlgorithm': 'AES',\n        'keySaltLength': 64,  # in bytes\n        'cipher': JENC_AES_GCM_NoPadding,\n        'nonceLenth': 32,  # nonceLenth (sic.) == Nonce Length, i.e. IV length  # in bytes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclach04%2Fjenc-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclach04%2Fjenc-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclach04%2Fjenc-py/lists"}