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

Extension of the Crypt class for easier and more extensive use. #44560

Open
MaxxDau opened this issue Nov 30, 2024 · 1 comment
Open

Extension of the Crypt class for easier and more extensive use. #44560

MaxxDau opened this issue Nov 30, 2024 · 1 comment

Comments

@MaxxDau
Copy link

MaxxDau commented Nov 30, 2024

Is your feature request related to a problem? Please describe.

The use of cryptographic functions still requires too much effort to achieve the simplest goals.
Encryption within a Joomla installation with a default key.
Encryption for import/export across different Joomla installations with a password.

Describe the solution you'd like

Symmetric encryption is sufficient and more advantageous for many applications.
Creation of a standard key in the installation process based on the secret from the config.
Cryptographic functions use the standard key if no key has been provided.
Extension of the class for encryption with password.

The Crypt class should take over the complete process so that no security-relevant data or processes take place outside the class.

Additional context

Input and output should always be sodium_bin2base64 with SODIUM_BASE64_VARIANT_URLSAFE. This avoids errors during storage and transmission.
Use of sodium_memzero for more security.
For future-proof functionality, the length of the bytes used should be included in the output (for example: SODIUM_CRYPTO_PWHASH_SALTBYTES, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, ...)
This ensures that the correct number of bytes will always be used for decryption in future versions of PHP and that encryption can be carried out with a new byte length if necessary.

@brianteeman
Copy link
Contributor

I wouldnt base anything on the secret key in the config as it is not unique

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

No branches or pull requests

4 participants