{"id":16648686,"url":"https://github.com/clach04/puren_tonbo","last_synced_at":"2025-12-27T17:20:08.450Z","repository":{"id":65711002,"uuid":"595156698","full_name":"clach04/puren_tonbo","owner":"clach04","description":"Plain text notes Tombo (chi) alternative, also supports, ccrypt, GnuPG (OpenPGP, gpg), OpenSSL AES-256-CBC, AES-256 ZIP AE-1/AE-2 and VimCrypt encrypted files. Integrates with VIM. WIP","archived":false,"fork":false,"pushed_at":"2024-05-19T14:22:44.000Z","size":1031,"stargazers_count":1,"open_issues_count":90,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-19T15:33:32.814Z","etag":null,"topics":["ae-1","ae-2","aes","aes-256","aes-ctr","blowfish","ccrypt","chi","decryption","encryption","encryption-decryption","gnupg","gpg","hmac-sha256","openpgp","tombo","vim","vimcrypt","zip"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/puren-tonbo/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","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}},"created_at":"2023-01-30T14:12:55.000Z","updated_at":"2024-05-30T03:42:15.646Z","dependencies_parsed_at":"2023-05-27T22:30:27.336Z","dependency_job_id":"f44d3801-2bf9-4795-8fac-66d33b37c9a5","html_url":"https://github.com/clach04/puren_tonbo","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clach04%2Fpuren_tonbo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clach04%2Fpuren_tonbo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clach04%2Fpuren_tonbo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clach04%2Fpuren_tonbo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clach04","download_url":"https://codeload.github.com/clach04/puren_tonbo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243285602,"owners_count":20266846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ae-1","ae-2","aes","aes-256","aes-ctr","blowfish","ccrypt","chi","decryption","encryption","encryption-decryption","gnupg","gpg","hmac-sha256","openpgp","tombo","vim","vimcrypt","zip"],"created_at":"2024-10-12T09:05:15.267Z","updated_at":"2025-12-27T17:20:08.443Z","avatar_url":"https://github.com/clach04.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"-*- coding: utf-8 -*-\n# puren_tonbo\n\nPure Plain Text Notes... with optional encryption.\n\nhttps://github.com/clach04/puren_tonbo/\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\nEnsure you have backups, these tools could destroy/delete/corrupt your notes!\nNO WARRANTY - see the LICENSE\n\n  * [Background](#background)\n  * [Features](#features)\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  * [Microsoft Windows](#microsoft-windows)\n    + [Microsoft Windows GUI Alternative Terminals](#microsoft-windows-gui-alternative-terminals)\n      - [mintty (recommended)](#mintty--recommended-)\n      - [Alacritty](#alacritty)\n      - [Windows Terminal](#windows-terminal)\n  * [Examples](#examples)\n    + [ptcat](#ptcat)\n    + [ptgrep](#ptgrep)\n    + [ptnewline_check](#ptnewline_check)\n    + [ptrecrypt](#ptrecrypt)\n    + [ptig](#ptig)\n      - [Sample ptig session](#sample-ptig-session)\n      - [ptig config](#ptig-config)\n    + [pttkview](#pttkview)\n    + [ptpyvim](#ptpyvim)\n    + [ptdiff3merge](#ptdiff3merge)\n    + [ptcipher](#ptcipher)\n      - [rot-13](#rot-13)\n      - [rot-47](#rot-47)\n      - [gzip](#gzip)\n      - [jenc / Markor / jpencconverter](#jenc---markor---jpencconverter)\n      - [Tombo Blowfish CHI](#tombo-blowfish-chi)\n      - [Age encryption](#age-encryption)\n      - [ccrypt CPT](#ccrypt-cpt)\n      - [OpenPGP - gpg / pgp](#openpgp---gpg---pgp)\n      - [OpenSSL 1.1.0 AES](#openssl-110-aes)\n      - [AES-256 zip](#aes-256-zip)\n      - [VimCrypt](#vimcrypt)\n  * [ptcat/ptcipher with text editors like vim](#ptcat-ptcipher-with-text-editors-like-vim)\n    + [readonly pipe into editor](#readonly-pipe-into-editor)\n    + [SciTE lua plugin](#scite-lua-plugin)\n      - [SciTE lua install without extension manager](#scite-lua-install-without-extension-manager)\n      - [SciTE lua install with an extension manager](#scite-lua-install-with-an-extension-manager)\n    + [SciTE Python plugin](#scite-python-plugin)\n    + [vim plugin](#vim-plugin)\n      - [vim demo](#vim-demo)\n      - [vim plugin install](#vim-plugin-install)\n      - [vim plugin install linux/unix](#vim-plugin-install-linux-unix)\n      - [vim plugin install Microsoft Windows](#vim-plugin-install-microsoft-windows)\n      - [vim config notes](#vim-config-notes)\n  * [Development and testing](#development-and-testing)\n    + [Run test suite](#run-test-suite)\n    + [High Level Overview](#high-level-overview)\n  * [Thanks](#thanks)\n  * [TODO](#todo)\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## Background\n\nPlain text notes search/edit tool that supports encrypted files, formats:\n\n  * [AES-256 ZIP AE-1/AE-2](https://www.winzip.com/en/support/aes-encryption/) created with 7z (does NOT support encrypted 7z files), WinZIP, WinRAR - AES256 (under Python 3 can also read (but not write) the original ZipCrypto zip format)\n      * AES-256-CTR PBKDF2 (iterations 1000)\n  * [Age](https://github.com/clach04/age/tree/pr520_osenv_password) age passphrase encryption (not key)\n  * [jenc / markor](https://github.com/clach04/jenc-py)\n  * [ccrypt](https://ccrypt.sourceforge.net/) - Rijndael-256 (no authentication)\n  * [GnuPG (OpenPGP, gpg)](https://www.gnupg.org/) - [symmetric](https://www.gnupg.org/gph/en/manual/r656.html) see https://tutonics.com/articles/gpg-encryption-guide-part-4-symmetric-encryption/#:~:text=Another%20type%20of%20cryptographic%20solution,also%20called%20a%20shared%20secret.\n  * [OpenSSL 1.1.0 aes-256-cbc](https://github.com/openssl/openssl) - [symmetric](https://www.openssl.org/docs/manmaster/man1/openssl.html) AES-256-CBC encryption with pbkdf2.\n  * [Tombo (chi)](https://github.com/clach04/chi_io?tab=readme-ov-file) - blowfish-ECB\n  * [vim VimCrypt](https://vimdoc.sourceforge.net/htmldoc/editing.html#encryption) encrypted files READ ONLY - VimCrypt (1-3) zip, blowfish, and blowfish2\n\nプレーン トンボ\nPurēntonbo\n\n 平易 蜻蛉\n\n\n  * http://tombo.sourceforge.jp/En/\n  * https://github.com/clach04/chi_io\n  * https://hg.sr.ht/~clach04/pytombo - NOTE Puren Tonbo is intended to replace PyTombo\n\n\n## Features\n\n  * Plain text files notes (potentially with no formatting or in Markdown, reStructuredText, etc.)\n  * Nested directories of notes\n  * Supports reading and writing from/to encrypted files that are compatible with other formats/tools (there is no intention to create a new crypto format/algorithm in this tool)\n  * Currently limited to local file system and stdin/out for files\n  * Command line tools; `ptcat` and `ptcipher` to encrypt/decrypt and view plain text files\n      * `ptcipher` - process raw binary files, controlled via command line and environment variables\n      * `ptcat` - in addition to command line and environment variables, also has an (optional) config file and the concept of a root directory of notes\n  * `ptgrep` - a grep, [ack](https://beyondgrep.com/), [ripgrep](https://github.com/BurntSushi/ripgrep), [silver-searcher](https://geoff.greer.fm/ag/), [pss](https://github.com/eliben/pss) like tool that works on encrypted (and plain text) files\n  * `ptnewline_check` - sanity check file for line endings, help detect bad Windows files that don't have consistent CR followed by NL\n  * `ptig` an interactive grep like tool that can also view/edit\n  * `ptrecrypt` a TODO\n  * `ptpyvim` a vim-like editor that works on encrypted (and plain text) files\n  * `ptdiff3merge` 3-way diff/merge too that can works with encrypted (and plain text) files\n\n\n## Getting Started\n\n    sudo apt-get install python-tk\n    sudo apt-get install ccrypt\n\n\n### Regular install\n\n    pip install \"puren_tonbo[all]\"\n\n### Without a source code checkout\n\nPicking up the latest version\n\n    pip uninstall puren_tonbo ; python -m pip install --upgrade git+https://github.com/clach04/chi_io.git  git+https://github.com/clach04/puren_tonbo.git\n\n    # sanity check, and dump sample config to stdout\n    ptconfig\n    python -m puren_tonbo.tools.ptconfig\n\n### From a source code checkout\n\n    # pip uninstall puren_tonbo\n    # python -m pip install -r requirements.txt\n    # TODO requirements_optional.txt\n    python -m pip install -e .\n    python -m pip install -e .[all]\n\n\n    # sanity check, and dump sample config to stdout\n    ptconfig\n    python -m puren_tonbo.tools.ptconfig\n\n\n## Microsoft Windows\n\n  * NOTE \"start\" can help with spawning exes that wait, and do not exit. BUT ensure command being started is in path (do not use full path), causes issues with multiple edit (\"en\") in ptig.\n  * Unicode support, CMD.exe has limited Unicode support, instead use a GUI terminal with Unicode support (see below)\n\n### Microsoft Windows GUI Alternative Terminals\n\nUsing an alternative to CMD.exe allows full Unicode support, including Emoji\nRecommend mintty (or in a pinch Windows Terminal).\n\nDo NOT recommend Fluent Terminal (FluentTerminal).\n\nUntested alternatives; Windows Terminal 2, ConEMu (https://conemu.github.io/ https://github.com/Maximus5/ConEmu)\n\n#### mintty (recommended)\n\nhttps://github.com/mintty/mintty\n\nmintty is included with Git for Windows, msys2, cygwin.\n\nExamples:\n\n    mintty --title ptig --hold error --size 120,35 -e python -m puren_tonbo.tools.ptig\n    mintty --title ptig --hold error --size 120,35 -e C:\\full\\path\\to\\ptig.exe\n    mintty --title ptig --hold error --size 120,35 -e ptig.exe\n    \"C:\\Program Files\\Git\\usr\\bin\\mintty.exe\" --title ptig --hold error --size 120,35 -e python -m puren_tonbo.tools.ptig\n\nSupport is excellent, can easily change color theme/scheme without changing ALL terminals. Great control over title name.\nOut of the box Emoji (Unicode) font is mono, rather than full color.\nTo enable full color emoji see https://github.com/mintty/mintty/wiki/Tips#emojis\nhttps://github.com/mintty/mintty/wiki/Tips#quick-guide-to-emoji-installation is the least effort option, but slower than manually downloading and extracting.\nOne emoji are installed (to `%APPDATA%\\mintty\\emojis`) open mintty settings \"Options...\", Text, then edit the Style content to point to the directory of downloaded images for emoji.\n\nKnown to work well with mintty; 3.6.4, 3.7.0, 3.7.4, and 3.7.6 as installed by https://github.com/git-for-windows/git (and Python 3.1x).\nNOTE odd title (numbers, forward slash, numbers) with mintty 3.7.4 and 3.7.6 (included with Git 2.46.0 and 2.46.2) and Python 3.12.5 - NOT seen with other versions.\n\nSample config file:\n\n    type \"%USERPROFILE%\\.minttyrc\"\n    cat ~/.minttyrc\n\n    ThemeFile=rosipov\n    Font=Consolas\n    FontHeight=10\n\n\"rosipov\" is a built in theme (there are others, and custom ones can also be added too).\n\n#### Alacritty\n\nhttps://github.com/alacritty/alacritty\n\nNOTE no scroll bar, and looks like there is no intention to support?\nGreat for keyboard only control.\n\nExamples:\n\n    \"C:\\Program Files\\Alacritty\\alacritty.exe\" --title ptig --hold -e C:\\full\\path\\to\\ptig.exe\n\n\n#### Windows Terminal\n\nhttps://github.com/microsoft/terminal/ https://aka.ms/terminal\n\nWhilst Windows Terminal looks great (out of box emoji is in full color font), it is limited compared to mintty. For example no control over title and color scheme is global.\n\nWindows Terminal (with Unicode support, including emoji) WindowsTerminal https://github.com/microsoft/terminal/releases/tag/v1.20.11381.0 works great (or from AppStore https://apps.microsoft.com/detail/9n0dx20hk701)\n\n    wt.exe - `%LOCALAPPDATA%\\Microsoft\\WindowsApps\\wt.exe` or from zip (not AppStore) `WindowsTerminal.exe` (multi color emoji) and `OpenConsole.exe` (single color emoji)\n        how to get taskbar icon showing up?\n\nExamples:\n\n    %LOCALAPPDATA%\\Microsoft\\WindowsApps\\wt.exe C:\\full\\path\\to\\ptig.exe\n\n\n## Examples\n\n    ptconfig\n    python -m puren_tonbo.tools.ptconfig\n    ptconfig --list-formats\n    ptconfig --list-all-formats\n\n\n### ptcat\n\n    ptcat  puren_tonbo/tests/data/aesop.txt\n    ptcat --list-formats\n    python -m puren_tonbo.tools.ptcat --list-formats\n    python -m puren_tonbo.tools.ptcat --note-root . puren_tonbo/tests/data/aesop.txt\n    python -m puren_tonbo.tools.ptcat --note-root . puren_tonbo/tests/data/aesop.chi\n    python -m puren_tonbo.tools.ptcat  puren_tonbo/tests/data/aesop.txt\n\n    ptcat -p password puren_tonbo/tests/data/aesop_linux_7z.aes256.zip\n    python -m puren_tonbo.tools.ptcat -p password puren_tonbo/tests/data/aesop_linux_7z.aes256.zip\n\n\n### ptgrep\n\nA grep, [ack](https://beyondgrep.com/), [ripgrep](https://github.com/BurntSushi/ripgrep), [silver-searcher](https://geoff.greer.fm/ag/), [pss](https://github.com/eliben/pss) like tool that works on encrypted (and plain text) files.\n\nHas similar parameters for ease of switching.\n\nPython 2.7 note for Windows. Non-ascii characters can cause Python exception/crashes UnicodeEncodeError when attempting to print Unicode characters, where as Python 3 does not. ptgrep implements a translation feature/hack which can be disabled (or tweaked) via the Operating System environment variable `PTGREP_STDOUT_MODE. Valid options are `disabled`, `utf8`, and `ascii:backslashreplace`. For Python 2.7 under Microsoft Windows **only** (when neither `PYTHONIOENCODING` nor `PYTHONUTF8` have been set) `ascii:backslashreplace` is the default and works in a similar fashion to `PYTHONIOENCODING`.\n\n    ptgrep better\n    ptgrep -i better\n    python -m puren_tonbo.tools.ptgrep -i better\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data -i better\n    python -m puren_tonbo.tools.ptgrep -e -p password Better\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data -e -p password Better\n\nFind all instances of \"king\", case-insensitive (note; matches `taking`):\n\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data -i king\n\nFind all words \"king\", case-insensitive using a regex:\n\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data -i -r \\bking\\b\n\nFind all instances of \"king\" but not \"aking\", \"iking\", or \"lking\", case-insensitive using a regex:\n\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data -i -r [^ail]king\n\nfind different words with regex\n\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data    -r \"cruel|better\"\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data -i -r \"cruel|better\"\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data    -r \"cru.l|b.tter\"\n\nfind \"-feast\" which looks like a command line argument:\n\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data -- -feast\n\nfind filenames with regex\n\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data -y -r ^aesop\n\nfind filenames that have an ISO date in either dirname or filename\n\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data -y -r \"202[0-9]-[0-9][0-9]-[0-9][0-9]\"\n\nfind filenames encrypted with regex\n\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data -y -e -r ^aesop\n\nfind filenames ONLY encrypted with regex\n\n    python -m puren_tonbo.tools.ptgrep --note-root=puren_tonbo/tests/data -y -k -r ^aesop\n\n### ptnewline_check\n\nCheck for inconsistent newlines in (encrypted) files.\nFix by using force-newline option, with ptrecrypt or ptcipher.\n\n    python -m puren_tonbo.tools.ptnewline_check SINGLE_FILENAME\n    ptnewline_check SINGLE_FILENAME\n\n    ptnewline_check puren_tonbo/tests/data/aesop.rot13\n    ptnewline_check puren_tonbo/tests/data/aesop.chi\n    ptnewline_check -t puren_tonbo/tests/data/aesop.chi\n\n    fd \\.chi --exec-batch  ptnewline_check  {}\n    fd \\.chi -X ptnewline_check -b\n    fd \\.chi$ -X ptnewline_check -b  # ONLY files that end in .chi (above is any file with chi, including backup files)\n\n    find /note/path -type f  -name \\*\\.chi | xargs -d '\\n' ptnewline_check\n    find /note/path -type f  -name \\*\\.chi | xargs -d '\\n' ptnewline_check -b  # only show bad (*.chi) files\n    find /note/path -type f  -name \\*\\.chi | xargs -d '\\n' ptnewline_check -b | cut -d: -f2 | cut -b2-  # only show bad (*.chi) file names only, ready to pipe back into ptrecrypt\n\nFix newlines in files:\n\n    ptrecrypt --force-newline dos --cipher .chi --new_extension .chi --skip_unencrypted --existing-files=replace --force_recrypt_same_format_password  file1.chi file2.chi ...  # specific files\n    ptrecrypt --force-newline dos --cipher .chi --new_extension .chi --skip_unencrypted --existing-files=replace --force_recrypt_same_format_password  .  # directory\n\n### ptrecrypt\n\nHelp:\n\n    Usage: ptrecrypt [options] file_or_dir_pattern1 [file_or_dir_pattern2...]\n\n    Command line tool to (re-)encrypt files. Any files passed on the command line\n    WILL BE encrypted (in the requested format, if none requested original format)\n    unless it is the same format and password. Any directories may have some form\n    of filtering based on type.\n\n    Options:\n      --version             show program's version number and exit\n      -h, --help            show this help message and exit\n      --list-formats        Which encryption/file formats are available\n      --password-prompt=PASSWORD_PROMPT, --password_prompt=PASSWORD_PROMPT\n                            Comma seperated list of prompt mechanism to use,\n                            options; any,text,gui,win32,tk\n      --no-prompt, --no_prompt\n                            do not prompt for password\n      --cipher=CIPHER       Which encryption mechanism to use (file extension used\n                            as hint), use existing cipher if ommited\n      --new-password=NEW_PASSWORD, --new_password=NEW_PASSWORD\n                            new password to use, if omitted use the existing\n                            password\n      -E ENVVAR, --envvar=ENVVAR\n                            Name of environment variable to get password from\n                            (defaults to PT_PASSWORD) - unsafe\n      -p PASSWORD, --password=PASSWORD\n                            password, if omitted but OS env PT_PASSWORD is set use\n                            that, if missing prompt\n      -P PASSWORD_FILE, --password_file=PASSWORD_FILE\n                            file name where password is to be read from, trailing\n                            blanks are ignored\n      -v, --verbose\n      -s, --silent          if specified do not warn about stdin using\n      --force-recrypt-same-format-password, --force_recrypt_same_format_password\n                            For re encryption, even if same file format/container\n                            and password is to be used\n      --destination-directory=DESTINATION_DIRECTORY, --destination_directory=DESTINATION_DIRECTORY\n                            If specified where to write to, if ommited uses same\n                            directory\n      --new-extension=NEW_EXTENSION, --new_extension=NEW_EXTENSION\n                            file extension to append for new files; 'default'\n                            (default for cipher), 'cipher' (what was passed in on\n                            command line), 'retain' (if not changing formats, use\n                            the original file extension) - and potentially\n                            anything else with a period is the new extension to\n                            use, for example '.zip'\n      --skip-encrypted, --skip_encrypted\n                            For directories, skip already encrypted files\n      --skip-unencrypted, --skip_unencrypted\n                            For directories, skip files that are not already\n                            encrypted\n      --existing-files=EXISTING_FILES, --existing_files=EXISTING_FILES\n                            How to handle existing files; resolving files that\n                            already exist; default error/stop, skip,\n                            overwrite/replace/delete (in safe mode - needed for\n                            same file type, new password), delete (after\n                            successful write)\n      --simulate            Do not write/delete/change files\n\n### ptig\n\nCommand line interactive search tool, that also supports viewing and editing.\nRelies on ptgrep, see `PTGREP_STDOUT_MODE` note.\n\nAlso see https://github.com/clach04/puren_tonbo/wiki/tool-ptig\n\n    ptig\n    python -m puren_tonbo.tools.ptig\n\n#### Sample ptig session\n\n    $ ptig --note-root=puren_tonbo/tests/data\n    3.8.10 (default, Mar 15 2022, 12:22:08)\n    [GCC 9.4.0]\n\n    Puren Tonbo puren_tonbo version 0.0.3.git\n    Formats:\n\n                  txt - RawFile - Raw file, no encryption support\n                   md - RawFile - Raw file, no encryption support\n                  chi - TomboBlowfish - Tombo Blowfish ECB (not recommended)\n                  gpg - GnuPG - gpg (GnuPG) symmetric 1.x and 2.x, does NOT uses keys\n                  asc - GnuPGascii - gpg (GnuPG) symmetric 1.x and 2.x, does NOT uses keys\n                  cpt - Ccrypt - ccrypt symmetric Rijndael\n              aes.zip - ZipAES - AES-256 ZIP AE-1 DEFLATED (regular compression)\n           aes256.zip - ZipAES - AES-256 ZIP AE-1 DEFLATED (regular compression)\n               aeszip - ZipAES - AES-256 ZIP AE-1 DEFLATED (regular compression)\n              old.zip - ZipAES - AES-256 ZIP AE-1 DEFLATED (regular compression)\n    openssl_aes256cbc_pbkdf2_10k - OpenSslEnc10k - OpenSSL 1.1.0 pbkdf2 iterations 10000 aes-256-cbc\n     aes256stored.zip - ZipNoCompressionAES - AES-256 ZIP AE-1 STORED (uncompressed)\n        oldstored.zip - ZipNoCompressionAES - AES-256 ZIP AE-1 STORED (uncompressed)\n       aes256lzma.zip - ZipLzmaAES - AES-256 ZIP AE-1 LZMA\n      aes256bzip2.zip - ZipBzip2AES - AES-256 ZIP AE-1 BZIP2\n             vimcrypt - VimDecrypt - vimcrypt 1, 2, 3\n            vimcrypt1 - VimDecrypt - vimcrypt 1, 2, 3\n            vimcrypt2 - VimDecrypt - vimcrypt 1, 2, 3\n            vimcrypt3 - VimDecrypt - vimcrypt 1, 2, 3\n\n    Libs:\n            chi_io.implementation: using PyCrypto 3.15.0\n            python-gnupg version: 0.5.0\n            gpg version: (2, 2, 19)\n            pyzipper version: 0.3.6\n\n    ptig: 🔎 rg better\n    Query time: 0.01 seconds\n    ptig: 🔎 set ic\n    ptig: 🔎 rg better\n    [1] puren_tonbo/tests/data/aesop.txt\n    7:Better no rule than cruel rule.\n    Query time: 0.01 seconds\n    ptig: 🔎 find ccrypt\n    [1] puren_tonbo/tests/data/aesop_win_ccrypt.cpt\n    Query time: 0.00 seconds\n    ptig: 🔎 f ccrypt\n    [1] puren_tonbo/tests/data/aesop_win_ccrypt.cpt\n    Query time: 0.00 seconds\n    ptig: 🔎 cat 0\n    Password for file aesop_win_ccrypt.cpt:\n    ptig: 🔎 set search_encrypted=True\n    ptig: 🔎 rg better\n    [1] puren_tonbo/tests/data/aesop.chi\n    7:Better no rule than cruel rule.\n    ..... Truncated\n    [21] puren_tonbo/tests/data/aesop_win_winrar.aes256stored.zip\n    7:Better no rule than cruel rule.\n    Query time: 0.32 seconds\n    ptig: 🔎 help\n\n    Documented commands (type help \u003ctopic\u003e):\n    ========================================\n    EOF  c    config  edit  f     g     help  ptpyvim  quit     rg   ver      vi\n    bye  cat  e       exit  find  grep  info  pyvim    results  set  version  vim\n\n    ptig: 🔎 exit\n    Quitting...\n\n#### ptig config\n\nConfig for ptig is the regular config file `pt.json`, with additional (optional) ptig section:\n\n```json\n    {\n        \"_version_created_with\": \"0.0.dev3\",\n        \"codec\": [\n            \"utf8\",\n            \"cp1252\"\n        ],\n        \"default_encryption_ext\": \"chi\",\n        \"default_text_ext\": \"txt\",\n        \"note_root\": \"C:\\\\Users\\\\yourname\\\\tombo\",\n        \"ptig\": {\n            \"#init\": [\"set ic\", \"set enc\"],\n            \"init\": [\"set ic\"],\n            \"editor\": \"start scite\",\n            \"editors\": {\n                \"encscite\": \"C:\\\\programs\\\\encscite\\\\prog\\\\encscite.bat\",\n                \"pttkview\": \"pttkview\",\n                \"scite\": \"scite\",\n                \"gvim\": \"gvim\",\n                \"vim\": \"vim\"\n            },\n            \"file_browser\": \"explorer\",\n            \"prompt\": \"ptig: ? \",\n            \"use_pager\": false\n        }\n    }\n```\n\nNOTE options for editor along with `init` which is a **list** of commands to issue on start up.\nFor example, enabling case insensitive search. There is a commented out example which enables encrypted file search.\n\n\n### pttkview\n\nA simple GUI viewer using the tk toolkit:\n\n    python -m puren_tonbo.tools.pttkview -h\n    pttkview -h\n\n### ptpyvim\n\nIf pyvim is available, ptpyvim wraps encryption/decryption support.\n\n    ptpyvim\n    python -m puren_tonbo.tools.ptpyvim\n\n### ptdiff3merge\n\na 3-way diff and merge tool.\nDefaults to outputing plaintext to stdout, can be an encrypted file output.\nEach file can be encrypted with differnent methods BUT any encrypted files must all use the same password.\n\n    ptdiff3merge\n    python -m puren_tonbo.tools.ptdiff3merge\n\n\n### ptcipher\n\nptcipher is a tool for dealing with raw (binary, i.e. bytes rather than characters) files for encryption/decryption.\nAll options are controlled via command line flag and operating system environment variables.\n\nAssuming installed:\n\n    ptcipher -h\n\nFrom source code checkout:\n\n    python -m puren_tonbo.tools.ptcipher -h\n    python -m puren_tonbo.tools.ptcipher --list-formats\n    python2 -m puren_tonbo.tools.ptcipher -h\n    python3 -m puren_tonbo.tools.ptcipher -h\n\nQuick demo:\n\n    ptcipher --password password --decrypt puren_tonbo/tests/data/aesop.chi\n    ptcipher --password password --decrypt puren_tonbo/tests/data/aesop_linux_7z.aes256.zip\n    python -m puren_tonbo.tools.ptcipher --password password --decrypt puren_tonbo/tests/data/aesop.chi\n\n\n#### rot-13\n\nSymmetric Substitution cipher with no passphrase/password/key support.\nDo not use, this is implemented as a demo and for testing code paths when encryption libraries are not available.\n\nhttps://en.wikipedia.org/wiki/ROT13\n\n    ptcipher -e -p test README.md -o README.rot13\n\n    ptcipher -v -p test README.rot13\n    ptcipher -p password_ignored puren_tonbo/tests/data/aesop.rot13\n    py -3 -m puren_tonbo.tools.ptcipher puren_tonbo/tests/data/aesop.rot13 -p password_ignored\n\n    echo Why did the chicken cross the road?|ptcipher -p ignored_password  --encrypt --cipher=rot13\n    echo Jul qvq gur puvpxra pebff gur ebnq?|ptcipher -p ignored_password  --encrypt --cipher=rot13\n\nIf using vim, can also use `g?` to rot-13 text. For example; selected text, whole file, etc.\n\n#### rot-47\n\nSymmetric Substitution cipher with no passphrase/password/key support.\nDo not use, this is implemented as a demo and for testing code paths when encryption libraries are not available.\n\nhttps://en.wikipedia.org/wiki/ROT13#Variants\n\n    ptcipher -p password_ignored puren_tonbo/tests/data/aesop.rot47\n\n    py -3 -m puren_tonbo.tools.ptcipher puren_tonbo/tests/data/aesop.rot47 -p password_ignored\n\n#### gzip\n\nNo encryption, gzip compressed files - no passphrase/password/key support.\n\n    ptcipher -p password_ignored puren_tonbo/tests/data/aesop.txt.gz\n    py -3 -m puren_tonbo.tools.ptcipher -p password_ignored puren_tonbo/tests/data/aesop.txt.gz\n\nNOTE Python 2 support for gz files is missing do to API differences in zlib.\n\nNOTE files named .tar.gz will be picked up, they are NOT ignored.\nTODO feature to ignore tar files (raw, gz, bz2, etc.)\n\n#### jenc / Markor / jpencconverter\n\nSymmetric encryption/decryption from passphase.\n\nFormat that [Markor](https://github.com/gsantner/markor) supports [jenc format](https://github.com/opensource21/jpencconverter).\n\n    py -3 -m puren_tonbo.tools.ptcipher -p password puren_tonbo/tests/data/test_winnewlines.v001.jenc\n    py -3 -m puren_tonbo.tools.ptcipher -p password puren_tonbo/tests/data/test_winnewlines.u001.jenc  # Old, legacy format\n\nJenc settings, application.properties contents:\n\n    filesearch.depth=10\n    # paths can be unix, i.e. '/'\n    # or under Windows, can be either Unix style or Windows. For Windows paths need to escape, for example; 'C:\\\\some\\\\\\dir'\n    filesearch.encdir=C:\\\\code\\\\java\\\\jpencconverter\\\\bins\\\\jpenc-converter_0.2.1\\\\enc\n    #filesearch.decdir=C:\\\\code\\\\java\\\\jpencconverter\\\\bins\\\\jpenc-converter_0.2.1\\\\plain\n    filesearch.decdir=/code/java/jpencconverter/bins/jpenc-converter_0.2.1/plain\n    extension.encrypt=.jenc\n    extensions.plainText=md, markdown\n    #password=geheim\n    password=password\n    # For android-devices before Android 8 use U001\n    #encryption.version=U001\n    encryption.version=V001\n\nCommand line, note operates on directories NOT file (names) like most command line crypto tools:\n\n    java.exe -jar jpencconverter-0.2.1.jar encrypt\n    java.exe -jar jpencconverter-0.2.1.jar decrypt\n\n#### Tombo Blowfish CHI\n\nSymmetric encryption/decryption from passphase.\n\nCompatible with http://tombo.osdn.jp/En/ (and others, for example, Kumagusu on Android).\n\n    ptcipher -e -p test README.md -o README.chi\n\n    ptcipher -v -p test README.chi\n\nThe chi/chs file can also be read/written by Tombo http://tombo.sourceforge.jp/En/ and clones (for example, Kumagusu).\n\n\n#### Age encryption\n\nNOTE age passphrase encryption, not key.\n\nCan either use Python library or age exe/binary - NOTE binary is signifcantly faster, there are also decryption failures wiht pyage!\nAge exe from https://github.com/wj/age recommended which implements support for password from environment variable\nFor more details see:\n  * https://github.com/FiloSottile/age/pull/520\n      * https://github.com/FiloSottile/age/pull/520#issuecomment-2760007480\n      * https://github.com/FiloSottile/age/pull/520#issuecomment-2993644928\n      * https://github.com/clach04/age/tree/pr520_osenv_password - backup of the change that Puren Tonbo expects\n      * Related\n          * https://github.com/FiloSottile/age/discussions/275\n  * Go build notes\n      * https://go.dev/doc/tutorial/compile-install\n      * https://opensource.com/article/22/4/go-build-options\n\nProblems:\n\n  * Weird characters in place of terminal escape sequences on Windows Console - https://github.com/FiloSottile/age/issues/474\n  * pyage notes\n      * errors opening an age encrypted file that works fine with age/rage - https://github.com/jojonas/pyage/issues/14\n\n#### ccrypt CPT\n\nSymmetric encryption/decryption from passphase.\n\nTested with ccrypt 1.11 and 1.10 (32-bit and 64-bit Intel x86/x64 and arm).\n\nRequires a ccrypt binary, download from https://ccrypt.sourceforge.net/\n(or debian apt). ccrypt binary/executable needs to be in the path or\nthe environment variable CCRYPT_EXE needs to have the (full) path.\nNOTE Under Microsoft Windows, is the ccrypt.exe is in a path with\nspaces, do NOT use double quotes in the SET. Example: `set CCRYPT_EXE=C:\\3rd party bins\\ccrypt.exe`\n\n    python -m puren_tonbo.tools.ptcipher --password password puren_tonbo/tests/data/aesop_win_ccrypt.cpt\n    ptcipher --cipher=cpt -e -p test README.md -o README.cpt\n    python -m puren_tonbo.tools.ptcipher --cipher=cpt -e -p test README.md -o README.cpt\n\n    ccrypt -c README.cpt\n    ccrypt -c -K test README.cpt\n\n#### OpenPGP - gpg / pgp\n\nSymmetric encryption/decryption from passphase, key support not explictly implemented. RFC-4880 sec 5.13 (Symmetrically Encrypted Integrity Protected Data packet) OCFB-MDC.\nAES256.CFB ?\n\nDepending on which gpg Python module is installed **might require** a gpg binary, download from https://gnupg.org/download/ or use one provided by Git For Windows.\n\nGit for Windows, add to path:\n\n    path %PATH%;\"C:\\Program Files\\Git\\usr\\bin\\\"\n\nAlternatively, set exe full path:\n\n    set GPG_EXE=\"C:\\Program Files\\Git\\usr\\bin\\gpg.exe\"\n\nSamples:\n\n    set GPG_EXE=C:\\Program Files\\Git\\usr\\bin\\gpg.exe\n    python -m puren_tonbo.tools.ptcipher --cipher=asc -e -p test README.md -o README.asc\n    python -m puren_tonbo.tools.ptcipher --cipher=gpg -e -p test README.md -o README.gpg\n    ptcipher -p password puren_tonbo/tests/data/aesop_win_encryptpad.asc\n    echo secret stuff| ptcipher --cipher=asc -e   # prompt for password\n    echo secret stuff| ptcipher --cipher=asc -e -p password\n\n    gpg --pinentry-mode=loopback --decrypt  --passphrase test README.gpg\n    gpg --pinentry-mode=loopback --no-tty --no-verbose --decrypt  --passphrase password puren_tonbo/tests/data/aesop_win_encryptpad.asc\n    gpg -d puren_tonbo/tests/data/aesop_win_encryptpad.asc   # Will prompt\n    echo password| gpg --pinentry-mode loopback --passphrase-fd 0 --decrypt  puren_tonbo/tests/data/aesop_win_encryptpad.asc  # no prompt - note potentially issues with Git for Windows provided gpg.exe, appears that newline causes issues. Redirect from (password) file is fine\n\ngpg command line for encrypt:\n\n    echo password| gpg --pinentry-mode loopback --passphrase-fd 0 --symmetric --armor -o - plain_text.txt  # ASCII armor to stdout\n    echo password| gpg --pinentry-mode loopback --passphrase-fd 0 --symmetric         -o - plain_text.txt  # Binary (i.e. no ASCII armor) to stdout\n    echo password| gpg --pinentry-mode loopback --passphrase-fd 0 --symmetric --armor plain_text.txt  # FIXME writes to disk not stdout\n    gpg --pinentry-mode loopback --status-fd 2 --no-tty --no-verbose --fixed-list-mode --batch --with-colons --passphrase-fd 0 --symmetric --armor\n    echo secret stuff| gpg --pinentry-mode loopback --status-fd 2 --no-tty --no-verbose --fixed-list-mode --batch --with-colons --passphrase-fd 0 --symmetric --armor\n\nencrypt with prompt:\n\n    gpg --status-fd 2 --no-tty --no-verbose --fixed-list-mode --batch --with-colons  --symmetric --armor\n\nAlso known to work with:\n\n\n  * EncryptPad (cross platform, QT) from https://github.com/evpo/EncryptPad\n      * `EncryptPad` - GUI tool encrypted text editor, with word-wrap, search/find, find and replace\n      * `encryptcli` - command line , example usage that prompts for password:\n\n            encryptcli.exe --decrypt aesop_win_encryptpad.asc\n\n  * GpgFrontend (cross platform QT) from https://github.com/saturneric/GpgFrontend/\n      * includes gpg command line tools, acts as a GUI front end and offers editing encrypted text files (NOTE EncryptPad easier/faster to use for this)\n\n  * [OpenKeychain (for Android)](https://github.com/open-keychain/open-keychain)\n    can encrypt/decrypt files and the clipboard, as well as Share-To Intent.\n\n  * EncryptedNotepad2 (cross platform) from https://github.com/ivoras/EncryptedNotepad2/\n      * According to https://github.com/ivoras/EncryptedNotepad2/issues/4 should be compatible.\n\nNOTES\n\nWindows issues with Git for Windows provided gpg exe, CTRL-Z interactive does not trigger encrypt/decrypt for:\n\n    gpg.exe --pinentry-mode loopback --passphrase-fd 0 --symmetric --armor  -\n\nBut newer seems fine:\n\n    C:\\\u003e....\\gpg.exe --version\n    gpg (GnuPG) 2.4.8\n    libgcrypt 1.11.1\n    Copyright (C) 2025 g10 Code GmbH\n    License GNU GPL-3.0-or-later \u003chttps://gnu.org/licenses/gpl.html\u003e\n    This is free software: you are free to change and redistribute it.\n    There is NO WARRANTY, to the extent permitted by law.\n\n    Home: %APPDATA%\\gnupg\n    Supported algorithms:\n    Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA\n    Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,\n            CAMELLIA128, CAMELLIA192, CAMELLIA256\n    Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224\n    Compression: Uncompressed, ZIP, ZLIB, BZIP2\n\n    C:\\\u003e\"C:\\Program Files\\Git\\usr\\bin\\gpg.exe\" --version\n    gpg (GnuPG) 2.2.41-unknown\n    libgcrypt 1.9.4-unknown\n    Copyright (C) 2022 g10 Code GmbH\n    License GNU GPL-3.0-or-later \u003chttps://gnu.org/licenses/gpl.html\u003e\n    This is free software: you are free to change and redistribute it.\n    There is NO WARRANTY, to the extent permitted by law.\n\n    Home: /c/Users/USERNAME/.gnupg\n    Supported algorithms:\n    Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA\n    Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,\n            CAMELLIA128, CAMELLIA192, CAMELLIA256\n    Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224\n    Compression: Uncompressed, ZIP, ZLIB, BZIP2\n\n\n#### OpenSSL 1.1.0 AES\n\nOpenSSL 1.1.0+ compatible (with a very small subset of options).\n\n    ptcat --note-root=. puren_tonbo/tests/data/aesop_win.openssl_aes256cbc_pbkdf2_10k\n\nIntended to allow decryption of files generated with OpenSSL 1.1.0 and vice-versa. Supported OpenSSL flags/formats, see https://linux.die.net/man/1/openssl:\n\n    openssl enc -e aes-256-cbc -salt -pbkdf2 -iter 10000 -in in_file -base64 -out out_file\n    openssl dec -d aes-256-cbc -salt -pbkdf2 -iter 10000 -in in_file -base64 -out out_file\n\n    echo hello| openssl enc -e aes-256-cbc -salt -pbkdf2 -iter 10000 -in - -base64 -out - -pass env:SET_OS_VAR_PASSWORD\n    echo hello| openssl enc -e aes-256-cbc -salt -pbkdf2 -iter 10000 -in - -base64 -out - -pass pass:password\n    echo hello| openssl enc -e -aes-256-cbc -in - -out - -salt -pbkdf2 -iter 10000  -pass pass:password\n\nNOTE PBKDF2 iteration count of 10,000 is the default in OpenSSL 1.1.1 and is considered too few in 2023.\nOlder versions of OpenSSL did not support; PBKDF2 (and ergo iterations) and salt and used a much weaker KDF.\nSee https://www.openssl.org/docs/manmaster/man1/openssl-enc.html for more information.\n\nSupports binary/raw and base64 encoded/ASCII armored files.\nONLY supports aes-256-cbc with salt and pbkdf2 KDF with 10,000 interations.\n\n#### AES-256 zip\n\nSymmetric encryption/decryption from passphase. See https://github.com/clach04/puren_tonbo/wiki/format-zip\n\n    ptcipher -e -p test README.md -o README.aes256.zip\n\n    ptcipher -p test README.aes256.zip\n\nThe aes256.zip file can also be read/written by 7-Zip, WinRAR, WinZIP, etc. that support AES zip files.\n\nFor example, 7z can read and write AES zip files:\n\n    7z a -tzip -mem=AES256 -ptest README.aes256.zip README.md\n    7z x -ptest README.aes256.zip\n\nfor more 7z command line options see https://github.com/axelstudios/7z\n\n#### VimCrypt\n\nSymmetric encryption/decryption from passphase.\n\nNOTE not implemented in nvim / neovim.\n\nIn vim the easiest way to get the newest encryption mode/format, for a file:\n\n    vim -c \":setlocal cm=blowfish2\"  test.vimcrypt3\n\nthen issue:\n\n    :X\n\nwill be prompted for password, can then edit/save as per normal.\n\nTo see encryption mode:\n\n    :setlocal cm?\n\nptcipher demo:\n\n    python -m puren_tonbo.tools.ptcipher -p test test.vimcrypt3\n\n\n## ptcat/ptcipher with text editors like vim\n\n### readonly pipe into editor\n\nQuick and easy view/read ONLY of encrypted file with vim, without updating vim config.\n\nNOTE call vim (or neovim) with options to set \"private\" mode:\n\n  * `-` to read from stdin instead of a filename, avoid plaintext hitting the disk\n  * `-n` turns off swap file - use memory only\n  * `-i` turns off .viminfo\n\nTODO disable undo file\n\n\n  1. Use a pipe (cross platform)\n\n            ptcat FILE | vim - -n -i \"NONE\"\n\n  2. Use bash shell [process substitution](http://www.tldp.org/LDP/abs/html/process-sub.html) feature for editors that don't support stdin (Linux/Unix only, avoids directly calling mkfifo and cleaning up named pipes)\n\n            scite \u003c (ptcat FILE)\n            ptcat FILE | scite /dev/stdin\n            scite \u003c(python -m puren_tonbo.tools.ptcat  puren_tonbo/tests/data/aesop.txt)\n\nPuren Tonbo will prompt for passwords and the decrypted content should not hit the file system.\n\n\nOption 1 can be used with other tools that take in stdin, option 2 can be used with any tool that takes in a filename.\n\nCaution!\n\n  * don't save the raw file\n  * ensure now backup, swap, undo file, etc.. get created\n\n\nhttps://vi.stackexchange.com/questions/6177/the-simplest-way-to-start-vim-in-private-mode\n\n### git diff integration support\n\nAllow diff'ing encrypted or compressed files that have been modified.\n\n  * `git diff` - regular diff\n  * `git diff --word-diff` - word based diff\n  * with and without password prompt (e.g. mention `PT_PASSWORD` environment variable)\n\nPassword will be prompted twice:\n\n  * once for original file\n  * second for modified file\n\nSee integrations/git/README.md for more details and install/setup instructions.\n\n### SciTE lua plugin\n\nTested with versions: v4.0.0, 4.1.5, and 5.3.5\n\nSee [pt_scite.lua](integrations/scite/pt_scite.lua) - read and write support (tested Windows).\nNOTE due to lua popen() any helpful error text/information is missing. Diagnosing failures can be difficult, even for trivial errors like directory/disk does not exist as this is not reported to the lua runtime.\nAlso see SciTE Python plugin for read and write support with stderror support.\n\nBy default uses `ptcipher` in path, override via `PTCIPHER_EXE` environment variable.\n\nDoes NOT prompt for password, requires setting `PT_PASSWORD` environment variable or use of keyring.\n\n  * Can be used standalone or with ParsKorata (http://lua-users.org/wiki/ParsKorata) mini/simple ExtMan compatible script\n  * Untested with ExtMan - http://lua-users.org/wiki/SciteExtMan\n\nNeed to edit SciTEUser.properties:\n\n  * Windows\n      * `%USERPROFILE%\"\\SciTEUser.properties` or `%APPDATA%\\scite\\SciTEUser.properties`\n  * Unix\n      * `~/.SciTEUser.properties` or `$HOME/.SciTEUser.properties`\n\nAlternatively, launch scite, then open Options, Open User (or GLobal) Options File.\n\nWindows NOTE to avoid a (typically black) CMD/Command window showing up use SciTE 4.4.4 or later and set `create.hidden.console` in SciTEUser.properties:\n\n    # https://groups.google.com/g/scite-interest/c/QOhizNSEejU/m/qXslloxnCgAJ\n    # SciTE 4.4.4 on Windows adds create.hidden.console option to stop console window flashing when Lua script calls os.execute or io.popen.\n    create.hidden.console=1\n    # TODO see if this can be set in lua code, to make config easier\n\n#### SciTE lua install without extension manager\n\nIf not using a plugin extension manager can simply set `pt_scite.lua` as starting lua script.\nEdit SciTEUser.properties to set lua script:\n\n    ...\n    ext.lua.startup.script=C:\\code\\py\\puren_tonbo\\pt_scite.lua\n    create.hidden.console=1\n    ...\n\n#### SciTE lua install with an extension manager\n\nIf using an extman like system:\n\n    ...\n    # This is a simplified ExtMan\n    # requires each plugin/add-on to be \"registered\" or declared, white listed, etc.\n    ext.lua.startup.script=C:\\code\\scite\\extman\\parskorata_extman.lua\n    ...\n\nThen edit `parskorata_extman.lua` to add to end:\n\n    mgr:load_files{'pt_scite.lua'}\n\nNOTE not needed with original full ExtMan.\n\n\n### SciTE Python plugin\n\nSee [scite with Python README](integrations/pt_scite_with_python/README.md) - read and write support, Windows only (needs polishing).\n\nBy default uses `ptcipher` in path, override via `PTCIPHER_EXE` environment variable.\n\nDoes NOT prompt for password, requires setting `PT_PASSWORD` environment variable.\n\n\n### vim plugin\n\nTested under Linux with vim 8.0 and 8.1. under x86, x64, and arm 32-bit.\n\nSee [pt.vim](integrations/vim/pt.vim) - Linux/Unix/Cygwin only for now.\n\nBy default uses `ptcipher` in path, override via `PTCIPHER_EXE` environment variable.\n\nWill prompt for password, which can be skipped by setting `PT_PASSWORD` environment variable.\n\n#### vim demo\n\nAssuming puren_tonbo has been installed and `ptcipher` is in the\npath (and in source code checkout):\n\n    vim -u pt.vim  puren_tonbo/tests/data/aesop.chi\n\nAnd enter in the test password, `password`.\n\n#### vim plugin install\n\nAs per example above, can use the `-u` parameter but this overrides existing settings.\n\nVim 8 supports plugins packs, to install:\n\n#### vim plugin install linux/unix\n\nIf you do not already have any plugin packs, need to create directory, e.g.:\n\n    mkdir -p ~/.vim/pack/bundle/start/\n\nWhere `bundle` is user decided. For the rest of the documentation replace `bundle` with your directory name.\n\nInstall from checkout:\n\n    mkdir -p ~/.vim/pack/bundle/start/puren_tonbo/plugin/\n    cp pt.vim ~/.vim/pack/bundle/start/puren_tonbo/plugin/\n\nThen can call vim without `-u`:\n\n    vim puren_tonbo/tests/data/aesop.chi\n    gvim puren_tonbo/tests/data/aesop.chi\n\n\n#### vim plugin install Microsoft Windows\n\nNOTE not working under Windows :-(\nAppear to be buffered files issues with vim/python interaction.\n\nSee linux notes, instead of `~/.vim` use %USERPROFILE%\\vimfiles (or `$VIM_INSTALLATION_FOLDER\\vimfiles`)\n\n    mkdir %USERPROFILE%\\vimfiles\\pack\\bundle\\start\\puren_tonbo\\plugin\n    copy pt.vim %USERPROFILE%\\vimfiles\\pack\\bundle\\start\\puren_tonbo\\plugin\n\n\n#### vim config notes\n\nSee https://vim.fandom.com/wiki/Encryption for how to configure vim with external tools for (view and edit) of encrypted files with autocmd.\nNOTE under Windows buffered IO can interfere with vim interactions.\nTODO consider using (OpenSSL) https://www.vim.org/scripts/script.php?script_id=2012 as a model for vim plugin (uses functions), also see:\n\n  * https://aweirdimagination.net/2019/03/24/encrypted-files-in-vim/ https://git.aweirdimagination.net/perelman/openssl.vim\n  * https://github.com/MoserMichael/vimcrypt2.\n      * https://github.com/MoserMichael/vimcrypt\n\n\n\n## Development and testing\n\nPuren Tonbo is implemented in Python, with support for Python 3.x and 2.7.\n\n\n### Run test suite\n\n    python -m puren_tonbo.tests.testsuite\n    python -m puren_tonbo.tests.testsuite -v 2\u003e\u00261 |grep -i skipped\n\n### High Level Overview\n\nAll encryption/decryption is file object based.\nLow level routines (EncryptedFile) use file-like objects, for in-memory encryption/decryption use BytesIO\n(see test suite, `puren_tonbo/tests/testsuite.py`).\n\nThere is also the note abstraction (FileSystemNotes) which is filename based.\n\nSimple file-like API available with:\n\n  * `FileLike` class which wraps a file object using a Puren Tonbo file (encryption) object\n  * `pt_open()` which is similar to the regular Python open() function but will read/write encrypted files. File type is determined by file extension. Unrecognized file extension treated as raw (text).\n\nQuick demo:\n\n    import os\n\n    import puren_tonbo\n\n    # read\n    pt_root_dir = os.path.dirname(puren_tonbo.__file__)\n    test_filename = os.path.join(pt_root_dir, 'tests', 'data', 'aesop.chi')\n    print(test_filename)\n\n    open = puren_tonbo.pt_open  # monkey patch time!\n    with open(test_filename) as f:\n        print('%r' % f.read())\n\n    f = open(test_filename)\n    print('%r' % f.read())\n    f.close()\n\n\n    # write\n    test_filename = 'test.zip'\n    f = open(test_filename, 'w')\n    f.write('hello')\n    f.close()\n\n\n## Thanks\n\nThanks and kudos to:\n\n  * Tomohisa Hirami - the original creator of Tombo\n  * [maxpat78](https://github.com/maxpat78) for the Python 2 (and 3) fall back code for AES zip support, [relicensed with permission](https://github.com/maxpat78/CryptoPad/issues/2) from https://github.com/maxpat78/CryptoPad\n  * Noah Spurrier who's Public Domain OpenSSL vim plugin is the inspiration for the PT vim support (using functions) https://www.vim.org/scripts/script.php?script_id=2012\n\n## TODO\n\nTODO padlock and case insensitive ic in prompt - Windows terminal 2, ConEMu (https://conemu.github.io/ https://github.com/Maximus5/ConEmu) etc.?\n    unlocked padlock for password present?\n    key for searching for encrypted files?\n    padlock for NOT searching for crypted files (or reverse?)\nscite refuses to create new chi files if file was originally missing on open\n    new window/instnace (not tab), copy/paste and then close orig ad save as workaround seems to work\n    if file gets creted and scite reloads, still fails to save - trigger for successful load didn't reset trigger variable\nptig - with list of dirs, set shows note_root=None (ptconfig works fine)\nstripe colors ptgrep/ptig\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclach04%2Fpuren_tonbo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclach04%2Fpuren_tonbo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclach04%2Fpuren_tonbo/lists"}