crypter 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 62

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.

example/main.dart

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:


dependencies:
  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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
32
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

We analyzed this package on Oct 18, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

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 https://pub.dev/packages/crypter was unreachable.

Dependencies

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