You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UTF-8 charset handling causes AES/JWE interoperability test failures #127
Have you provided a code sample to reproduce the issue?
Have you tested with the latest release to confirm the issue still exists?
Have you searched for related issues/PRs?
What's the actual output vs expected output?
Description
AES/JWE interoperability tests fail on some environments due to inconsistent charset handling during string-to-byte conversions. The implementation currently relies on the platform default charset, which can produce different byte sequences for non-ASCII characters depending on the runtime environment. As a result, encryption/decryption behavior is not deterministic across systems, causing interoperability test failures.
To Reproduce
Run the AES/JWE interoperability tests.
Use plaintext or payload containing non-ASCII characters.
Observe that the generated byte arrays differ from the expected output on environments with different default character encodings.
Expected behavior
String input should always be encoded using UTF-8 so that encryption and decryption produce deterministic, platform-independent results and the interoperability tests pass consistently.
Screenshots
Attached below is the failing test output demonstrating the issue.
Additional context
Environment: Java/Maven-based project
Issue observed during AES/JWE interoperability test execution
The behavior is triggered when processing non-ASCII characters due to platform-dependent string-to-byte conversion
Related issues/PRs
None found at the time of reporting.
Suggest a fix/enhancement
Explicitly use StandardCharsets.UTF_8 for all string-to-byte conversions in the AES/JWE processing path and ensure related tests use the same encoding when constructing expected byte arrays.
Assignment
I'd like to work on this issue and submit a fix. Please assign it to me if it's available.
I’ve verified the issue and confirmed that the UTF-8 charset handling causes the AES/JWE interoperability test failures as described.
I’ve also submitted PR #128 with the fix, which explicitly uses UTF-8 for the relevant string-to-byte conversions and includes the corresponding test updates. The PR is marked to resolve this issue.
Could you please assign this issue to me? I’d be happy to continue addressing any review feedback and make any additional changes required.
Activity
maheshshinde9100 commentedon Aug 10, 2026
I’ve verified the issue and confirmed that the UTF-8 charset handling causes the AES/JWE interoperability test failures as described.
I’ve also submitted PR #128 with the fix, which explicitly uses UTF-8 for the relevant string-to-byte conversions and includes the corresponding test updates. The PR is marked to resolve this issue.
Could you please assign this issue to me? I’d be happy to continue addressing any review feedback and make any additional changes required.