\CryptoManana\Core\Traits\MessageEncryptionFileEncryptionTrait

Trait FileEncryptionTrait - Reusable implementation of `FileEncryptionInterface`.

Summary

Methods
Properties
Constants
encryptFile()
decryptFile()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

encryptFile()

encryptFile(string  $filename) : string

Encrypts the content of a given plain file.

Parameters

string $filename

The full path and name of the file for encryption.

Throws

\Exception

Validation errors.

Returns

string —

The encrypted file content.

decryptFile()

decryptFile(string  $filename) : string

Decrypts the content of a given encrypted file.

Parameters

string $filename

The full path and name of the file for encryption.

Throws

\Exception

Validation errors.

Returns

string —

The decrypted file content.