secure_compressor 1.0.2
secure_compressor: ^1.0.2 copied to clipboard
Encrypt a string and compress it into a smaller size
secure-compressor #
secure_compressor
is a Dart package that provides utilities for securely encrypting, decrypting, compressing, and decompressing string data using AES encryption and gzip compression.
Features #
- 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.
Installation #
Add the following to your pubspec.yaml
file:
dependencies:
secure_compressor: <Latest/Version>
Then, run flutter pub get to fetch the package.
Usages #
Encrypt
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
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 Local Storage
Save data to a local file:
await SecureCompressor.saveDataToLocal(fileName, data);