crypter 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 60

crypter #

Simple API for encrypting/decrypt (AES256, encrypt library that is based on pointy castle) and hashing (SHA256, using crypto library)

I just read some of the apis and have a only basic understanding of cryptography. Don't trust in my code without veryfing by yourself that it's safe to use. If you find some weaknesses or see improvements, just email me or post an issue on github.

0.0.0 #

Initial release

0.1.0 #

Solved some pub issues. Updated repository. Added an example.

0.1.1 #

Solved some pub issues.


import 'dart:typed_data';

import 'package:crypter/crypter.dart';

void main() {
  /// Some data
  var data = Uint8List.fromList(List.generate(256, (i) => i));

  /// A key
  var key = 'ksajog9243shd42l9ds42';

  /// Hash the data (automatically generates salt that is included in the hash)
  var hash = Crypter.hash(data);

  /// Encrypt the data
  var encrypted = Crypter.encrypt(data, key);

  /// Decrypting with the wrong key
  Crypter.decrypt(data, 'aslkdf');

  /// Decrypting with the correct key
  var decrypted = Crypter.decrypt(encrypted, key);

  /// The hash should equal
  assert(Crypter.checkHash(decrypted, hash));

  /// Note that the manual hashing here is not needed for encryption/decryption since the encrypted also contains a hash of the original object

Use this package as a library

1. Depend on it

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

  crypter: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or 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:crypter/crypter.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 Jun 5, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev

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 (encrypt).

Homepage URL isn't helpful. (-10 points)

Update the homepage field from pubspec.yaml: link to a website about the package or use the source repository URL.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
crypto ^2.0.6 2.1.5
encrypt ^3.2.0 3.3.1 4.0.2
Transitive dependencies
args 1.6.0
asn1lib 0.5.15 0.6.4
charcode 1.1.3
clock 1.0.1
collection 1.14.12
convert 2.1.1
meta 1.1.8
pointycastle 1.0.2
typed_data 1.1.6