In ASP.NET (not core) I would normally add a machineKey to the web.config so that I could perform some functions on a local machine instead of the server so that database/ca
You need to use DataProtection APis now:
The ASP.NET Core data protection stack provide a simple, easy to use cryptographic API a developer can use to protect data, including key management and rotation.
Samples could be found in official DataProtection repo.
The same approach, by the way, works with ASP.NET: Replacing
The data protection system is built upon two core concepts - a data protection provider (represented by the IDataProtectionProvider interface), which is used to create a data protector (represented by the IDataProtector interface) by CreateProtector method. The data protector is used to encrypt and decrypt data.
To register IDataProtectionProvider into DI use .AddDataProtection method:
public void ConfigureServices(IServiceCollection services)
{
// Adds data protection services
services.AddDataProtection();
...
}