Single header C++23 compile-time string obfuscation library.
  • C++ 89.7%
  • CMake 10.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-29 20:15:25 +01:00
examples Initial commit. 2026-10-29 17:52:52 +01:00
include/veil Initial commit. 2026-10-29 17:52:52 +01:00
.clang-format Initial commit. 2026-10-29 17:52:52 +01:00
.gitignore Initial commit. 2026-10-29 17:52:52 +01:00
CMakeLists.txt Initial commit. 2026-10-29 17:52:52 +01:00
LICENSE Add LICENSE. 2026-10-29 18:02:21 +01:00
README.md Update README.md. 2026-10-29 20:15:25 +01:00

veil

Single header C++23 compile-time string obfuscation library.

Usage

Wrap any string literal in VEIL(...):

#include <veil/veil.hpp>
#include <print>

auto main() -> int
{
    std::println("{}", VEIL("hi chat mraow").view());
    const auto wide = VEIL(L"wide meow");
}

Accessors:

Member Returns Notes
view() std::basic_string_view<CharT> Valid only while the string is alive.
c_str() const CharT* Null-terminated.
str() std::basic_string<CharT> An owning copy you can keep.
size() std::size_t Length in characters, excluding the terminator.
empty() bool

A secure string also converts implicitly to its std::basic_string_view.

Building

To build the examples, run:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

To use veil in your project, either copy veil.hpp into your source tree or add the repository as a subdirectory and link against veil::veil:

set(VEIL_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(veil)
target_link_libraries(my_app PRIVATE veil::veil)

License

This project is licensed under the MIT License - see the LICENSE file for details.