McryptEncrypter deprecated
class McryptEncrypter extends BaseEncrypter implements Encrypter (View source)
deprecated
Properties
protected string | $key | The encryption key. | from BaseEncrypter |
protected string | $cipher | The algorithm used for encryption. | |
protected int | $block | The block size of the cipher. |
Methods
string | hash(string $iv, string $value) Create a MAC for the given value. | from BaseEncrypter |
array | getJsonPayload(string $payload) Get the JSON array from the given payload. | from BaseEncrypter |
bool | invalidPayload(array|mixed $data) Verify that the encryption payload is valid. | from BaseEncrypter |
bool | validMac(array $payload) Determine if the MAC for the given payload is valid. | from BaseEncrypter |
void | __construct(string $key, string $cipher = MCRYPT_RIJNDAEL_128) Create a new encrypter instance. | |
static bool | supported(string $key, string $cipher) Determine if the given key and cipher combination is valid. | |
string | encrypt(string $value) Encrypt the given value. | |
string | padAndMcrypt(string $value, string $iv) Pad and use mcrypt on the given value and input vector. | |
string | decrypt(string $payload) Decrypt the given value. | |
string | mcryptDecrypt(string $value, string $iv) Run the mcrypt decryption routine for the value. | |
string | addPadding(string $value) Add PKCS7 padding to a given value. | |
string | stripPadding(string $value) Remove the padding from the given value. | |
bool | paddingIsValid(string $pad, string $value) Determine if the given padding for a value is valid. | |
int | getIvSize() Get the IV size for the cipher. | |
int | getRandomizer() Get the random data source available for the OS. |
Details
protected string hash(string $iv, string $value)
Create a MAC for the given value.
protected array getJsonPayload(string $payload)
Get the JSON array from the given payload.
protected bool invalidPayload(array|mixed $data)
Verify that the encryption payload is valid.
protected bool validMac(array $payload)
Determine if the MAC for the given payload is valid.
void __construct(string $key, string $cipher = MCRYPT_RIJNDAEL_128)
Create a new encrypter instance.
static bool supported(string $key, string $cipher)
Determine if the given key and cipher combination is valid.
string encrypt(string $value)
Encrypt the given value.
protected string padAndMcrypt(string $value, string $iv)
Pad and use mcrypt on the given value and input vector.
string decrypt(string $payload)
Decrypt the given value.
protected string mcryptDecrypt(string $value, string $iv)
Run the mcrypt decryption routine for the value.
protected string addPadding(string $value)
Add PKCS7 padding to a given value.
protected string stripPadding(string $value)
Remove the padding from the given value.
protected bool paddingIsValid(string $pad, string $value)
Determine if the given padding for a value is valid.
protected int getIvSize()
Get the IV size for the cipher.
protected int getRandomizer()
Get the random data source available for the OS.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.1/Illuminate/Encryption/McryptEncrypter.html