Sec
class Sec
Class Sec
Constants
JWT_ALG_HS256 |
|
JWT_ALG_RS256 |
|
Methods
AES Counter Decryption (PHP Based)
AES Counter Encryption (PHP Based)
Calculate TOTP based on https://github.com/Dolondro/google-authenticator/blob/master/src/GoogleAuthenticator.php
Executes a given callback in CMD mode, thus circumventing any rights DO NOT USE LIGHTLY!!! This primarily aims at allowing reference and link resolval!
Make sure a filename does not contain any directory characters to prevent unallowed traversals
Generates a JWT Token.
Wrapper for pronouncable password
Generate pronouncable password
Returns a generated password string
Generates a Secret for TOTP Authentication
Check how good a password is (Score > 4 is acceptable, Score > 7 is good)
No description
Filter INPUT based on certain rules:
- XSS: Encode ALL Special Chars ('"<>& and chars with ASCII value less 32)
Takes an array and casts values / escapes values according to type
Will check the standard security criteria of the supplied JWT Token If no security (expiration, signature) is provided, this method will only decode the token
No description
No description
Send CSP Header
Send CSP Headers for files that are user uploads to prevent persistent XSS attacks when users upload files Function will send headers based on filetype and system configuration
Details
at line 151
aes_decrypt($string, $key = false)
deprecated
deprecated
No description
at line 202
string
aes_decrypt_ctr(string $string, string $key = null)
AES Counter Decryption (PHP Based)
at line 139
string
aes_encrypt($string, $key = false)
deprecated
deprecated
encrypts a string and returns a binary string
at line 167
string
aes_encrypt_ctr(string $string, string $key = null)
AES Counter Encryption (PHP Based)
at line 370
string
calculate_totp_code($secret, null $timeSlice = null)
Calculate TOTP based on https://github.com/Dolondro/google-authenticator/blob/master/src/GoogleAuthenticator.php
at line 342
mixed
execute_circumventing_rights(mixed $callback, mixed $params = array())
Executes a given callback in CMD mode, thus circumventing any rights DO NOT USE LIGHTLY!!! This primarily aims at allowing reference and link resolval!
at line 561
string|string[]
filename($filename)
Make sure a filename does not contain any directory characters to prevent unallowed traversals
at line 433
string
generateJWTToken(string $secret, User $user = null, array $customPayload = [])
Generates a JWT Token.
at line 223
string
generate_password(int $length = 8, int $strength = 7)
Wrapper for pronouncable password
at line 259
string
generate_pronouncable_password(int $length = 8, int $strength = 7)
Generate pronouncable password
at line 233
generate_random_password(int $length = 8, int $strength = 7)
Returns a generated password string
at line 401
string
generate_totp_secret()
Generates a Secret for TOTP Authentication
at line 303
int
get_password_score(mixed $password)
Check how good a password is (Score > 4 is acceptable, Score > 7 is good)
at line 16
init()
No description
at line 30
string|null
input(string $string, array $options = array('xss', 'sql'))
Filter INPUT based on certain rules:
- XSS: Encode ALL Special Chars ('"<>& and chars with ASCII value less 32)
at line 98
array
input_array(array $array, string $filterType = 'intcast')
Takes an array and casts values / escapes values according to type
at line 476
bool
isValidJWTToken(string $token, string|resource $secretOrPublicKeyInfo = null, string $alg = self::JWT_ALG_HS256, array $header = [], array $payload = [])
Will check the standard security criteria of the supplied JWT Token If no security (expiration, signature) is provided, this method will only decode the token
at line 418
iv_decrypt()
No description
at line 414
iv_encrypt($string)
No description
at line 600
sendContentSecurityPolicyHeader()
Send CSP Header
at line 573
bool
sendContentSecurityPolicyHeaderForUserUpload(string $fileExtension = null)
Send CSP Headers for files that are user uploads to prevent persistent XSS attacks when users upload files Function will send headers based on filetype and system configuration