chore: Drop archived 'encrypt' dep, use pointycastle directly#92
Open
MohamedGawdat wants to merge 1 commit intoFlagsmith:mainfrom
Open
chore: Drop archived 'encrypt' dep, use pointycastle directly#92MohamedGawdat wants to merge 1 commit intoFlagsmith:mainfrom
MohamedGawdat wants to merge 1 commit intoFlagsmith:mainfrom
Conversation
The 'encrypt' package (leocavalcante/encrypt) is archived and pinned to pointycastle ^3.7.3, which permanently locks downstream apps out of pointycastle ^4.0.0. PR #343 to widen the constraint upstream has been open without review since Feb 2025 and cannot be merged. StorageSecurity used encrypt only as a thin wrapper around PointyCastle's Salsa20Engine. This change calls Salsa20Engine directly: - Same algorithm (Salsa20) - Same key derivation (MD5 of password, 16 bytes) - Same 8-byte random IV - Same on-disk format: base64(iv) || base64(ciphertext) Backwards-compatible with existing encrypted storage. Verified: - flutter pub get resolves cleanly with pointycastle ^4.0.0 - flutter analyze: no issues - flutter test: all 122 tests pass - StorageSecurity round-trip verified for ASCII, empty, unicode, JSON, and 1KB strings Closes Flagsmith#91
Author
|
@rolodato when you have a moment — this PR removes the dependency on the archived |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #91.
Why
flagsmith ^6.1.0depends onencrypt ^5.0.3, which pinspointycastle ^3.7.3. This blocks downstream apps that depend onpointycastle ^4.0.0:Bumping
encryptis not an option —leocavalcante/encryptis archived (read-only), and PR encrypt#343 (which would have widened itspointycastleconstraint) has been open and unreviewed since Feb 2025.encrypt 5.0.4will remain the final release, permanently locking it topointycastle ^3.7.3.What
StorageSecurity(the only consumer ofencryptin this codebase) usedencryptas a thin wrapper around PointyCastle'sSalsa20Engine. This PR callsSalsa20Enginedirectly:base64(iv) || base64(ciphertext)Fully backwards-compatible with existing encrypted storage — values written by previous versions decrypt identically.
Diff
(
encrypt/decryptmethods updated to call_processdirectly with utf8/base64 conversion — same I/O contract.)Net dependency change
encrypt,cryptopointycastle,cryptopointycastleencrypt)No new transitive packages added.