rsaa_crypt 0.0.2 rsaa_crypt: ^0.0.2 copied to clipboard
Enables you to quickly implement RSAA file and text encryption in your flutter app.
Example #
import 'package:rsaa_crypt/rsaa_crypt.dart';
String key = 'π»π',
message = 'Hello! CzeΕΔ! π»π δ½ ε₯½! γζ¨ζΆοΌΠΡΠΈΠ²Π΅Ρ! βπ’π©π©π¬!',
cipher,
decipher;
// Text Encryption (Text Cipher)
RSAACrypt().encryptText(key, message).then((value) {
cipher = Util().bytesToText(value);
});
// Text Decryption (Text Cipher)
RSAACrypt().decryptText(key, Util().textToBytes(cipher)).then((value) {
decipher = value;
});
// Text Encryption (Base64 Cipher)
RSAACrypt().encryptText(key, message).then((value) {
cipher = Util().bytesToBase64(value);
});
// Text Decryption (Base64 Cipher)
RSAACrypt().decryptText(key, Util().base64ToBytes(cipher)).then((value) {
decipher = value;
});
// File Encryption
RSAACrypt().encryptFile(key, File(inputFilePath)).then((value) {
Util().writeFile(encryptedFilePath, value);
});
// File Decryption
RSAACrypt().decryptFile(key, File(encryptedFilePath)).then((value) {
Util().writeFile(decryptedFilePath, value);
});