Documentation

AbstractEncrypter
in package

AbstractYes

Pop Crypt abstract encrypter

Tags
category

Pop

author

Nick Sagona, III dev@noladev.com

copyright

Copyright (c) 2009-2026 NOLA Interactive, LLC.

license

https://www.popphp.org/license New BSD License

version
3.0.0

Table of Contents

Properties

$cipher  : string
Encryption cipher
$key  : string|null
Encryption Key
$previousKeys  : array<string|int, mixed>
Previous keys

Methods

__construct()  : mixed
Constructor
decrypt()  : mixed
Decrypt value
encrypt()  : string
Encrypt value
getAllKeys()  : array<string|int, mixed>
Get all keys
getCipher()  : string
Get cipher
getKey()  : string
Get key
getPreviousKeys()  : array<string|int, mixed>
Get previous keys
hasCipher()  : bool
Has cipher
hasKey()  : bool
Has key
hasPreviousKeys()  : bool
Has previous keys
isAvailable()  : bool
Determine if the cipher is available
isValid()  : bool
Determine if the key and cipher combination is valid
setCipher()  : static
Set cipher
setKey()  : static
Set key
setPreviousKeys()  : static
Set previous keys

Properties

$previousKeys

Previous keys

protected array<string|int, mixed> $previousKeys = []

Methods

__construct()

Constructor

public __construct(string $key[, string $cipher = 'aes-256-cbc' ][, bool $raw = true ]) : mixed

Instantiate the Encrypter object

Parameters
$key : string
$cipher : string = 'aes-256-cbc'
$raw : bool = true
Tags
throws
Exception

decrypt()

Decrypt value

public abstract decrypt(string $payload) : mixed
Parameters
$payload : string

encrypt()

Encrypt value

public abstract encrypt(mixed $value) : string
Parameters
$value : mixed
Return values
string

getAllKeys()

Get all keys

public getAllKeys() : array<string|int, mixed>
Return values
array<string|int, mixed>

getKey()

Get key

public getKey([bool $raw = false ]) : string
Parameters
$raw : bool = false
Return values
string

getPreviousKeys()

Get previous keys

public getPreviousKeys([bool $raw = false ]) : array<string|int, mixed>
Parameters
$raw : bool = false
Return values
array<string|int, mixed>

hasPreviousKeys()

Has previous keys

public hasPreviousKeys() : bool
Return values
bool

isAvailable()

Determine if the cipher is available

public abstract static isAvailable(string $cipher) : bool
Parameters
$cipher : string
Return values
bool

isValid()

Determine if the key and cipher combination is valid

public abstract static isValid(string $key, string $cipher[, bool $raw = true ]) : bool
Parameters
$key : string
$cipher : string
$raw : bool = true
Return values
bool

setCipher()

Set cipher

public setCipher(string $cipher) : static
Parameters
$cipher : string
Return values
static

setKey()

Set key

public setKey(string $key[, bool $raw = true ]) : static
Parameters
$key : string
$raw : bool = true
Return values
static

setPreviousKeys()

Set previous keys

public setPreviousKeys(array<string|int, mixed> $previousKeys[, bool $raw = true ]) : static
Parameters
$previousKeys : array<string|int, mixed>
$raw : bool = true
Tags
throws
Exception
Return values
static

        
On this page

Search results