\CryptoManana\Core\Interfaces\ContainersLayeredEncryptionInterface

Interface LayeredEncryptionInterface - Interface specification for layered encryption.

Summary

Methods
Constants
setLayers()
addLayer()
getLayers()
layeredEncryptData()
layeredDecryptData()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

setLayers()

setLayers(array<mixed,\CryptoManana\DataStructures\EncryptionLayer>|array  $layers) 

Setter for the encryption layers' configuration.

Parameters

array<mixed,\CryptoManana\DataStructures\EncryptionLayer>|array $layers

Collection of layers.

Throws

\Exception

Validation errors.

addLayer()

addLayer(\CryptoManana\DataStructures\EncryptionLayer  $layer) 

Add a single new layer at the last of the list.

Parameters

\CryptoManana\DataStructures\EncryptionLayer $layer

The layer configuration.

Throws

\Exception

Validation errors.

getLayers()

getLayers() : array<mixed,\CryptoManana\DataStructures\EncryptionLayer>|array

Getter for the encryption layers' configuration.

Throws

\Exception

Validation errors.

Returns

array<mixed,\CryptoManana\DataStructures\EncryptionLayer>|array —

Collection of used layers' configuration.

layeredEncryptData()

layeredEncryptData(string  $plainData, string  $oneTimePad = '') : string

Encrypts the given plain data multiple times with different algorithms as layers.

Parameters

string $plainData

The plain input string.

string $oneTimePad

The optional one-time pad key.

Throws

\Exception

Validation errors.

Returns

string —

The cipher/encrypted data.

layeredDecryptData()

layeredDecryptData(string  $cipherData, string  $oneTimePad = '') : string

Decrypts the given cipher data multiple times with different algorithms as layers.

Parameters

string $cipherData

The encrypted input string.

string $oneTimePad

The optional one-time pad key.

Throws

\Exception

Validation errors.

Returns

string —

The decrypted/plain data.