Example encrypted project

Encrypted Godot Project

Easiest Approaches (Can’t Customize C++ Build)

  1. Godot Export Templater (Free)
  2. Godot Builder

Installation steps (For a Windows/ Web Build)

  1. Download git bash.
    1. Identify the latest release version of Godot
      1. Go to https://godotengine.org/download/windows/

      2. Note the version number (as of now, 4.4.1)

      3. Carefully choose, and remember, a directory to store the source build in!

      4. Open git bash or a Command Prompt window and run, for example:

        git clone <https://github.com/godotengine/godot.git> --branch 4.4.1-stable
        
        1. Modify the stable version number as needed.
  2. Download and install the latest Build Tools for Visual Studio available appropriate to your windows version:
    1. https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022
  3. Run Command Prompt
  4. Install Emscripten SDK if you intend to make web builds of your game:
    1. Create and remember a directory for Emscripten. I’m using C:\emscripten.

    2. Download the SDK in that directory:

      git clone <https://github.com/emscripten-core/emsdk.git>
      
    3. Install Emscripten in Command Prompt:

      1. Ensure you are in the DRIVE_LETTER:\emscripten\emsdk directory (the one with emsdk.bat in it), and run:

        emsdk install latest
        
      2. Then run:

        emsdk activate latest
        
        1. Note that if you update or reinstall Emscripten later, you’ll need to rerun the activate command.
  5. Install Python if not already installed, and ensure PATH is enabled
    1. Python download: https://www.python.org/downloads/windows/
  6. Install scons.
    1. Run this in Command Prompt if not already installed:

      pip install scons
      
    2. If using Emscripten/doing web builds, run this in Command Prompt too (you may need to navigate to the python folder and confirm the version; I didn’t need to):

      DRIVE_LETTER:\\emscripten\\emsdk\\python\\3.13.3_64bit\\python.exe -m pip install scons
      

Repeatable encryption/compilation steps (Windows / Web Build)

  1. If needed, update/change the version of your Godot source.

    1. Go to https://godotengine.org/download/windows/
    2. Check if you need a new version (or note which old version you want to change to)
    3. Navigate to your existing Godot source directory (eg c:\godot)
      1. Checkout the needed version, for example:

        git checkout 4.4.1-stable
        
  2. Generate encryption key in git bash

    openssl rand -hex 32 > godot.gdkey
    
  3. (Optional) Create a build profile in Godot

    1. Project > Tools > Engine Compilation Configuration Editor
    2. Press “Detect From Project”
    3. Save As
  4. Compile the Export Template(s)

    1. If you’re building your project for Windows:
      1. Set the directory to the location you pulled Godot into, for example:

        cd DRIVE_LETTER:\\godot\\
        
      2. In a fresh Command Prompt terminal, set the encryption key generated earlier:

        set SCRIPT_AES256_ENCRYPTION_KEY=your-64-character-key
        
      3. Compile the export template through scons (check if you need/want the flags below too, and add them to this line):

        scons platform=windows target=template_release
        
        1. if you made a build template, add:

          build_profile=your_custom_profile.build
          
        2. if you are targeting 64-bit architectures (which is likely), add:

           bit=64
          
      4. Be patient. This could take a while.

      5. The export template will be in DRIVE_LETTER:\your_godot_source_directory\bin\godot.windows.template_release.exe

    2. If you’re building your project for Web:
      1. Navigate to your Godot source folder; for example:

        cd DRIVE_LETTER:\\godot\\
        
      2. Open a fresh Command Prompt terminal and refer back to your Emscripten directory and its python version; replace that directory/version in the code below as needed, and run each line:

        set PATH=C:\\emscripten\\emsdk\\python\\3.13.3_64bit;%PATH%
        set PATH=C:\\emscripten\\emsdk\\upstream\\emscripten;%PATH%
        set EMSDK=C:\\emscripten\\emsdk
        
      3. Set the encryption key you generated earlier:

        set SCRIPT_AES256_ENCRYPTION_KEY=your-64-character-key
        
      4. Compile the export template through scons (check if you need/want the flag below too, then optionally add it to this line):

        scons platform=web target=template_release threads=no
        
        1. if you made a build template, add this:

          build_profile=your_custom_profile.build
          
      5. Be patient. This could take a while.

      6. The export template will be in: DRIVE_LETTER:\your_godot_source_directory\bin\godot.web.template_release.wasm32.zip