# Class MessageEncryptionService | EchoHub Documentation

# Class MessageEncryptionService

Namespace
  EchoHub.Server.Services

Assembly
  EchoHub.Server.dll

    public class MessageEncryptionService : IMessageEncryptionService

Inheritance
  object
  MessageEncryptionService

Implements
  IMessageEncryptionService

Inherited Members
  object.GetType()
  object.MemberwiseClone()
  object.ToString()
  object.Equals(object)
  object.Equals(object, object)
  object.ReferenceEquals(object, object)
  object.GetHashCode()

## Constructors

### MessageEncryptionService(IConfiguration, ILogger<MessageEncryptionService>)

    public MessageEncryptionService(IConfiguration configuration, ILogger<MessageEncryptionService> logger)

#### Parameters

`configuration` IConfiguration
`logger` ILogger<MessageEncryptionService>

## Properties

### EncryptDatabaseEnabled

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

    public bool EncryptDatabaseEnabled { get; }

#### Property Value

bool

## Methods

### Decrypt(string)

    public string Decrypt(string content)

#### Parameters

`content` string

#### Returns

string

### DecryptNullable(string?)

    public string? DecryptNullable(string? value)

#### Parameters

`value` string

#### Returns

string

### Encrypt(string)

    public string Encrypt(string plaintext)

#### Parameters

`plaintext` string

#### Returns

string

### EncryptNullable(string?)

    public string? EncryptNullable(string? value)

#### Parameters

`value` string

#### Returns

string