-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add legacy support for encryption and decryption methods in AES CyriptoService provider #30
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a legacy flag to the AES CryptoService provider to support JavaScript–compatible payload formats.
- Extended
encryptanddecryptmethods with abool $legacyparameter to switch IV/TAG ordering. - Factored payload construction into
buildPayloadand parsing intoparsePayload. - Updated tests to verify both default and legacy encryption/decryption flows.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/AESCryptoServiceProvider.php | Added legacy parameter, buildPayload/parsePayload methods, and updated docblocks |
| tests/AESCryptoServiceProviderTest.php | Added legacy-encryption test cases and decrypt(..., legacy: true) assertion |
Comments suppressed due to low confidence (3)
src/AESCryptoServiceProvider.php:161
- [nitpick] The single-letter variable
$cis not descriptive. Rename it to$cipherTextfor clarity.
$c = base64_decode($encryptedData);
tests/AESCryptoServiceProviderTest.php:19
- [nitpick] Add spaces around the
=operator to match coding style ($encryptedText = ...).
$encryptedText= $csp->encrypt($plainText, legacy: true);
src/AESCryptoServiceProvider.php:152
- [nitpick] Merge the
$legacyparam description onto the same line (e.g.@param bool $legacy True = IV-TAG-EncryptedData; false = IV-EncryptedData-TAG).
@param bool $legacy
closes #29
This pull request add better compatibilty with javascript encrypted data.