# Interface IMessageEncryptionService | EchoHub Documentation

# Interface IMessageEncryptionService

Namespace
  EchoHub.Core.Contracts

Assembly
  EchoHub.Core.dll

    public interface IMessageEncryptionService

## Fields

### CiphertextPrefix

Prefix marking transport/at-rest encrypted content. Decrypt(string) is a pass-through for values without it.

    public const string CiphertextPrefix = "$ENC$v1$"

#### Field Value

string

## Properties

### EncryptDatabaseEnabled

Whether database content should be encrypted at rest (server setting).

    bool EncryptDatabaseEnabled { get; }

#### Property Value

bool

## Methods

### Decrypt(string)

    string Decrypt(string content)

#### Parameters

`content` string

#### Returns

string

### DecryptNullable(string?)

    string? DecryptNullable(string? value)

#### Parameters

`value` string

#### Returns

string

### Encrypt(string)

    string Encrypt(string plaintext)

#### Parameters

`plaintext` string

#### Returns

string

### EncryptNullable(string?)

    string? EncryptNullable(string? value)

#### Parameters

`value` string

#### Returns

string