Serilog.Sinks.File.Encrypt.Cli 0.0.0-alpha.0.17

This is a prerelease version of Serilog.Sinks.File.Encrypt.Cli.
There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global Serilog.Sinks.File.Encrypt.Cli --version 0.0.0-alpha.0.17
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Serilog.Sinks.File.Encrypt.Cli --version 0.0.0-alpha.0.17
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Serilog.Sinks.File.Encrypt.Cli&version=0.0.0-alpha.0.17&prerelease
                    
nuke :add-package Serilog.Sinks.File.Encrypt.Cli --version 0.0.0-alpha.0.17
                    

Serilog.Sinks.File.Encrypt CLI Tool

A command-line tool for managing RSA key pairs and decrypting log files created by the Serilog.Sinks.File.Encrypt package.

Installation

Install the tool globally using the .NET CLI:

dotnet tool install --global Serilog.Sinks.File.Encrypt.Cli

Usage

Generate RSA Key Pair

Generate a new RSA public/private key pair for encrypting log files:

serilog-encrypt generate --output /path/to/keys

Options:

  • -o|--output <OUTPUT> (required): The directory where the key files will be saved

This creates two files:

  • private_key.xml: The private key used for decryption (keep secure)
  • public_key.xml: The public key used for encryption

Decrypt Log Files

Decrypt encrypted log files using your RSA private key:

serilog-encrypt decrypt --key private_key.xml --file log.encrypted.txt --output log.decrypted.txt

Options:

  • -k|--key <KEY>: Path to the RSA private key file (default: privateKey.xml)
  • -f|--file <FILE>: Path to the encrypted log file (default: log.encrypted.txt)
  • -o|--output <OUTPUT>: Path for the decrypted output file (default: log.decrypted.txt)

Features:

  • Memory-optimized for large log files
  • Continues processing through file corruption
  • Fixed memory usage regardless of log file size

Examples

Basic Key Generation

# Generate keys in the current directory
serilog-encrypt generate --output .

# Generate keys in a specific directory
serilog-encrypt generate --output ./keys

Basic Log Decryption

# Decrypt
serilog-encrypt decrypt --key ./keys/private_key.xml --file ./logs/app.log --output ./logs/app-decrypted.log

Security Notes

  • Keep your private key secure and never share it
  • The private key is required to decrypt log files
  • Store keys separately from your application code
  • Consider using secure key management systems in production

Integration with Serilog

This tool works with log files encrypted by the Serilog.Sinks.File.Encrypt package. For detailed information on how to configure Serilog with encryption, see the main package documentation.

Requirements

  • .NET 8.0 or higher
  • Logs created with Serilog.Sinks.File.Encrypt
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
2.0.0 655 12/2/2025
1.0.0 403 12/1/2025
0.50.1 171 11/27/2025
0.0.0-alpha.0.27 129 11/27/2025
0.0.0-alpha.0.17 134 11/25/2025
0.0.0-alpha.0.14 130 11/24/2025
0.0.0-alpha.0.13 131 11/24/2025