secure_qr_generator 1.1.0
secure_qr_generator: ^1.1.0 copied to clipboard
A Flutter package for generating secure, auto-regenerating QR codes with encryption, digital signatures, and automatic expiration management.
Changelog #
All notable changes to the Secure QR Generator will be documented in this file.
1.1.0 - 2026-07-14 #
Added #
- New compact payload format: CBOR serialization + Base45 encoding, replacing JSON + Base64 for a significantly smaller, faster-to-scan QR code
QrPayloadFormatenum (legacy/compact) andGeneratorConfig.payloadFormatto select which formatgenerateQRemits- Encrypt-then-MAC signing order for the compact format: the HMAC-SHA256 tag is now computed over the encrypted body (IV + ciphertext) rather than the plaintext, so a tampered or corrupted QR code can be rejected by the validator before it attempts decryption
- Compact format uses short integer keys (
0–3) instead of named JSON fields, and stores the QR code id as raw bytes instead of a UUID string — both reduce payload size independently of your business data
Changed #
estimateQRSizeandcanEncodeDatanow compute their estimate based on the currently configuredpayloadFormat, instead of always assuming the legacy JSON/Base64 overhead- Internal payload size limit is enforced per format: 700 bytes of raw CBOR for
compact, 2000 characters of JSON forlegacy(unchanged from previous versions)
Migration notes #
- No breaking changes. Existing code continues to emit the legacy JSON + Base64 format unless
payloadFormat: QrPayloadFormat.compactis explicitly set —GeneratorConfig's default islegacy. - Before switching any generator to
compact, make sure every reader of its QR codes (peer app instances and/or your own terminals) is runningsecure_qr_validator1.2.0 or later, which understands both formats. A validator on an earlier version only understandslegacyand will fail to readcompact-format QR codes. - For a gradual, reversible switch (recommended for peer-to-peer scanning scenarios), drive
GeneratorConfig.payloadFormatfrom a remotely-controlled flag rather than a hardcoded value, so you can roll back instantly if some peers are still on an old validator. - New dependencies pulled in by this package:
cborandbase45.