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

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.13
                    
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.13
                    
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.13&prerelease
                    
nuke :add-package Serilog.Sinks.File.Encrypt.Cli --version 0.0.0-alpha.0.13
                    

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

The tool provides two main commands: generate for creating RSA key pairs and decrypt for decrypting encrypted log files.

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 command creates two files:

  • private_key.xml: The private key used for decryption
  • 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)

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 using default file names
serilog-encrypt decrypt

# Decrypt with specific files
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 environments

Integration with Serilog

This tool works with log files encrypted by the Serilog.Sinks.File.Encrypt package. Configure your Serilog file sink to use encryption:

Log.Logger = new LoggerConfiguration()
    .WriteTo.File("logs/app.log", hooks: new EncryptHooks("path/to/public_key.xml"))
    .CreateLogger();

Requirements

  • .NET 8.0 or higher
  • RSA key pair (generated using this tool or compatible format)
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