Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

MrElectrify/CompileTimeEncryption

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CompileTimeEncryption

C++20's introduction of structures as template parameters has introduced an easy way of compile-time string encryption.

Features

  • Different keys and ciphertext generated with each compilation
  • Different keys and ciphertext per-source file and line number. Encrypting the same string twice will yield two different ciphertexts and keys
  • Works in release and debug builds, no matter the optimization
  • Uses SSE instructions to decrypt 16 bytes of plaintext at a time
  • CMake option ENCRYPT_STRINGS, which can be used to selectively disable string encryption for some build types (if you do not use CMake, you must define CTE_ENCRYPTSTRINGS yourself)

Usage

  • Simply include XorStr.h, and wrap plaintext strings in XorStr, which will return a const char*. An optional XorStr_ macro is also provided that will return the underlying std::array<char>, aligned and padded to 16 bytes

About

C++20 guaranteed compile-time string encryption

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.