Steve Gordon 1/14/2026

Encrypting Properties with System.Text.Json and a TypeInfoResolver Modifier (Part 1)

Read Original

This article is the first part of a series on building a system to automatically encrypt and decrypt specific properties during JSON serialization/deserialization using System.Text.Json. It covers scenarios like securing data in document databases and enabling crypto shredding for compliance, with a practical example of securing OAuth tokens. The post details using a custom attribute and an IJsonTypeInfoResolver to mark and handle sensitive properties.

Encrypting Properties with System.Text.Json and a TypeInfoResolver Modifier (Part 1)

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

1
The Beautiful Web
Jens Oliver Meiert 2 votes
3
LLM Use in the Python Source Code
Miguel Grinberg 1 votes
4
Wagon’s algorithm in Python
John D. Cook 1 votes