LSSodiumOld

Class LSSodiumOld

package

Default

Methods

Check if encryption key exist in configuration and generate it if missing

checkIfKeyExists(): void
Throws
\SodiumException

Check if Sodium library is installed

checkIfLibraryExists(): void

Decrypt encrypted string.

decrypt(string $sEncryptedString,boolean $bReturnFalseIfError = false): string
Throws
\SodiumException

Arguments

$sEncryptedString

string

Encrypted string to decrypt

$bReturnFalseIfError

boolean

false by default. If TRUE, return false in case of error (bad decryption). Else, return given $encryptedInput value

Response

string

Return decrypted value (string or unsezialized object) if suceeded. Return FALSE if an error occurs (bad password/salt given) or inpyt encryptedString

Encrypt input data using AES256 CBC encryption

encrypt(string $sDataToEncrypt): string
Throws
\SodiumException

Arguments

$sDataToEncrypt

string

Data to encrypt. Could be a string or a serializable PHP object

Response

string

Return encrypted AES256 CBC value

Write encryption key to version.php config file

generateEncryptionKeys(): void
Throws
\Exception

Get encryption key from version.php config file

getEncryptionKey(): string
Throws
\SodiumException

Response

string

Return encryption key string

Get encryption key from version.php config file

getEncryptionPublicKey(): string
Throws
\SodiumException

Response

string

Return encryption key string

Get encryption key from version.php config file

getEncryptionSecretKey(): string
Throws
\SodiumException

Response

string

Return encryption key string

init

init()

Properties

bLibraryExists

bLibraryExists :

Type(s)

sEncryptionKeypair

sEncryptionKeypair :

Type(s)

sEncryptionPublicKey

sEncryptionPublicKey :

Type(s)

sEncryptionSecretKey

sEncryptionSecretKey :

Type(s)