-
Notifications
You must be signed in to change notification settings - Fork 0
How to encrypt & decrypt
Encrypting data is a one step process and decrypting data is a two step process. All you need for encrypting and decrypting is the key and/or AAD provided when encrypting and a KEFInfo instance which contains essential information needed to decrypt the data.
Encrypting data is done through the encryptDataKEF() function which will take the data provided and split it into ranges set by the byte range of which can be the default or manually set as long as it's not less than the MIN_BYTES or MAX_BYTES constants. Anything below or above will either cause a segmentation fault or be too much for OpenSSL to handle.
The description for the encryptDataKEF() function is below.
encryptDataKEF(string $data, string $passphrase, string $cipher, int $byte_range = 0, string|null $aad = null, string|null $output = null)Decrypting data requires one more step than encrypting data.
You will have to create a KEFInfo object in order to decrypt the data.
The KEFInfo object has the following parameters required for data decryption and subsequent serving of data.