v1.0.4
native_encryptor
네이티브 코드를 사용하여 Flutter 앱에서 데이터를 안전하게 암호화/복호화하세요. 보안을 강화하기 위해 임의의 솔트와 IV를 추가하세요. 사용하기 쉬운 API로 크로스 플랫폼 호환성 제공.
6좋아요 2130일 다운로드130Pub 점수
AndroidiOSmacOS
네이티브 코드를 사용하여 Flutter 앱에서 데이터를 안전하게 암호화/복호화하세요. 보안을 강화하기 위해 임의의 솔트와 IV를 추가하세요. 사용하기 쉬운 API로 크로스 플랫폼 호환성 제공.
{"sdk":"flutter"}{"sdk":"flutter"}^1.1.1^2.1.8{"sdk":"flutter"}^6.0.0아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Native Encryptor for Flutter
A powerful plugin for secure data handling in your Flutter apps.
Key Features
Installation
Add to pubspec.yaml:
YAML
dependencies:
native_encryptor: <latest_version>
Bash
flutter pub get
import 'package:native_encryptor/native_encryptor.dart';
Basic Usage
Dart
import 'package:flutter/material.dart';
import 'package:native_encryptor/native_encryptor.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final _nativeEncryptorPlugin = NativeEncryptor();
final TextEditingController _controller = TextEditingController(text: "Secret Message");
String? encryptedData;
String? decryptedData;
final String passphrase = "YourSecretPassphrase";
Future<void> encrypt() async {
encryptedData = await _nativeEncryptorPlugin.encrypt(
passPhrase: passphrase,
contentToEncrypt: _controller.text,
);
setState(() {});
}
Future<void> decrypt() async {
decryptedData = await _nativeEncryptorPlugin.decrypt(
passPhrase: passphrase,
concatenatedCipherText: encryptedData!,
);
setState(() {});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Native Encryptor')),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
TextField(
controller: _controller,
decoration: const InputDecoration(labelText: 'Enter text'),
),
ElevatedButton(onPressed: encrypt, child: const Text('Encrypt')),
if (encryptedData != null)
Text('Encrypted: $encryptedData'),
ElevatedButton(onPressed: decrypt, child: const Text('Decrypt')),
if (decryptedData != null)
Text('Decrypted: $decryptedData'),
],
),
),
),
);
}
}
API Reference
encrypt({required String passPhrase, required String contentToEncrypt}) Encrypts the given content with the provided passphrase.
Returns: The encrypted data as a string.decrypt({required String passPhrase, required String concatenatedCipherText}) Decrypts the given encrypted data with the provided passphrase.
Returns: The original decrypted content.getPlatformVersion() Retrieves the current platform version for debugging purposes.License
This plugin is licensed under the MIT License.
Contributing
We welcome contributions! Please feel free to open issues or submit pull requests.
Connect with me:
Enhance your Flutter app's security with Native Encryptor!