-
-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Description:
Currently, the RSAParameters
class stores the passphrase as a private property:
private ?string $passphrase = 'test_passphrase';
Storing the passphrase in memory as part of the object can be a security risk, especially if the object persists longer than necessary or is accidentally exposed. A more secure approach is to require the user to provide the passphrase each time the private key is accessed or decrypted, rather than storing it in the class.
Tasks:
- Remove the
$passphrase
property fromRSAParameters
. - Refactor all methods that use
$this->passphrase
to accept the passphrase as a method argument instead. - Update the constructor, setters, and any related code to no longer store the passphrase.
- Update documentation and usage examples to reflect this change.
- Add tests to ensure that the new approach works as expected and does not break existing functionality.
Benefits:
- Reduces the risk of passphrase leakage.
- Follows best practices for sensitive data handling.
- Makes the library safer for use in security-critical applications.
Metadata
Metadata
Assignees
Labels
No labels