-
Notifications
You must be signed in to change notification settings - Fork 3
Logmeobf
logmeobf is the command-line helper for log obfuscation workflows. It can generate obfuscation keys, convert readable log records to binary obfuscated records, and convert binary obfuscated records back to readable records when the same key is available.
logmeobf - generate keys and obfuscate or deobfuscate log records
Copyright (c) EFM Software
Usage:
logmeobf --generate-key [--key-out FILE] [--base64] [--header FILE] [--name IDENTIFIER]
logmeobf --obfuscate --key-file FILE|--key-base64 TEXT [--format auto|text|json|xml] [--in FILE] [--out FILE]
logmeobf --deobfuscate --key-file FILE|--key-base64 TEXT [--in FILE] [--out FILE]
Options:
--generate-key Generate a new 32-byte obfuscation key
--obfuscate Convert readable log records to binary obfuscated records
--deobfuscate Convert binary obfuscated records to readable log records
--key-file FILE Read binary key from FILE
--key-base64 TEXT Read base64 key from TEXT
--key-out FILE Write generated key as binary file
--base64 Print generated key as base64
--header FILE Write generated key as C/C++ header
--name IDENTIFIER Header variable name
--in FILE Read input from FILE instead of stdin
--out FILE Write output to FILE instead of stdout
--format FORMAT Input readable format for --obfuscate: auto, text, json, xml
--nonce-salt VALUE Use fixed nonce salt for reproducible obfuscation output
--help Show this help
logmeobf --generate-key --key-out logme.keyWhat happens:
- a new 32-byte obfuscation key is generated
- the raw binary key is written to
logme.key - the file must be protected, because it is required for deobfuscation
logmeobf --generate-key --base64Output is a base64-encoded 32-byte key. The exact value is different each time because the key is generated randomly.
Use this form when the key must be stored in configuration, environment variables, or CI secrets instead of a binary file.
logmeobf --generate-key --header logme_obf_key.h --name LOGME_OBF_KEYWhat happens:
- a new key is generated
- a header file is written to
logme_obf_key.h - the generated variable name is
LOGME_OBF_KEY
This is useful when the application embeds the obfuscation key at build time.
logmeobf --obfuscate --key-file logme.key --format text --in app.log --out app.logobfWhat happens:
-
app.logis read as a readable text log - every record is written to
app.logobfin binary obfuscated form - the output file is not intended to be opened as text
logmeobf --deobfuscate --key-file logme.key --in app.logobf --out app.restored.logWhat happens:
-
app.logobfis read as binary obfuscated records - the same key from
logme.keyis used to decrypt records - readable records are written to
app.restored.log
logmeobf --obfuscate --key-base64 BASE64KEY --format json --in app.jsonl --out app.jsonl.obf
logmeobf --deobfuscate --key-base64 BASE64KEY --in app.jsonl.obf --out app.jsonlWhat happens:
- the key is supplied directly on the command line
-
--format jsontells--obfuscatehow to parse the readable input records - deobfuscation does not need
--format, because the obfuscated stream contains binary records
logmeobf --obfuscate --key-file logme.key --format text --nonce-salt 12345 --in app.log --out app.logobfWhat happens:
- the nonce generator uses the fixed salt value
12345 - the same input and key produce reproducible obfuscated output
- this option is intended for tests, not for normal production logging
logme — flexible runtime logging system
Home · Getting Started · Architecture · Output · Backends · Configuration
GitHub: https://github.com/efmsoft/logme
- Home
- Getting Started
- Why logme?
- Core Concepts
- Logging Macros
- Fatal Handling
- Crash Logging
- glog Compatibility
- C API
- Choosing Logging Macros
- Function tracing
- Trace Points
- Override Scopes
- Advanced Features
- Collapse Logging
- Feature Map
- Overview
- Console Backend
- Debugger Backend
- File Backend
- File Rotation & Retention
- Buffer Backend
- Ring Buffer Backend
- SharedFile Backend
- Callback Backend
- Windows Event Log Backend
- Custom Backends
- Runtime Control
- Configuration
- Configuration JSON
- Control Server
- Environment Control
- Control Policies
- Trace Points
- Message Filtering