diff --git a/README.md b/README.md index 511b1a2..efdc2fa 100644 --- a/README.md +++ b/README.md @@ -8,36 +8,8 @@ ## Usage -Use this package as a library -1. Depend on it -Add this to your package's pubspec.yaml file: - -``` -dependencies: - flutter_aes_ecb_pkcs5: ^0.1.1 -``` - -2. Install it You can install packages from the command line: - -with Flutter: - -``` -$ flutter pub get -``` - -Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more. - -3. Import it Now in your Dart code, you can use: - -``` -import 'package:flutter_aes_ecb_pkcs5/flutter_aes_ecb_pkcs5.dart'; -``` - - - -#### AES Use Example - +#### AES ```dart import 'package:flutter_aes_ecb_pkcs5/flutter_aes_ecb_pkcs5.dart'; @@ -46,15 +18,15 @@ void main() { var data = "{\"username\":\"helloword\"}"; - //generate a 16-byte random key + //生成16字节的随机密钥 var key = await FlutterAesEcbPkcs5.generateDesKey(128); print(key); - //encrypt + //加密 var encryptText = await FlutterAesEcbPkcs5.encryptString(data, key); print(encryptText); - //decrypt + //解密 var decryptText = await FlutterAesEcbPkcs5.decryptString(encryptText, key); print(decryptText);