Implemented compile-time string obfuscation via XOR for the agent.

This commit is contained in:
Jakob Friedl
2025-08-26 15:11:43 +02:00
parent dd7433588f
commit 8791faec3f
13 changed files with 166 additions and 232 deletions

View File

@@ -1,5 +1,5 @@
import streams, tables
import ./[types, utils, crypto]
import ./[types, utils]
#[
Packer
@@ -102,7 +102,7 @@ proc getBytes*(unpacker: Unpacker, length: int): seq[byte] =
unpacker.position += bytesRead
if bytesRead != length:
raise newException(IOError, "Not enough data to read")
raise newException(IOError, protect("Not enough data to read"))
proc getByteArray*(unpacker: Unpacker, T: typedesc[Key | Iv | AuthenticationTag]): array =
var bytes: array[sizeof(T), byte]
@@ -111,7 +111,7 @@ proc getByteArray*(unpacker: Unpacker, T: typedesc[Key | Iv | AuthenticationTag]
unpacker.position += bytesRead
if bytesRead != sizeof(T):
raise newException(IOError, "Not enough data to read structure.")
raise newException(IOError, protect("Not enough data to read structure."))
return bytes