Single header C++23 compile-time string obfuscation library.
- C++ 89.7%
- CMake 10.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| examples | ||
| include/veil | ||
| .clang-format | ||
| .gitignore | ||
| CMakeLists.txt | ||
| LICENSE | ||
| README.md | ||
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.