cipher 0.7.1

  • Installing
  • Versions
  • 31


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)


  • PKCS7


  • 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


  • HMAC


  • RSA

Password based key derivators:

  • PBKDF2
  • scrypt

Asymmetric key generators:

  • RSA

Entropy sources (true RNGs):

  • URL based (can be used, for example, with
  • 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.

Use this package as a library

1. Depend on it

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

  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...

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.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis 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

Maintenance issues and suggestions

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=0.8.10+6 <2.0.0