seeds.hHeader

This file defines functions for generating encryption and obfuscation seeds based on the platform's architecture. More...

Detailed Description

The seeds.h file provides functionality to generate compile-time seeds used for encryption and obfuscation. The seeds are determined based on the platform's architecture, specifically the size of size_t , which indicates whether the platform is 32-bit or 64-bit. The seeds are calculated using XOR operations with predefined constants and FNV-1 or FNV-1a hash values of a build timestamp, ensuring that the seeds are unique and consistent across builds.

Key Features:

  • Platform-Specific Seeds : The file contains function templates that generate different seeds for 32-bit and 64-bit platforms.

  • Compile-Time Computation : The seeds are calculated at compile time, ensuring that they are embedded directly into the compiled binary.

  • Use of Hashing : The FNV-1 and FNV-1a hash functions are used to generate a part of the seed based on the build timestamp, providing a degree of uniqueness for each build.

  • Obfuscation and Encryption : Separate seeds are generated for encryption and obfuscation, tailored to the platform's architecture.

Usage Example:

#include <antispy/libantispy.h>

int main() {
   // Example of using the seeds in a function
   size_t encryptionSeed = libantispy::detail::encryption_seed<>();
   size_t obfuscationSeed = libantispy::detail::obfuscation_seed<>();
}

In this example, the encryption_seed and obfuscation_seed functions are used to retrieve the seeds based on the platform's architecture. These seeds can then be used in various encryption and obfuscation routines throughout the program.