crypter 0.1.1

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 Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19


Detected platforms: Flutter, web, other

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

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field was unreachable.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
crypto ^2.0.6 2.1.2
encrypt ^3.2.0 3.2.0
Transitive dependencies
args 1.5.2
asn1lib 0.5.8
charcode 1.1.2
collection 1.14.12
convert 2.1.1
pointycastle 1.0.1
typed_data 1.1.6