@@ -27,14 +27,14 @@ Any feedback, issue reports, or pull requests are appreciated!
2727# Getting started
2828
2929If you use Flutter, it's recommended (but not necessarily) that you also import our sibling package
30- [ cryptography_flutter] ( https://pub.dev/packages/cryptography_flutter ) , which improves performance
31- by using operating system APIs.
30+ [ cryptography_flutter] ( https://pub.dev/packages/cryptography_flutter ) , which delegates calls to
31+ Android / iOS / Mac OS X operating system APIs whenever possible .
3232
3333In _ pubspec.yaml_ :
3434``` yaml
3535dependencies :
36- cryptography : ^2.5.0
37- cryptography_flutter : ^2.3.0 # Remove if you don't use Flutter
36+ cryptography : ^2.5.1
37+ cryptography_flutter : ^2.3.1 # Remove if you don't use Flutter
3838` ` `
3939
4040You are ready to go!
@@ -207,7 +207,8 @@ faster because this package automatically uses Web Crypto API.
207207
208208## Random number generators
209209
210- We continue to use the old good ` Random.secure()` as the default random number in all APIs.
210+ We use Dart SDK [Random.secure()](https://api.dart.dev/stable/3.1.0/dart-math/Random/Random.secure.html)
211+ as the default random number in all APIs.
211212
212213If you do want much faster cryptographically reasonably strong random numbers, this package contains
213214[SecureRandom.fast](https://pub.dev/documentation/cryptography/latest/cryptography/SecureRandom/fast.html).
@@ -353,17 +354,14 @@ authentication code).
353354When you decrypt, you need the _SecretBox_ and the secret key.
354355
355356In the following example, we encrypt a message
356- with [AesCtr](https://pub.dev/documentation/cryptography/latest/cryptography/AesCtr-class.html)
357- and a [Hmac](https://pub.dev/documentation/cryptography/latest/cryptography/Hmac-class.html) message
358- authentication code that uses [Sha256](https://pub.dev/documentation/cryptography/latest/cryptography/Sha256-class.html)
359- hash algorithm :
357+ with [AesGcm](https://pub.dev/documentation/cryptography/latest/cryptography/AesGcm-class.html) :
360358` ` ` dart
361359import 'dart:convert';
362360import 'package:cryptography/cryptography.dart';
363361
364362Future<void> main() async {
365363 // Choose the cipher
366- final algorithm = AesCtr(macAlgorithm: Hmac.sha256() );
364+ final algorithm = AesGcm.with256bits( );
367365
368366 // Generate a random secret key.
369367 final secretKey = await algorithm.newSecretKey();
0 commit comments