Utils
class Utils (View source)
Utility helper for cryptography and UUID manipulation.
This class provides secure AES-256-GCM encryption/decryption, UUID format conversion, and key retrieval from configuration.
Constants
| private ENCRYPTION_VERSION |
Current encryption version tag used in the payload. Helps maintain compatibility if algorithms change in the future. |
| private CIPHER_METHOD |
Cipher algorithm and IV length constants. |
| private IV_LENGTH |
|
| private TAG_LENGTH |
|
Methods
Encrypts a string using AES-256-GCM with a random IV and version tag.
Decrypts data previously encrypted using AES-256-GCM.
Converts a UUID (hex string, with or without hyphens) to binary format.
Converts a binary UUID to a string representation.
Details
static string
encrypt(string $plainText)
Encrypts a string using AES-256-GCM with a random IV and version tag.
static string
decrypt(string $encryptedData)
Decrypts data previously encrypted using AES-256-GCM.
static string|null
convertUuidToBinary(string $uuid)
Converts a UUID (hex string, with or without hyphens) to binary format.
static string
convertBinaryToUuid(string $binary)
Converts a binary UUID to a string representation.