magic_encryption 1.0.2
magic_encryption: ^1.0.2 copied to clipboard
AES-256-CBC encryption for Magic apps: the Crypt facade, encrypter and key:generate.
Changelog #
All notable changes to this project will be documented in this file.
[Unreleased] #
1.0.2 - 2026-11-15 #
Changed #
- The package page is
https://anilcancakir.com/magic/encryptionand the documentation links sit underhttps://anilcancakir.com/magic/docs/encryption.
Fixed #
- The device-key page and the skill no longer say that uninstalling the app always removes the key: on Android it does, while on iOS the Keychain item can survive a reinstall.
1.0.1 - 2026-11-15 #
Fixed #
- Two device-key calls that start together on a first launch now share one generated key, so neither payload is lost after a restart.
key:generateno longer prints the new key; it prints a success line, and--showstill prints the key and leaves.envalone.- A raw key is checked by its UTF-8 byte length, so a 32-character non-ASCII key is refused at construction instead of failing later in
encryptanddecrypt, and a raw key shorter than 32 characters that encodes to 32 bytes is now accepted. - Error messages and doc comments now name the real command,
dart run magic:dowel key:generate. key:generatekeeps.envwell-formed when it appends the key (one newline before it, a trailing newline) and replaces the value of anexport APP_KEY=line, keeping theexportprefix. It writes.envin place, so the file mode and a symlink at its path are kept.generateDeviceKeyandclearDeviceKeynow wait for a device key creation that is still running, so Vault and the in-memory key cannot disagree and a late write cannot undo a clear.
1.0.0 - 2026-11-14 #
Added #
- First release. AES-256-CBC encryption for Magic apps, moved out of
magiccore. Cryptfacade:encryptanddecryptwith the app key (APP_KEY), andencryptWithDeviceKey,decryptWithDeviceKey,hasDeviceKey,generateDeviceKeyandclearDeviceKeywith a per-device key kept inVault.MagicEncrypter(the cipher),MagicDecryptExceptionandEncryptionServiceProvider(wiring).key:generatecommand, run asdart run magic:dowel key:generate, and adowelplugin provider (MagicEncryptionDowelProvider) thatdart run magic:dowel plugin:install magic_encryptionregisters.- Built on
dowel^1.0.0 andpointycastle^4.0.0. Requires Dart 3.13, Flutter 3.47 andmagic^1.0.0.