cipher 0.7.1

  • README.md
  • changelog.md
  • Installing
  • Versions
  • 59

cipher

A Dart library for encryption and decryption. As of today, most of the classes are ports of Bouncy Castle from Java to Dart. The porting is almost always direct except for some classes that had been added to ease the use of low level data.

To make sure nothing fails, tests and benchmarks for every algorithm are provided. The expected results are taken from the Bouncy Castle Java version and also from standards, and matched against the results got from cipher.

As of the last release, the following algorithms are implemented:

Block ciphers:

  • AES

Asymmetric block ciphers:

  • RSA

Stream ciphers:

  • Salsa20

Block cipher modes of operation:

  • CBC (Cipher Block Chaining mode)
  • CFB (Cipher Feedback mode)
  • ECB (Electronic Code Book mode)
  • GCTR (GOST 28147 OFB counter mode)
  • OFB (Output FeedBack mode)
  • CTR (Counter mode)

Paddings:

  • PKCS7

Digests:

  • MD2
  • MD4
  • MD5
  • RIPEMD-128
  • RIPEMD-160
  • RIPEMD-256
  • RIPEMD-320
  • SHA-1
  • SHA-224
  • SHA-256
  • SHA-3
  • SHA-384
  • SHA-512
  • SHA-512/t
  • Tiger
  • Whirlpool

MACs:

  • HMAC

Signatures:

  • ECDSA
  • RSA

Password based key derivators:

  • PBKDF2
  • scrypt

Asymmetric key generators:

  • ECDSA
  • RSA

Entropy sources (true RNGs):

  • URL based (can be used, for example, with random.org)
  • File based (can be used, for example, with /dev/random)

Secure PRNGs:

  • Based on block cipher in CTR mode
  • Based on block cipher in CTR mode with auto reseed (for forward security)

Version 0.7.1 (2014-05-11) (Dart SDK version 1.4.0-dev.6.2)

  • [enh 84] Dually license the project under Mozilla Public License as well as under LGPL.

Version 0.7.0 (2014-03-22) (Dart SDK version 1.3.0-dev.5.2)

  • [enh 15] Implement stream cipher benchmarks.

  • [enh 64] Benchmark and optimize digests.

  • [enh 74] Make SHA-3 usable in terms of speed.

  • [bug 67] Removed some unused code.

  • [bug 68] Fix process() method of PaddedBlockCipher.

  • [bug 75] Remove a registry dependency in the Scrypt algorithm.

1. Depend on it

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


dependencies:
  cipher: "^0.7.1"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:cipher/cipher.dart';
        
Version Uploaded Documentation Archive
0.7.1 May 11, 2014 Go to the documentation of cipher 0.7.1 Download cipher 0.7.1 archive
0.7.0 Mar 22, 2014 Go to the documentation of cipher 0.7.0 Download cipher 0.7.0 archive
0.6.0 Feb 24, 2014 Go to the documentation of cipher 0.6.0 Download cipher 0.6.0 archive
0.5.1 Jan 20, 2014 Go to the documentation of cipher 0.5.1 Download cipher 0.5.1 archive
0.5.0 Jan 15, 2014 Go to the documentation of cipher 0.5.0 Download cipher 0.5.0 archive
0.4.0 Nov 18, 2013 Go to the documentation of cipher 0.4.0 Download cipher 0.4.0 archive
0.3.1 Nov 11, 2013 Go to the documentation of cipher 0.3.1 Download cipher 0.3.1 archive
0.3.0 Nov 1, 2013 Go to the documentation of cipher 0.3.0 Download cipher 0.3.0 archive
0.2.0 Oct 13, 2013 Go to the documentation of cipher 0.2.0 Download cipher 0.2.0 archive
0.1.0 Oct 12, 2013 Go to the documentation of cipher 0.1.0 Download cipher 0.1.0 archive

All 13 versions...

Analysis

This feature is new.
We welcome feedback.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Dec 6, 2017
  • Dart: 2.0.0-dev.8.0
  • pana: 0.7.3+1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
80
Health:
Code health derived from static analysis. [more]
64
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall score:
Weighted score of the above. [more]
59

Platforms

Detected platforms:

Error(s) prevent platform classification.

Suggestions

  • Fix lib/signers/rsa_signer.dart.

    Strong-mode analysis of lib/signers/rsa_signer.dart failed with the following error:

    line: 76 col: 3
    Invalid override. The type of 'RSASigner.verifySignature' ('(Uint8List, RSASignature) → bool') isn't a subtype of 'Signer.verifySignature' ('(Uint8List, Signature) → bool').

  • Fix lib/signers/ecdsa_signer.dart.

    Strong-mode analysis of lib/signers/ecdsa_signer.dart failed with the following error:

    line: 118 col: 3
    Invalid override. The type of 'ECDSASigner.verifySignature' ('(Uint8List, ECSignature) → bool') isn't a subtype of 'Signer.verifySignature' ('(Uint8List, Signature) → bool').

  • Fix further 15 Dart files.

    Similar analysis of the following files failed:

    • lib/block/aes_fast.dart
    • lib/stream/salsa20.dart
    • lib/paddings/padded_block_cipher.dart
    • lib/ecc/ecc_base.dart
    • lib/ecc/ecc_fp.dart
    • lib/macs/hmac.dart
    • lib/asymmetric/rsa.dart
    • lib/digests/sha3.dart
    • lib/key_derivators/pbkdf2.dart
    • lib/key_derivators/scrypt.dart
    • lib/modes/cbc.dart
    • lib/modes/sic.dart
    • lib/random/block_ctr_random.dart
    • lib/random/auto_seed_block_ctr_random.dart
    • lib/src/ufixnum.dart

Dependencies

Package Constraint Resolved Available
Direct dependencies
bignum >=0.0.5 <0.1.0 0.0.7 0.1.0
fixnum >=0.9.0 <0.10.0 0.9.1+2 0.10.6
Dev dependencies
benchmark_harness >=1.0.4 <2.0.0
browser >=0.9.0 <0.10.0
unittest >=0.9.0 <0.10.0