{"id":19687154,"url":"https://github.com/trinitronx/vncpasswd.py","last_synced_at":"2025-08-23T15:36:24.887Z","repository":{"id":3188166,"uuid":"4220680","full_name":"trinitronx/vncpasswd.py","owner":"trinitronx","description":"A Python implementation of vncpasswd, w/decryption abilities \u0026 extra features ;-)","archived":false,"fork":false,"pushed_at":"2021-09-08T08:03:24.000Z","size":147,"stargazers_count":99,"open_issues_count":4,"forks_count":34,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-29T07:40:57.253Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trinitronx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["trinitronx"],"liberapay":"trinitronx","custom":["https://paypal.me/JamesCuzella"]}},"created_at":"2012-05-04T01:52:55.000Z","updated_at":"2025-01-28T14:58:35.000Z","dependencies_parsed_at":"2022-09-16T00:22:41.236Z","dependency_job_id":null,"html_url":"https://github.com/trinitronx/vncpasswd.py","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/trinitronx/vncpasswd.py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fvncpasswd.py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fvncpasswd.py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fvncpasswd.py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fvncpasswd.py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinitronx","download_url":"https://codeload.github.com/trinitronx/vncpasswd.py/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinitronx%2Fvncpasswd.py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271754822,"owners_count":24815292,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"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":[],"created_at":"2024-11-11T18:33:15.761Z","updated_at":"2025-08-23T15:36:24.821Z","avatar_url":"https://github.com/trinitronx.png","language":"Python","funding_links":["https://github.com/sponsors/trinitronx","https://liberapay.com/trinitronx","https://paypal.me/JamesCuzella","https://liberapay.com/trinitronx/donate"],"categories":[],"sub_categories":[],"readme":"vncpasswd.py\n============\n[![Build Status](http://img.shields.io/travis/trinitronx/vncpasswd.py.svg)](https://travis-ci.org/trinitronx/vncpasswd.py)\n[![Donate using Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/trinitronx/donate)\n[![Downloads](https://img.shields.io/github/downloads/trinitronx/vncpasswd.py/latest/total.svg)](https://github.com/trinitronx/vncpasswd.py/releases/)\n\nPython implementation of vncpasswd, w/decryption abilities \u0026 extra features ;-)\nTested on Python 2.7.3.  (Does not currently work with Python 3)\n\nList of Extra Features:\n-----------------------\n\n - File input and output\n - Decryption / Password recovery!\n - Supports RealVNC long passwords!\n - Hex input and output\n - Read/Write to windows RealVNC registry key\n\nLong password decryption tested against RealVNC Enterprise Edition, \nversion: _E4.5.3 (r39012)_ 64-bit (x64) unicode\n\nWindows Registry I/O tested on Windows 7 x64 Professional\n\nSponsor\n-------\n\nIf you find this project useful and appreciate my work,\nwould you be willing to click one of the buttons below to Sponsor this project and help me continue?\n\n- \u003cnoscript\u003e\u003ca href=\"https://github.com/sponsors/trinitronx\"\u003e:heart: Sponsor\u003c/a\u003e\u003c/noscript\u003e\n- \u003cnoscript\u003e\u003ca href=\"https://liberapay.com/trinitronx/donate\"\u003e\u003cimg alt=\"Donate using Liberapay\" src=\"https://liberapay.com/assets/widgets/donate.svg\"\u003e\u003c/a\u003e\u003c/noscript\u003e\n- \u003cnoscript\u003e\u003ca href=\"https://paypal.me/JamesCuzella\"\u003e\u003cimg src=\"https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif\" border=\"0\" alt=\"Donate with PayPal\" /\u003e\u003c/a\u003e\u003c/noscript\u003e\n\nPython Installation:\n-------------------\n\nThis python script was built with and only supports Python 2! If you are from the future, or accessing this via the [GitHub Arctic Code Vault 02/02/2020][5], First of all... congratulations on surviving!  If this code is useful to you, you may need to obtain a version of Python 2.7.  Alternatively, you may use the Python `2to3` utility to convert this source code for use with Python 3 (may take some testing \u0026 development to get working on all platforms).\n\nTo install Python 2.7.17 (Latest version as of 01/28/2020. Python 2 End of Life was 01/01/2020):\n\n### macOS / Linux:\nIf your system does not have an available `python2` in `PATH` linked:\n\n    # Make sure you have build dependencies installed on your platform:\n    # For example: GNU make, gcc / g++ compiler, build-essential package, etc...\n    # Find and/or download Python 2.7\n    curl -L -o /tmp/python-v2.7.17.tar.gz https://github.com/python/cpython/archive/v2.7.17.tar.gz\n    tar -xvf /tmp/python-v2.7.17.tar.gz\n    cd cpython-2.7.17/\n    ./configure\n    make\n    sudo make install\n    # OR: sudo make altinstall\n    \n    # Symlink `python2` to the resulting python2.7 binary\n    # For example:\n    ln -sf /usr/local/bin/python2.7 /usr/local/bin/python2\n\nAlternatively, use [`pyenv`][8]:\n\n- If on macOS, Homebrew method is preferred:\n\n        brew install pyenv\n\n- Otherwise, install via [`pyenv-installer`][9] script \u0026 restart your shell:\n\n        curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash\n        exec $SHELL\n\n- Build \u0026 Compile Python 2.7\n\n        pyenv install 2.7.17\n\n- Use `pyenv` in a shell with:\n\n        eval \"$(pyenv init - )\"\n\n\n### Windows:\n\nTo install Python and get familiar with Visual Studio's Python development\ntools on Windows platforms, refer to [Getting Started with Python in VS Code][10].\nThe official [Python Downloads][11] page should have `.msi` installers available\nfor your Windows platform: (`x86-64 MSI installer`, `x86 MSI installer`).\n\n#### Building cPython\n\nBuilding cPython on Windows, is a more advanced topic that is out of scope for\nthis guide.\nPlease refer to the [`python/cpython/PCbuild/readme.txt`][6] for\nWindows-specific build instructions (Microsoft Visual Studio 2017).\nThe basic idea is to make sure you have build \u0026 compilation dependencies\ninstalled for Windows platform, and run the `build.bat` script.\n\nExcerpt:\n\n\u003e Building Python using the build.bat script\n\u003e ----------------------------------------------\n\u003e \n\u003e In this directory you can find build.bat, a script designed to make\n\u003e building Python on Windows simpler.  This script will use the env.bat\n\u003e script to detect either Visual Studio 2017 or 2015, either of\n\u003e which may be used to build Python. Currently Visual Studio 2017 is\n\u003e officially supported.\n\u003e \n\u003e By default, build.bat will build Python in Release configuration for\n\u003e the 32-bit Win32 platform.  It accepts several arguments to change\n\u003e this behavior, try `build.bat -h` to learn more.\n\nMore modern versions of VS Code have Extensions for Python and CMake support.\nYou may wish to refer to [Getting Started with Python in VS Code][10].\nIn addition, Windows Subsystem for Linux may allow you to run, and build this\nproject using native Linux tools.  Again, this is beyond the scope of this\nguide because it is assumed that you know how to use these tools if you need\nthem.\n\nInstallation:\n-------------\n\nThis project installs from source via:\n\n    git clone https://github.com/trinitronx/vncpasswd.py.git vncpasswd.py\n    cd vncpasswd.py\n    python2 ./vncpasswd.py --help\n\nNote: The \"shebang\" line at the top of the python script is: `#!/usr/bin/env python2`\n\nIf you have `python2`, and `/usr/bin/env` binaries available in your system's `PATH`, you should be all set up to just run the executable script file as-is: `./vncpasswd.py`\n\nOn Windows, this command will work in PowerShell.  However, it will open a\n`cmd.exe` window and close it too quickly to see any output.  If you require an\ninteractive terminal experience, run with `python.exe`.  For example\n\n    python.exe .\\vncpasswd.py --help\n\nTo build a Docker image, or Python Source Distribution, see below or run `make help` to see all available `Makefile` targets.\n\nUsage:\n------\n\nThe `help` output explains the command line flags:\n\n\u003e usage: vncpasswd.py [-h] [-d] [-e] [-H] [-R] [-f FILENAME] [-t] [passwd]\n\u003e \n\u003e Encrypt or Decrypt a VNC password\n\u003e \n\u003e positional arguments:\n\u003e   passwd                A password to encrypt\n\u003e \n\u003e optional arguments:\n\u003e\n\u003e   -h, --help            show this help message and exit\n\u003e\n\u003e   -d, --decrypt         Decrypt an obfuscated password.\n\u003e\n\u003e   -e, --encrypt         Encrypt a plaintext password. (default mode)\n\u003e\n\u003e   -H, --hex             Assume input is in hex.\n\u003e\n\u003e   -R, --registry        Input or Output to the windows registry.\n\u003e\n\u003e   -f FILENAME, --file FILENAME\n\u003e\n\u003e                         Input or Output to a specified file.\n\u003e\n\u003e   -t, --test            Run the unit tests for this program.\n\n### Docker:\n\nThe docker container is ready-built with all dependencies needed.  Just mount in your file (e.g.: `-v $HOME/.vnc/:$HOME/.vnc`, or just `-v $HOME:$HOME`), and run:\n\n    # Decrypt ~/.vnc/passwd\n    docker run -ti -v $HOME:$HOME -w $HOME  trinitronx/vncpasswd.py -d -f ~/.vnc/passwd\n    \n    # More Examples:\n    # Encrypt string 'foo'\n    docker run  -v $HOME:$HOME -w $HOME -ti trinitronx/vncpasswd.py -e 'foo'\n    # Encrypt string 'bar' and output to ~/.vnc/passwd\n    mkdir -p $HOME/.vnc/\n    docker run  -v $HOME:$HOME -w $HOME -ti trinitronx/vncpasswd.py -e 'foo' -f ~/.vnc/passwd\n    # Encrypt string 'bar' as HEX input\n    docker run  -v $HOME:$HOME -w $HOME -ti trinitronx/vncpasswd.py -e -H '6261720000000000'\n    # Decrypt the encrypted password 'bar' as HEX input\n    docker run  -v $HOME:$HOME -w $HOME -ti trinitronx/vncpasswd.py -d -H '9ca3f3686574f277'\n\nTesting:\n--------\n\nThis project used TravisCI for Continuous Integration \u0026 Continuous Deployment to Docker Hub.  The `.travis.yml` contains the build steps.  To manually run the tests for this project:\n    \n    make test\n\nPython Source Distribution:\n---------------------------\n\nFirst install build dependencies from `./build/build-requirements.txt`.\n\n    make build-depends\n\nNote: This should run the following command. You may need to use `pip2` depending on your installed python version.\n\n    pip install --user -r ./build-aux/build-requirements.txt\n\nTo create a python source distribution via `setuptools`:\n\n    make setup\n\nOutput files are placed in `dist/` directory.\n\nPython Binary Distribution:\n---------------------------\n\nFirst install build dependencies from `./build/build-requirements.txt`.\n\n    make build-depends\n\nTo create a python binary distribution via `setuptools`:\n\n    make bdist\n\nOutput files are placed in `dist/` directory.\n\nPython RPM Distribution:\n------------------------\n\nFirst install build dependencies from `./build/build-requirements.txt`.  Make sure you are on a RHEL / CentOS compatible system, with `rpm` installed.\n\n    make build-depends\n\nTo create a python RPM distribution via `setuptools`:\n\n    make bdist_rpm\n\nOutput files are placed in `dist/` directory.\n\nPython Windows self-extracting `.zip` Distribution:\n---------------------------------------------------\n\nFirst install build dependencies from `./build/build-requirements.txt`.  Make sure you are on a Windows compatible system, with compilation tools installed.\n\n    pip install --user -r ./build/build-requirements.txt\n\nTo create a python binary Windows `.exe` self-extracting `.zip` distribution via `setuptools`:\n\n    make bdist_wininst\n    # Or, without GNU Make:\n    python setup.py bdist_wininst\n\nOutput files are placed in `dist/` directory.\n\nPython `site-packages` Install:\n-------------------------------\n\nFirst install build dependencies from `./build/build-requirements.txt`.\n\n    pip install --user -r ./build/build-requirements.txt\n\nTo install this into your system `site-packages` Python directory:\n\n    make install\n\nInstalled bits include:\n\n- Python Libraries:\n  - `d3des`:\n        A Minimalistic DES implementation [`d3des.py` Python Library (Source from mythbuntu-common 0.72)][7]\n  - `WindowsRegistry`:\n        A Python class to simplify read/write access to the Windows Registry\n- This project's scripts / package info:\n  - `vncpasswd.py`:\n        The main executable Python script for this project.\n  - `pass2reg.cmd`:\n        A Windows batch script file that takes a password and writes it to the UltraVNC registry area.\n        Calls out to `vncpasswd.py -o -e %1`, to encrypt the password first.\n        Note: It can also be saved to the RealVNC registry location directly with Python via `vncpasswd.py --registry`.\n        Originally part of [Mike Miller's blog post][1].\n  - `vncpasswd.py-1.2.1-py2.7.egg`\n        Python Egg package of this project\n  - `vncpasswd.py-1.2.1_-py2.7.egg-info`\n        Python Egg packaging metadata for this project\n\nDocker Image Build:\n-------------------\n\nMake sure you have Docker installed on your system, and run:\n\n    make package\n\nDockerHub / Repository Image Ship:\n----------------------------------\n\nTo ship this image to either DockerHub, or your Docker Image repository of choice, just export the following variables:\n\n    DOCKER_USERNAME=your-username\n    DOCKER_PASSWORD=your-password\n\nThen run:\n\n    # DockerHub by default\n    make ship\n    \n    # Alternate Repository\n    #  Override \u0026 export these variables set in `./build/main.mk`:\n    #    REGISTRY    ?= docker.io\n    #    REPO_NAME   ?= $(BIN)\n    #    REPO        ?= $(REGISTRY)/trinitronx/$(REPO_NAME)\n    export REGISTRY=quay.io\n    export REPO_NAME=your-reponame\n    export USERNAME=your-username\n    export REPO=$REGISTRY/$USERNAME/$REPO_NAME\n    make ship\n\n\nThanks / Props\n--------------\n\nMany thanks to the original authors of the d3des libary\n(Richard Outerbridge, Dan Hoey, Jim Gillogly, Phil Karn, et. al.), \nand it's python rewrite (Yusuke Shinyama)!\nThanks to Mike Miller for his great [blog post][1] on how he used the d3des.py library.\nThanks to Darren McCall for his wonderful collection of [RealVNC Registry Hacks][2]\nAnd finally...\nThanks to God for the inspiration to reverse engineer RealVNC's multi-block \nmethod for encrypting long passwords ;-D\n(Long story... recovering my *long* RealVNC password saved a bunch of my data!)\n\n\nDisclaimer:\n-----------\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 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 SOFTWARE.\n\nPlease only use this software for Good, and don't harm directly or indirectly living beings\n\n\nReferences:\n-----------\n\n - [Creating a Hashed Password for VNC][1]\n - [RealVNC Password Hacking][2]\n - [Email Thread: Registry Edit to define server password][3]\n - [Email Thread on User vs. System passwords: Password Shift][4]\n\n[1]: http://www.geekademy.com/2010/10/creating-hashed-password-for-vnc.html\n    \"Creating a Hashed Password for VNC\"\n[2]: http://darrenmccall.com/blog/2010/04/30/realvnc-password-hacking/\n    \"RealVNC Password Hacking\"\n[3]: http://www.realvnc.com/pipermail/vnc-list/2002-November/035748.html\n    \"Email Thread: Registry Edit to define server password\"\n[4]: http://www.realvnc.com/pipermail/vnc-list/2002-August/033007.html\n    \"Email Thread on User vs. System passwords: Password Shift\"\n[5]: https://archiveprogram.github.com/#arctic-code-vault\n    \"GitHub Archive Program: Preserving open source software for future generations (Get your code into the GitHub Arctic Code Vault 02/02/2020)\"\n[6]: https://github.com/python/cpython/tree/master/PCbuild\n    \"Building cPython on Windows: PCBuild/readme.txt\"\n[7]: https://www.apt-browse.org/browse/ubuntu/trusty/universe/all/mythbuntu-common/0.72/file/usr/lib/python3/dist-packages/mythbuntu_common/d3des.py\n    \"d3des.py Source Code from mythbuntu-common 0.72\"\n[8]: https://github.com/pyenv/pyenv\n    \"pyenv: Simple Python version management\"\n[9]: https://github.com/pyenv/pyenv-installer\n    \"pyenv-installer for pyenv and friends. It is inspired by rbenv-installer.\"\n[10]: https://code.visualstudio.com/docs/python/python-tutorial#_prerequisites\n    \"Windows: Getting Started with Python in VS Code\"\n[11]: https://www.python.org/downloads/\n    \"Python: Downloads\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinitronx%2Fvncpasswd.py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinitronx%2Fvncpasswd.py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinitronx%2Fvncpasswd.py/lists"}