EntityCrypt.Core 2.0.2

dotnet add package EntityCrypt.Core --version 2.0.2
                    
NuGet\Install-Package EntityCrypt.Core -Version 2.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EntityCrypt.Core" Version="2.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EntityCrypt.Core" Version="2.0.2" />
                    
Directory.Packages.props
<PackageReference Include="EntityCrypt.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EntityCrypt.Core --version 2.0.2
                    
#r "nuget: EntityCrypt.Core, 2.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EntityCrypt.Core@2.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EntityCrypt.Core&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=EntityCrypt.Core&version=2.0.2
                    
Install as a Cake Tool

🔐 EntityCrypt

Transparent Encryption for Entity Framework Core

.NET License PQC


✨ الميزات

  • 🔒 تشفير شفاف - لا حاجة لتغيير كود التطبيق
  • 🛡️ AES-256-CBC - تشفير كلاسيكي سريع
  • 🚀 ML-KEM-768 - حماية ضد الحواسيب الكمّية (FIPS 203)
  • 🔗 الحفاظ على العلاقات - PK/FK تبقى سليمة
  • أداء عالي - ~1.3µs للتشفير الكلاسيكي
  • 📊 Benchmarks حقيقية - قياسات موثقة

📦 المشاريع

المشروع الوصف
EntityCrypt.Core مكتبة التشفير الأساسية
EntityCrypt.EFCore تكامل EF Core الشفاف
EntityCrypt.Benchmarks قياسات الأداء
VisualStorage أمثلة تفاعلية

🚀 البدء السريع

1. تعريف الكيانات

using EntityCrypt.EFCore.Attributes;

[EncryptedTable]
public class Customer
{
    public int Id { get; set; }
    
    [Encrypted]
    public string Name { get; set; }
    
    [Encrypted(Level = EncryptionLevel.Hybrid)]
    public string SSN { get; set; }
    
    [NoEncrypt]
    public DateTime CreatedAt { get; set; }
}

2. إعداد DbContext

services.AddDbContext<AppDbContext>(options =>
    options.UseSqlite("Data Source=app.db")
           .UseEntityCryptClassical("my-secret-key"));

3. الاستخدام العادي

// التشفير/فك التشفير شفاف تماماً!
db.Customers.Add(new Customer { Name = "أحمد", SSN = "123-45-6789" });
await db.SaveChangesAsync();

var customer = await db.Customers.FindAsync(1);
Console.WriteLine(customer.Name);  // "أحمد" (مفكوك تلقائياً)

📊 مستويات التشفير

المستوى الخوارزمية السرعة الحماية الكمّية
Classical AES-256-CBC ⚡⚡⚡⚡⚡
Hybrid AES-256 + ML-KEM ⚡⚡
PostQuantum ML-KEM-768 ✅✅

📈 Benchmarks (حقيقية)

BenchmarkDotNet v0.14.0, .NET 10.0

| Method                    | Mean      | Allocated |
|-------------------------- |----------:|----------:|
| Classical Encrypt         |  1.27 µs  |   1.9 KB  |
| Classical Decrypt         |  3.30 µs  |   7.0 KB  |
| PQC KeyGen (ML-KEM-768)   | 48.54 µs  |   6.4 KB  |
| PQC Encapsulate           | 24.86 µs  |   1.5 KB  |
| PQC Decapsulate           | 36.53 µs  |   376 B   |
| Hybrid Encrypt            | 29.50 µs  |  18.2 KB  |
| Hybrid Decrypt            | 75.87 µs  |  38.6 KB  |

🔗 التكامل مع مشاريع أخرى

WasmMvcRuntime.Data

// 1. إضافة المرجع
<ProjectReference Include="EntityCrypt.EFCore.csproj" />

// 2. تعريف الكيانات
[EncryptedTable]
public class MainTask { ... }

// 3. تسجيل الخدمات
services.AddEncryptedWasmDatabase(new EncryptedDatabaseConfig
{
    DatabasePath = "app.db",
    EncryptionKey = "my-key",
    DefaultLevel = EncryptionLevel.Classical
});

// 4. الاستخدام العادي - بدون أي تغيير!

📚 دليل التكامل الكامل


📁 هيكل المشروع

EntityCrypt/
├── src/
│   ├── EntityCrypt.Core/           # مكتبة التشفير
│   │   ├── Encryption/
│   │   │   ├── AES256EncryptionProvider.cs
│   │   │   ├── HierarchicalEncryptionManager.cs
│   │   │   └── PostQuantum/
│   │   │       └── HybridEncryptionProvider.cs
│   │   └── Models/
│   │
│   └── EntityCrypt.EFCore/         # تكامل EF Core
│       ├── Attributes/
│       │   └── EncryptionAttributes.cs
│       ├── Configuration/
│       │   └── EncryptionOptions.cs
│       ├── Context/
│       │   └── EntityEncryptionService.cs
│       ├── Extensions/
│       │   └── EntityCryptExtensions.cs
│       └── Interceptors/
│           └── EncryptionInterceptors.cs
│
├── samples/
│   ├── VisualStorage/              # أمثلة تفاعلية
│   └── EntityCrypt.Benchmarks/     # قياسات الأداء
│
└── docs/
    ├── INTEGRATION_GUIDE.md        # دليل التكامل
    ├── PERFORMANCE_BENCHMARKS.md   # نتائج الأداء
    └── examples/
        └── WasmMvcRuntime.Integration.cs

🛠️ المتطلبات

  • .NET 10.0+
  • EF Core 10.0+
  • Windows 11 Insiders أو Linux مع OpenSSL 3.5+ (للـ PQC)

📚 التوثيق


🤝 المساهمة

المساهمات مرحب بها! يرجى:

  1. Fork المشروع
  2. إنشاء branch للميزة
  3. Commit التغييرات
  4. فتح Pull Request

📄 الترخيص

MIT License - انظر LICENSE


<div align="center">

🔐 EntityCrypt

Transparent • Secure • Fast

.NET 10 | ML-KEM (FIPS 203) | AES-256

</div>

Product Compatible and additional computed target framework versions.
.NET 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.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EntityCrypt.Core:

Package Downloads
EntityCrypt.EFCore

Transparent encryption provider for Entity Framework Core — one line to encrypt your entire database. Supports AES-256, Hybrid (AES + ML-KEM), and Post-Quantum encryption with automatic PK/FK relationship handling, key-derived database naming, and provider-agnostic design (SQL Server, PostgreSQL, SQLite, MySQL, Oracle).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 102 4/17/2026