GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions | Private Attributes | Static Private Attributes
Encryption Class Reference

This class provides basic data encryption functionality. More...

Public Member Functions

 decrypt ( $data)
 Decrypts data. More...
 
 encrypt ( $data, $use_random_nonce=true, $custom_nonce=null)
 Encrypts data. More...
 
 get_random_nonce ()
 Returns a random 24-byte nonce. More...
 
 hash ( $data)
 Generates a quick one-way hash of data. More...
 

Static Public Member Functions

static get_instance ( $secret_key='')
 Returns class instance. More...
 

Data Fields

const DEFAULT_NONCE = 'bc5d92ffc6c54ff8d865a1e6f3361f48d0a84a2b145be34e'
 

Private Member Functions

 __construct ( $secret_key='')
 Class constructor. More...
 

Private Attributes

 $_secret_key
 

Static Private Attributes

static $_instance
 

Detailed Description

This class provides basic data encryption functionality.

Definition at line 16 of file Encryption.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $secret_key = '')
private

Class constructor.

Since
1.0.0
Parameters
string$secret_key(optional) Secret key to be used for encryption. Default: wp_salt() value.
Returns
void

Definition at line 42 of file Encryption.php.

Member Function Documentation

◆ decrypt()

decrypt (   $data)

Decrypts data.

Note: This is for internal use and is not intended for highly-sensitive applications.

Since
1.0.0
Parameters
string$dataData to encrypt.
Returns
string|null

Definition at line 131 of file Encryption.php.

◆ encrypt()

encrypt (   $data,
  $use_random_nonce = true,
  $custom_nonce = null 
)

Encrypts data.

Note: This is for basic internal use and is not intended for highly-sensitive applications.

Since
1.0.0
Parameters
string$dataData to encrypt.
bool$use_random_nonce(optional) Whether to use random nonce. Default: true.
string | null$custom_nonce(optional) Custom IV value to use. Default: null.
Returns
false|mixed|string

Definition at line 88 of file Encryption.php.

References Encryption\get_random_nonce().

◆ get_instance()

static get_instance (   $secret_key = '')
static

Returns class instance.

Since
1.0.0
Parameters
string$secret_key(optional) Secret key to be used for encryption. Default: wp_salt() value.
Returns
Encryption

Definition at line 67 of file Encryption.php.

Referenced by LicenseManager\ajax_deactivate_license(), ProductManager\ajax_get_products_data(), LicenseManager\get_licenses_data(), Framework\get_log_file(), Core\init(), LicenseManager\modify_license_data_for_frontend_output(), and LicenseManager\save_licenses_data().

◆ get_random_nonce()

get_random_nonce ( )

Returns a random 24-byte nonce.

Since
1.0.0
Exceptions
Exception
Returns
string

Definition at line 174 of file Encryption.php.

Referenced by Encryption\encrypt().

◆ hash()

hash (   $data)

Generates a quick one-way hash of data.

Note: This is for internal use and is not intended for highly-sensitive applications.

Since
1.0.0
Parameters
string$dataThe data to create a hash of.
Returns
string The hash.

Definition at line 161 of file Encryption.php.

Field Documentation

◆ $_instance

$_instance
staticprivate

Definition at line 24 of file Encryption.php.

◆ $_secret_key

$_secret_key
private

Definition at line 31 of file Encryption.php.

◆ DEFAULT_NONCE

const DEFAULT_NONCE = 'bc5d92ffc6c54ff8d865a1e6f3361f48d0a84a2b145be34e'

Definition at line 17 of file Encryption.php.


The documentation for this class was generated from the following file: