encrypt 0.2.0

  • README.md
  • Example
  • Installing
  • Versions
  • new70

encrypt

Pub Package Build Status

A set of high-level APIs over PointyCastle for two-way cryptography.

  • [x] AES
  • [x] Salsa20
  • [ ] RSA
import 'package:encrypt/encrypt.dart';

void main() {
  final key = 'my32lengthsupersecretnooneknows1';

  final encrypter = new Encrypter(new AES(key));
  final plainText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit ........';

  final encryptedText = encrypter.encrypt(plainText);
  final decryptedText = encrypter.decrypt(encryptedText);

  print(encryptedText); // db066ce180f62f020617eb720b891c1efcc48b217cb83272812a8efe3b30e7eae4373ddcede4ea77bdae77d126d95457b3759b1983bf4cb4a6a5b051a5690bdf
  print(decryptedText); // Lorem ipsum dolor sit amet, consectetur adipiscing elit ........
}

example/encrypt.dart

import 'package:encrypt/encrypt.dart';

void main() {
  final key = 'my32lengthsupersecretnooneknows1';

  final encrypter = new Encrypter(new AES(key));
  final plainText =
      'Lorem ipsum dolor sit amet, consectetur adipiscing elit ........';

  final encryptedText = encrypter.encrypt(plainText);
  final decryptedText = encrypter.decrypt(encryptedText);

  print(
      encryptedText); // db066ce180f62f020617eb720b891c1efcc48b217cb83272812a8efe3b30e7eae4373ddcede4ea77bdae77d126d95457b3759b1983bf4cb4a6a5b051a5690bdf
  print(
      decryptedText); // Lorem ipsum dolor sit amet, consectetur adipiscing elit ........
}

Use this package as a library

1. Depend on it

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


dependencies:
  encrypt: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:encrypt/encrypt.dart';
  
Version Uploaded Documentation Archive
0.2.0 Jul 3, 2018 Go to the documentation of encrypt 0.2.0 Download encrypt 0.2.0 archive
0.1.0 Jul 3, 2018 Go to the documentation of encrypt 0.1.0 Download encrypt 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
55
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
64
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on Jul 20, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.69.0
  • pana: 0.11.7

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:encrypt/encrypt.dart.

Issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Maintain CHANGELOG.md.

Changelog entries help clients to follow the progress in your code.

Package is pre-v1 release.

While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <2.0.0
pointycastle ^1.0.0-rc2 1.0.0-rc2
Transitive dependencies
analyzer 0.31.1 0.32.3
args 1.4.4
async 2.0.8
barback 0.15.2+16
build 0.12.7+2
build_barback 0.5.0+4
build_config 0.2.6+2 0.3.1+1
build_resolvers 0.2.1+1
build_runner 0.8.3 0.9.2
built_collection 3.1.1
built_value 5.5.3
charcode 1.1.2
cli_util 0.1.3+2
code_builder 3.1.2
code_transformers 0.5.1+5
collection 1.14.11
convert 2.0.2
crypto 2.0.6
csslib 0.14.4+1
dart2_constant 1.0.1+dart2
dart_style 1.0.9+1 1.1.3
fixnum 0.10.8
front_end 0.1.0-alpha.9 0.1.3
glob 1.1.7
graphs 0.1.2+1
html 0.13.3+2
http 0.11.3+17
http_multi_server 2.0.5
http_parser 3.1.3
io 0.3.3
isolate 1.1.0 2.0.2
kernel 0.3.0-alpha.9 0.3.3
logging 0.11.3+2
matcher 0.12.4
meta 1.1.6
mime 0.9.6+1
package_config 1.0.5
package_resolver 1.0.3
path 1.6.2
plugin 0.2.0+3
pool 1.3.5
quiver 0.29.0+2 2.0.0+1
reflectable 2.0.1
shelf 0.7.3+3
source_maps 0.10.7
source_span 1.4.1
stack_trace 1.9.3
stream_channel 1.6.8
stream_transform 0.0.14+1
string_scanner 1.0.3
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
test ^1.2.0