A service that uses a key to encrypt and decrypt data.

interface SymmetricEncryptionService {
    decrypt(encryptedData: string, key: string): string;
    encrypt(data: string, key: string): string;
}

Implemented by

Methods

  • Decrypts the given data using the provided key.

    Parameters

    • encryptedData: string

      The data to decrypt.

    • key: string

      The key to use for decryption.

    Returns string

    The decrypted data as a string.

  • Encrypts the given data using the provided key.

    Parameters

    • data: string

      The data to encrypt.

    • key: string

      The key to use for encryption.

    Returns string

    The encrypted data as a string.