An open API service indexing awesome lists of open source software.

https://github.com/furkandeveloper/entityframeworkcore.dataencryption

This package is a plugin that adds data encryption support to EF Core.
https://github.com/furkandeveloper/entityframeworkcore.dataencryption

data-encryption ef-core encryption entity-framework-core

Last synced: 9 months ago
JSON representation

This package is a plugin that adds data encryption support to EF Core.

Awesome Lists containing this project

README

          





Gitmoji

***

## Give a Star 🌟
If you liked the project or if **EntityFrameworkCore.DataEncryption** helped you, please give a star.

***

### Purpose
**EntityFrameworkCore.DataEncryption** with the entity framework core value converter feature, it allows you to store your data by encrypting it.

***

### Summary

```
Install-Package EntityFrameworkCore.DataEncryption.Conversions
```



Then mark the columns to be encrypted in DbContext.



```csharp
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity(entity =>
{
entity
.Property(p => p.Id)
.UseIdentityColumn();
entity
.Property(p => p.Name)
.IsRequired()
.HasMaxLength(2048);

entity
.Property(p => p.Surname)
.IsRequired()
.HasMaxLength(2048);
entity
.Property(p => p.Phone)
.IsRequired()
.HasConversion(new EncryptValueConverter(key:"89acMXSBpuEBDWHZ"));
});
base.OnModelCreating(modelBuilder);
}
```

***

### Documentation
Visit wiki documentation. [Wiki](https://github.com/furkandeveloper/EntityFrameworkCore.DataEncryption/wiki)

***

### Sample Project

See for more information visit [sample project](https://github.com/furkandeveloper/EntityFrameworkCore.DataEncryption/tree/master/sample/EntityFrameworkCore.DataEncryption.Sample)