ShieldCore is a small C++17 project that demonstrates a cross-platform protected plugin workflow:
- a host application that loads an encrypted plugin package
- integrity and signature checks around the plugin payload
- basic anti-debug checks
- optional backend validation before execution
- a packer tool that turns a dynamic library into a
.plgfile
The repository is structured to build on Linux, macOS, and Windows, with the current WSL/Linux build path verified in this workspace.
src/host- host application, crypto helpers, integrity checks, anti-debug logic, and HTTP clientsrc/plugin- sample plugin that exportsExecute()src/tools- packer utility that creates.plgfilesinclude/shieldcore- shared headersbuild- generated binaries and test artifacts
You need a C++17 compiler, make, OpenSSL, and libcurl.
sudo apt update
sudo apt install build-essential make pkg-config libssl-dev libcurl4-openssl-devbrew install openssl curlUse either MSYS2/MinGW-w64 or a Visual Studio environment that can build C++17 projects and link against OpenSSL and libcurl.
The project uses the top-level Makefile.
make releaseOther useful targets:
make debug
make clean
make pack
make backendBuild outputs are written to build/.
build/hostappor the platform-specific equivalentbuild/plugin.so,build/plugin.dylib, orbuild/plugin.dllbuild/packeror the platform-specific equivalent
The host expects a packed plugin file:
./build/hostapp ./build/plugin.plgAn optional backend URL may be passed as the second argument:
./build/hostapp ./build/plugin.plg http://127.0.0.1:18081For local testing, run the mock backend in another terminal:
python3 tools/mock_backend.py 18081It accepts POST /validate and POST /activate, which matches the host client.
The packer reads a compiled plugin, encrypts it, signs its hash, and writes a .plg file.
./build/packer ./build/plugin.so ./build/plugin.plgOn Windows and macOS, use the platform-specific plugin filename produced by the build.
The current implementation supports a simple local test flow using PEM values from the environment.
- Generate a test RSA keypair.
- Export the private and public key PEMs to the environment.
- Pack the sample plugin.
- Run the host against the packed plugin.
Example:
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out build/test_private.pem
openssl pkey -in build/test_private.pem -pubout -out build/test_public.pem
export SHIELDCORE_PRIVATE_KEY_PEM="$(cat build/test_private.pem)"
export SHIELDCORE_PUBLIC_KEY_PEM="$(cat build/test_public.pem)"
./build/packer ./build/plugin.so ./build/plugin.plg
./build/hostapp ./build/plugin.plgIf the smoke test succeeds, the sample plugin prints:
ShieldCore plugin executed
SHIELDCORE_PRIVATE_KEY_PEM- overrides the packer private key PEM used for signing during local testingSHIELDCORE_PUBLIC_KEY_PEM- overrides the host public key PEM used for signature verification during local testingSHIELDCORE_EXPECTED_HOST_HASH- optional expected SHA256 hash for the host executable
- The design is intentionally modular so host, plugin, and tooling can be built independently.
- Release builds enable optimization flags and link-time optimization where supported.
- The current repository includes a verified WSL/Linux build path; platform-specific loader details may still require refinement depending on the target OS toolchain.