Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in the encryption.php file #892

Open
mdk1980 opened this issue Dec 22, 2020 · 1 comment
Open

in the encryption.php file #892

mdk1980 opened this issue Dec 22, 2020 · 1 comment

Comments

@mdk1980
Copy link

mdk1980 commented Dec 22, 2020

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants