panique / huge

Simple user-authentication solution, embedded into a small framework.
2.14k stars 789 forks source link

in the encryption.php file #892

Open mdk1980 opened 3 years ago

mdk1980 commented 3 years ago

I have a quick question from the encryption.php file located in the core folder. Obviously, its a file for encryption and decryption of string data. My question lies in the decrypt($ciphertext) function.

in that function on line 95 you have $macSize = 64; I can't understand where this variable comes from and why its exactly 64.

also, in that same decrypt( ) function, there is on line 97: $iv_cipher = mb_substr ( $ciphertext, $macSize, NULL , '8bit' ); because of the NULL value, wont this function return an empty string? See: https://www.w3schools.com/php/func_string_substr.asp

Vizzielli commented 3 years ago

About mb_substr() always look the official PHP doc: https://www.php.net/manual/en/function.mb-substr.php

length Maximum number of characters to use from string. If omitted or NULL is passed, extract all characters to the end of the string.

It is used to setup last param only.

About first question, try to print out the $chipertext value.