class Encrypter implements Encrypter (View source)

Methods

void
__construct(string $key, string $cipher = 'AES-128-CBC')

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
decrypt(string $payload)

Decrypt the given value.

string
getKey()

Get the encryption key.

Details

at line line 35
void __construct(string $key, string $cipher = 'AES-128-CBC')

Create a new encrypter instance.

Parameters

string $key
string $cipher

Return Value

void

Exceptions

RuntimeException

at line line 54
static bool supported(string $key, string $cipher)

Determine if the given key and cipher combination is valid.

Parameters

string $key
string $cipher

Return Value

bool

at line line 69
string encrypt(string $value)

Encrypt the given value.

Parameters

string $value

Return Value

string

Exceptions

EncryptException

at line line 101
string decrypt(string $payload)

Decrypt the given value.

Parameters

string $payload

Return Value

string

Exceptions

DecryptException

at line line 185
string getKey()

Get the encryption key.

Return Value

string