secure_compressor is a Dart package that provides utilities for securely encrypting, decrypting, compressing, and decompressing string data using AES encryption and gzip compression.
- Encrypt and decrypt string data using AES encryption.
- Compress and decompress string data using gzip.
- Combine encryption and compression for secure and efficient data storage and transmission.
- Save encrypted and compressed data to local storage.
Add the following to your pubspec.yaml file:
dependencies:
secure_compressor: <Latest/Version>Then, run flutter pub get to fetch the package.
Encrypt a string using AES encryption:
final encryptedData = await SecureCompressor.encrypt(data, keyString, ivString: ivString);Compress and then encrypt a string:
final compressedAndEncryptedData = await SecureCompressor.compressAndEncrypt(data, keyString, ivString: ivString);Decrypt an AES encrypted string:
final decryptedData = SecureCompressor.decrypt(encryptedData, keyString, ivString: ivString);Decrypt and then uncompress a string:
final uncompressedAndDecryptedData = SecureCompressor.uncompressAndDecrypt(compressedAndEncryptedData, keyString, ivString: ivString);Save data to a local file:
await SecureCompressor.saveDataToLocal(fileName, data);