flutter_cipher 0.0.3

  • Readme
  • Changelog
  • Installing
  • 69

flutter_cipher #

一个Flutter加密类库 A Flutter encryption class library

Getting Started #

兼容iOS和Android Compatible with iOS and Android

RSA: 密钥格式: PKCS#1 Key format: PKCS#1

案例: example:

Asymmetric rsa = Cipher.getAsymmetricInstance(RSA(publicKey: publicKey, privateKey: privateKey));

var encryptPublic = rsa.encryptPublic(content);
var encryptPrivate = rsa.encryptPrivate(content);

var decryptPublic = rsa.decryptPublic(encryptPrivate);
var decryptPrivate = rsa.decryptPrivate(encryptPublic);


案例: example:

Key key = Key.fromUtf8('32 length key................');
IV iv = IV.fromLength(16);

Symmetry aes = Cipher.getSymmetryInstance(AES(key, iv)));

var encrypted = aes.encrypt(bytes);
var encrypted = aes.encryptString(str);

var content = aes.decrypt(encrypted);
var content = aes.decrypt2String(encrypted);

Finally, we would like to thank leocavalcante, as the main content of this library is derived from the encrypt library.

[0.0.1] - TODO: Add release date.

  • TODO: Describe initial release.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_cipher: ^0.0.3

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_cipher/flutter_cipher.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Fix lib/src/encrypted.dart. (-0.50 points)

Analysis of lib/src/encrypted.dart reported 1 hint:

line 41 col 17: Override hashCode if overriding ==.

Format lib/flutter_cipher.dart.

Run flutter format to format lib/flutter_cipher.dart.

Format lib/src/algorithm.dart.

Run flutter format to format lib/src/algorithm.dart.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/algorithms/aes.dart (Run flutter format to format lib/src/algorithms/aes.dart.)
  • lib/src/algorithms/rsa.dart (Run flutter format to format lib/src/algorithms/rsa.dart.)
  • lib/src/cipher.dart (Run flutter format to format lib/src/cipher.dart.)

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (asn1lib).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and flutter_cipher.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
args ^1.5.1 1.5.2
asn1lib ^0.5.8 0.5.15 0.6.0
collection ^1.14.11 1.14.11 1.14.12
flutter 0.0.0
pointycastle ^1.0.1 1.0.2
Transitive dependencies
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies