Multi-agent AI laboratory with ASP.NET Core 8.0 backend and Flutter frontend. Implements CQRS architecture, OpenAPI contract-first API design. BACKEND: Agent management, conversations, executions with PostgreSQL + Ollama FRONTEND: Cross-platform UI with strict typing and Result-based error handling Co-Authored-By: Jean-Philippe Brule <jp@svrnty.io>
25 lines
938 B
C#
25 lines
938 B
C#
namespace Codex.Dal.Services;
|
|
|
|
/// <summary>
|
|
/// Service for encrypting and decrypting sensitive data (API keys, tokens, etc.).
|
|
/// Uses AES-256 encryption with random IVs for security.
|
|
/// </summary>
|
|
public interface IEncryptionService
|
|
{
|
|
/// <summary>
|
|
/// Encrypts plain text using AES-256 encryption.
|
|
/// The IV is randomly generated and prepended to the ciphertext.
|
|
/// </summary>
|
|
/// <param name="plainText">The text to encrypt</param>
|
|
/// <returns>Base64-encoded encrypted data (IV + ciphertext)</returns>
|
|
string Encrypt(string plainText);
|
|
|
|
/// <summary>
|
|
/// Decrypts encrypted text that was encrypted using the Encrypt method.
|
|
/// Extracts the IV from the beginning of the encrypted data.
|
|
/// </summary>
|
|
/// <param name="encryptedText">Base64-encoded encrypted data (IV + ciphertext)</param>
|
|
/// <returns>Decrypted plain text</returns>
|
|
string Decrypt(string encryptedText);
|
|
}
|