diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..c0c5e88 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @petrleocompel diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f7a08cf --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Publish plugin + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Publish "cryptography" + uses: k-paxian/dart-package-publisher@v1.6 + with: + relativePath: cryptography + skipTests: true + accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }} + refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }} + - name: Publish "cryptography_flutter" + uses: k-paxian/dart-package-publisher@v1.6 + with: + flutter: true + skipTests: true + relativePath: cryptography_flutter + accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }} + refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }} + - name: Publish "jwk" + uses: k-paxian/dart-package-publisher@v1.6 + with: + flutter: true + skipTests: true + relativePath: jwk + accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }} + refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }} diff --git a/README.md b/README.md index ce8bf49..0ad2076 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,33 @@ -[![Pub Package](https://img.shields.io/pub/v/cryptography.svg)](https://pub.dev/packages/cryptography) -[![Github Actions CI](https://github.com/dint-dev/cryptography/workflows/Dart%20CI/badge.svg)](https://github.com/dint-dev/cryptography/actions?query=workflow%3A%22Dart+CI%22) +[![Pub Package](https://img.shields.io/pub/v/cryptography_plus.svg)](https://pub.dev/packages/cryptography_plus) +[![Github Actions CI](https://github.com/emz-hanauer/dart-cryptography/workflows/Dart%20CI/badge.svg)](https://github.com/emz-hanauer/dart-cryptography/actions?query=workflow%3A%22Dart+CI%22) # Overview Cryptographic packages for [Dart](https://dart.dev) / [Flutter](https://flutter.dev) developers. Open-sourced under the [Apache License 2.0](LICENSE). -Maintained by [gohilla.com](https://gohilla.com). Licensed under the [Apache License 2.0](LICENSE). +> Package was maintained by [gohilla.com](https://gohilla.com). Repository was moved to [emz-hanauer/dart-cryptography](https://github.com/emz-hanauer/dart-cryptography) due to lack of maintenance. ## Packages - * [cryptography](cryptography) - * Cryptography API for Dart / Flutter. - * Contains cryptographic algorithm implementations written in pure Dart. - * Contains cryptographic algorithm implementations that use Web Cryptography API in browsers. - * [cryptography_flutter](cryptography_flutter) - * Contains cryptographic algorithm implementations that use operating system APIs in Android - and Apple operating systems (iOS, Mac OS X, etc.). - * [cryptography_flutter_integration_test](cryptography_flutter_integration_test) - * Integration test project for "cryptography_flutter". - * [cryptography_test](cryptography_flutter) - * Cross-platform tests. Note that "cryptography" and "cryptography_flutter_integration_test" - contain more tests than just these. - * [jwk](jwk) - * JWK (JSON Web Key) encoding / decoding. + +- [cryptography_plus](cryptography) + - Cryptography API for Dart / Flutter. + - Contains cryptographic algorithm implementations written in pure Dart. + - Contains cryptographic algorithm implementations that use Web Cryptography API in browsers. +- [cryptography_flutter_plus](cryptography_flutter) + - Contains cryptographic algorithm implementations that use operating system APIs in Android + and Apple operating systems (iOS, Mac OS X, etc.). +- [cryptography_flutter_integration_test](cryptography_flutter_integration_test) + - Integration test project for "cryptography_flutter". +- [cryptography_test](cryptography_flutter) + - Cross-platform tests. Note that "cryptography" and "cryptography_flutter_integration_test" + contain more tests than just these. +- [jwk_plus](jwk) + - JWK (JSON Web Key) encoding / decoding. ## Contributing + Please share feedback / issue reports in the -[issue tracker](https://github.com/dint-dev/cryptography/issues). +[issue tracker](https://github.com/emz-hanauer/dart-cryptography/issues). -Pull requests are welcome. \ No newline at end of file +Pull requests are welcome. diff --git a/cryptography/CHANGELOG.md b/cryptography/CHANGELOG.md index cb0ed6e..9b0d271 100644 --- a/cryptography/CHANGELOG.md +++ b/cryptography/CHANGELOG.md @@ -1,292 +1,309 @@ +## 2.7.1 + +**Release of package under new name** + +- **fix**: add super.destroy() to SecretKeyData +- **fix**: remove Unnecessary casts +- **ci**: github release action +- **docs**: typo with X25519 Key Agreement example +- **chore**: pubspec - Add topic crypto +- **chore**: update js to 0.7.1 (was 0.6.7) + ## 2.7.0 -* Adds a cross-platform of Argon2id, a highly recommended algorithm for password hashing. -* Introduces a dependency on "package:ffi" (a package by Google). A memory allocator in the package + +- Adds a cross-platform of Argon2id, a highly recommended algorithm for password hashing. +- Introduces a dependency on "package:ffi" (a package by Google). A memory allocator in the package is used when the Argon2 implementation distributes computation to multiple isolates. -* Small backwards-compatible changes in Blake2b and DartBlake2b API. +- Small backwards-compatible changes in Blake2b and DartBlake2b API. ## 2.6.1 -* Fixes incorrect base class constraints. + +- Fixes incorrect base class constraints. ## 2.6.0 -* Improves Blake2b/Blake2s support: - * Adds support for using as a MAC algorithm - * Adds support for custom output lengths - * Improves test coverage - * Fixes bugs -* Removes long-deprecated `newSink()` methods in `HashAlgorithm` and `MacAlgorithm` (so Blake2 + +- Improves Blake2b/Blake2s support: + - Adds support for using as a MAC algorithm + - Adds support for custom output lengths + - Improves test coverage + - Fixes bugs +- Removes long-deprecated `newSink()` methods in `HashAlgorithm` and `MacAlgorithm` (so Blake2 classes can implement both interfaces). -* Raises Dart SDK minimum to 3.1.0 and other small changes related to dependency constraints. -* Improves documentation. +- Raises Dart SDK minimum to 3.1.0 and other small changes related to dependency constraints. +- Improves documentation. ## 2.5.0 -* Adds enough DER encoding/decoding support for us to use Apple's CryptoKit ECDH/ECDSA functions. -* Improves BrowserHmac/etc. parameter checks. -* Improves documentation. + +- Adds enough DER encoding/decoding support for us to use Apple's CryptoKit ECDH/ECDSA functions. +- Improves BrowserHmac/etc. parameter checks. +- Improves documentation. ## 2.4.0 -* Fixes many issues found by adding more tests. Also improves documentation. -* Improves performance of SHA256, HMAC, and PBKDF2 by cutting unnecessary state allocations and + +- Fixes many issues found by adding more tests. Also improves documentation. +- Improves performance of SHA256, HMAC, and PBKDF2 by cutting unnecessary state allocations and futures. -* Some small API refactoring and new class members that don't really affect the publicly visible +- Some small API refactoring and new class members that don't really affect the publicly visible API. We plan to address most API design issues (some discussed in the issue tracker) in the next major version (3.x). -* Adds support for seck256k1 key type ([#135](https://github.com/dint-dev/cryptography/pull/135)). +- Adds support for seck256k1 key type ([#135](https://github.com/dint-dev/cryptography/pull/135)). ## 2.3.0 - * Fixes some small issues. - * Improves documentation. + +- Fixes some small issues. +- Improves documentation. ## 2.2.0 -* The main changes in the the APIs: - * Adds new elements and parameters in various classes, especially Dart implementations. This can +- The main changes in the the APIs: + - Adds new elements and parameters in various classes, especially Dart implementations. This can be a breaking change if you extend those classes. - * Adds _PaddingAlgorithm_ class and support for padding in AES-CBC. - * Adds _CipherState_ class for processing long / infinite inputs. - * Adds _CipherWand_, _KeyExchangeWand_, and _SignatureWand_ classes. - * Adds random number generator parameters to class constructors. You can now have deterministic + - Adds _PaddingAlgorithm_ class and support for padding in AES-CBC. + - Adds _CipherState_ class for processing long / infinite inputs. + - Adds _CipherWand_, _KeyExchangeWand_, and _SignatureWand_ classes. + - Adds random number generator parameters to class constructors. You can now have deterministic behavior in tests. For example, you can construct `BrowserCryptography(random: myRandom)`. - * Adds an alternative random number generator, which is about 100 times faster than Random.secure. + - Adds an alternative random number generator, which is about 100 times faster than Random.secure. Random.secure continues to be the default everywhere. - * Adds support for overwriting secrets in memory (_SecretKeyData_, _KeyPairData_) and eliminates + - Adds support for overwriting secrets in memory (_SecretKeyData_, _KeyPairData_) and eliminates unnecessary wrapping of bytes in unmodifiable lists. - * Adds output buffer parameter for avoiding copying. -* The main changes in the Dart implementations: - * Improves some ciphers such as _Chacha20_ and _AesCtr_ so that large inputs don't block the main + - Adds output buffer parameter for avoiding copying. +- The main changes in the Dart implementations: + - Improves some ciphers such as _Chacha20_ and _AesCtr_ so that large inputs don't block the main thread. Instead, data will processed in chunks by default and other things can be scheduled in-between two chunks. - * Significantly improves performance of Chacha20.poly1305. -* The main changes in the Web Cryptography implementations: - * Fixes many bugs. - * Adds support for fallbacks when browsers don't allow Web Cryptography (non-secure browser + - Significantly improves performance of Chacha20.poly1305. +- The main changes in the Web Cryptography implementations: + - Fixes many bugs. + - Adds support for fallbacks when browsers don't allow Web Cryptography (non-secure browser contexts). -* Improves documentation. +- Improves documentation. ## 2.1.1 -* Fixes small issues. -* Improves documentation. +- Fixes small issues. +- Improves documentation. ## 2.1.0 -* Improves performance of Blake2b/Blake2s. -* Add _SecretBoxPaddingError_ that is thrown when the padding of a secret box is invalid. -* Adds some additional constructors such as `DartAesGcm.with128bits`. -* Fixes various small issues. -* Improves documentation. +- Improves performance of Blake2b/Blake2s. +- Add _SecretBoxPaddingError_ that is thrown when the padding of a secret box is invalid. +- Adds some additional constructors such as `DartAesGcm.with128bits`. +- Fixes various small issues. +- Improves documentation. ## 2.0.5 -* Fixes bugs in `Xchacha20.poly1305`. +- Fixes bugs in `Xchacha20.poly1305`. ## 2.0.4 -* Fixes an import of 'dart:io' that caused issues. +- Fixes an import of 'dart:io' that caused issues. ## 2.0.3 -* Updates dependency constraints and linting rules. +- Updates dependency constraints and linting rules. ## 2.0.2 -* Fixes an issue in SecretBox.fromConcatenation. -* Improves documentation. +- Fixes an issue in SecretBox.fromConcatenation. +- Improves documentation. ## 2.0.1 -* Documentation fixes. +- Documentation fixes. ## 2.0.0 -* Finishes null safety migration. +- Finishes null safety migration. ## 2.0.0-nullsafety.2 -* For ease of use and backwards compatibility with 1.x, adds `SecretKey(bytes)` factory that +- For ease of use and backwards compatibility with 1.x, adds `SecretKey(bytes)` factory that just redirects to `SecretKeyData(bytes)`. -* Renames a few identifiers in _package:cryptography_ for consistency. +- Renames a few identifiers in _package:cryptography_ for consistency. Adds deprecation warnings to the old identifiers. -* Some small internal fixes. -* Improves documentation. +- Some small internal fixes. +- Improves documentation. ## 2.0.0-nullsafety.1 -* Re-introduces _package:crypto_ as dependency now that a null-safe version exists. -* Better documentation. +- Re-introduces _package:crypto_ as dependency now that a null-safe version exists. +- Better documentation. ## 2.0.0-nullsafety.0 -* BREAKING CHANGES: Many breaking API changes that make the API easier to understand and use. -* IMPORTANT FIXES: Improves tests and fixes a number of bugs we spotted. We don't plan to support +- BREAKING CHANGES: Many breaking API changes that make the API easier to understand and use. +- IMPORTANT FIXES: Improves tests and fixes a number of bugs we spotted. We don't plan to support the 1.x API. We highly recommend you migrate to the 2.x API. -* The first null-safe version. +- The first null-safe version. ## 1.4.1 -* Improves Web Cryptography support internally. - * The implementation is now easier to read. - * In older browsers, the implementation fall back to pure Dart implementation if attempt to - use Web Cryptography fails. - * HMAC and HKDF are now able to use Web Cryptography. -* Improves documentation. +- Improves Web Cryptography support internally. + - The implementation is now easier to read. + - In older browsers, the implementation fall back to pure Dart implementation if attempt to + use Web Cryptography fails. + - HMAC and HKDF are now able to use Web Cryptography. +- Improves documentation. ## 1.4.0 -* Adds support for _cryptography_flutter_, which uses operating system implementations. +- Adds support for _cryptography_flutter_, which uses operating system implementations. ## 1.3.0 -* Adds PBKDF2 and Blake2b. -* Some internal refactoring. +- Adds PBKDF2 and Blake2b. +- Some internal refactoring. ## 1.2.1 -* Fixes documentation issues. +- Fixes documentation issues. ## 1.2.0 -* Adds `RsaPss` and `RsaPkcs1v15` (Web Cryptography only). -* BREAKING CHANGE: Recently added `JwkSecretKey` is now `EcJwkSecretKey`. -* Adds `EcJwkSecretKey` and `EcJwkPublicKey`. -* Adds `RsaJwkSecretKey` and `RsaJwkPublicKey`. +- Adds `RsaPss` and `RsaPkcs1v15` (Web Cryptography only). +- BREAKING CHANGE: Recently added `JwkSecretKey` is now `EcJwkSecretKey`. +- Adds `EcJwkSecretKey` and `EcJwkPublicKey`. +- Adds `RsaJwkSecretKey` and `RsaJwkPublicKey`. ## 1.1.1 -* Small fixes to documentation and internal declarations. +- Small fixes to documentation and internal declarations. ## 1.1.0 -* BREAKING CHANGE: Cipher methods `encrypt` / `encryptSync` and `decrypt` / `decryptSync` now use +- BREAKING CHANGE: Cipher methods `encrypt` / `encryptSync` and `decrypt` / `decryptSync` now use return type `Future` / `Uint8List` instead of previous `Future>` / `List`. We return instances of `Uint8List` anyway and we felt it's good to expose this fact despite despite possibility that the change affects some developers. If you are affected by this, you should see compile-time type warnings. -* `Cipher` has new getters `nonceLengthMin` and `nonceLengthMax`. -* AES-GCM is supported in the VM too. -* AES performance is improved significantly. -* Adds `JwkSecretKey`. -* BREAKING CHANGE: JwkSecretKey (instead of previous unspecified format) becomes the private key +- `Cipher` has new getters `nonceLengthMin` and `nonceLengthMax`. +- AES-GCM is supported in the VM too. +- AES performance is improved significantly. +- Adds `JwkSecretKey`. +- BREAKING CHANGE: JwkSecretKey (instead of previous unspecified format) becomes the private key storage format for P-256/P-384/P-521. Any attempt to use the previous unspecified format will lead to errors. It's unlikely that anyone is affected by this change so we don't bump the major version. -* `SecretKey` and `SecretKey` now have property `Map cachedValues`, which can +- `SecretKey` and `SecretKey` now have property `Map cachedValues`, which can be used for caching objects needed for cryptographic operations (such as handles to Web Cryptography API objects). -* Hides utils from developers. -* Internal refactoring. -* Better documentation. +- Hides utils from developers. +- Internal refactoring. +- Better documentation. ## 1.0.4 -* Internal refactoring. Splits a number of large source files (such as Web Cryptography support) +- Internal refactoring. Splits a number of large source files (such as Web Cryptography support) into more readable smaller files. -* Adds VM implementation stubs for algorithms that are only supported in the browser (e.g. +- Adds VM implementation stubs for algorithms that are only supported in the browser (e.g. ecdhP256). The methods throw UnimplementedError in VM. -* Improves Poly1305 performance. -* Adds a few more tests. -* Improves documentation. +- Improves Poly1305 performance. +- Adds a few more tests. +- Improves documentation. ## 1.0.3 -* Improves documentation. +- Improves documentation. ## 1.0.2 -* Implements automatic use of Web Cryptography API when SHA1 or SHA2 is used in browsers. +- Implements automatic use of Web Cryptography API when SHA1 or SHA2 is used in browsers. SHA2-512 becomes up to 100 times faster in browsers. ED25519 becomes approximately 30 times faster in browsers with the improved SHA512. -* Better documentation and benchmarks. +- Better documentation and benchmarks. ## 1.0.1 -* Implements `ed25519.newKeyFromSeed(seed)`. -* Significantly improves ED25519 performance. -* Small fixes in documentation. +- Implements `ed25519.newKeyFromSeed(seed)`. +- Significantly improves ED25519 performance. +- Small fixes in documentation. ## 1.0.0 -* A stable API. +- A stable API. ## 0.3.6 -* Documentation fixes. +- Documentation fixes. ## 0.3.5 -* Adds _Xchacha20_ cipher. -* When authenticated ciphers encounter incorrect MACs, they now throw `MacValidationException` +- Adds _Xchacha20_ cipher. +- When authenticated ciphers encounter incorrect MACs, they now throw `MacValidationException` (instead of returning null, which developers may ignore in some situations). ## 0.3.4 -* Fixes a `cipher.name` issue and improves documentation. +- Fixes a `cipher.name` issue and improves documentation. ## 0.3.3 -* Improves documentation. -* Improves outputs of `cipher.name`. +- Improves documentation. +- Improves outputs of `cipher.name`. ## 0.3.2 -* Improves documentation. +- Improves documentation. ## 0.3.1 -* Improves documentation. -* Eliminates AES-CBC and AES-CTR dependencies. +- Improves documentation. +- Eliminates AES-CBC and AES-CTR dependencies. ## 0.3.0 -* Breaking changes: Removes separate key generator classes. Many API changes designed to reduce +- Breaking changes: Removes separate key generator classes. Many API changes designed to reduce chances of developers using the API incorrectly. -* Adds HKDF and ED25519 support. -* Adds more assertions and tests. -* Improves documentation. +- Adds HKDF and ED25519 support. +- Adds more assertions and tests. +- Improves documentation. ## 0.2.6 -* Fixed an issue with dependency constraints that conflict with Flutter SDK. -* SecretKey / SecretKey property `bytes` is deprecated and replaced with `extract()` and +- Fixed an issue with dependency constraints that conflict with Flutter SDK. +- SecretKey / SecretKey property `bytes` is deprecated and replaced with `extract()` and `extractSync()` to better support implementations that protect the underlying bytes such as Web Cryptography API. -* Improves documentation. +- Improves documentation. ## 0.2.5 -* Adds AES for non-browser platforms. -* Fixes various bugs and improves test coverage. +- Adds AES for non-browser platforms. +- Fixes various bugs and improves test coverage. ## 0.2.4 -* Improves documentation. +- Improves documentation. ## 0.2.3 -* Improves documentation, clarity, test coverage. +- Improves documentation, clarity, test coverage. ## 0.2.2 -* Improves documentation. -* Deprecates ConstantTimeBytesEquality in favor of constantTimeBytesEquality. +- Improves documentation. +- Deprecates ConstantTimeBytesEquality in favor of constantTimeBytesEquality. ## 0.2.1 -* Improves documentation and stops exporting a few declarations. +- Improves documentation and stops exporting a few declarations. ## 0.2.0 -* Major refactoring and breaking API changes. -* Improves in documentation. -* Adds AES, P256/P384/P521, SHA1, Poly1305, and AEAD_Chacha20_Poly1305. +- Major refactoring and breaking API changes. +- Improves in documentation. +- Adds AES, P256/P384/P521, SHA1, Poly1305, and AEAD_Chacha20_Poly1305. ## 0.1.2 -* Improved documentation +- Improved documentation ## 0.1.1 -* Fixed example +- Fixed example ## 0.1.0 -* Initial version \ No newline at end of file +- Initial version diff --git a/cryptography/README.md b/cryptography/README.md index 49da1e5..4cc8734 100644 --- a/cryptography/README.md +++ b/cryptography/README.md @@ -1,82 +1,88 @@ -[![Pub Package](https://img.shields.io/pub/v/cryptography.svg)](https://pub.dev/packages/cryptography) -[![Github Actions CI](https://github.com/dint-dev/cryptography/workflows/Dart%20CI/badge.svg)](https://github.com/dint-dev/cryptography/actions) +[![Pub Package](https://img.shields.io/pub/v/cryptography_plus.svg)](https://pub.dev/packages/cryptography_plus) +[![Github Actions CI](https://github.com/emz-hanauer/dart-cryptography/workflows/Dart%20CI/badge.svg)](https://github.com/emz-hanauer/dart-cryptography/actions) # Overview Popular cryptographic algorithms for [Dart](https://dart.dev) / [Flutter](https://flutter.dev) developers. -Maintained by [gohilla.com](https://gohilla.com). Licensed under the [Apache License 2.0](LICENSE). +> Package was maintained by [gohilla.com](https://gohilla.com). Repository was moved to [emz-hanauer/dart-cryptography](https://github.com/emz-hanauer/dart-cryptography) due to lack of maintenance. + +Licensed under the [Apache License 2.0](LICENSE). This package is designed to be: -* __Easy to use__. The API is easy to understand and encourages good defaults. -* __Multi-platform__. It's easy to customize implementation of X in platform Y. -* __Fast.__ We use platform APIs when available. For example, SHA-512 is over 100 times faster than +- **Easy to use**. The API is easy to understand and encourages good defaults. +- **Multi-platform**. It's easy to customize implementation of X in platform Y. +- **Fast.** We use platform APIs when available. For example, SHA-512 is over 100 times faster than _package:crypto_ in browsers. Any feedback, issue reports, or pull requests are appreciated! ## Links -* [Github project](https://github.com/dint-dev/cryptography) -* [Issue tracker](https://github.com/dint-dev/cryptography/issues) -* [Pub package](https://pub.dev/packages/cryptography) -* [API reference](https://pub.dev/documentation/cryptography/latest/) +- [Github project](https://github.com/emz-hanauer/dart-cryptography) +- [Issue tracker](https://github.com/emz-hanauer/dart-cryptography/issues) +- [Pub package](https://pub.dev/packages/cryptography_plus) +- [API reference](https://pub.dev/documentation/cryptography_plus/latest/) # Getting started If you use Flutter, it's recommended (but not necessarily) that you also import our sibling package -[cryptography_flutter](https://pub.dev/packages/cryptography_flutter), which delegates calls to +[cryptography_flutter_plus](https://pub.dev/packages/cryptography_flutter_plus), which delegates calls to Android / iOS / Mac OS X operating system APIs whenever possible. In _pubspec.yaml_: + ```yaml dependencies: - cryptography: ^2.7.0 - cryptography_flutter: ^2.3.2 # Remove if you don't use Flutter + cryptography_plus: ^2.7.0 + cryptography_flutter_plus: ^2.3.2 # Remove if you don't use Flutter ``` You are ready to go! # Issues and discussions -Please report bugs at [github.com/dint-dev/cryptography/issues](https://github.com/dint-dev/cryptography/issues). +Please report bugs at [github.com/emz-hanauer/dart-cryptography/issues](https://github.com/emz-hanauer/dart-cryptography/issues). Having questions? Feel free to use our Github Discussions at -[github.com/dint-dev/cryptography/discussions](https://github.com/dint-dev/cryptography/discussions). - +[github.com/emz-hanauer/dart-cryptography/discussions](https://github.com/emz-hanauer/dart-cryptography/discussions). # Some things to know + ## General guidance on cryptography + Please read [information about Mobile App Cryptography](https://mas.owasp.org/MASTG/General/0x04g-Testing-Cryptography/) by OWASP. It contains a lot of useful information that helps you build more secure software. ## Common parameters -* [SecretKey](https://pub.dev/documentation/cryptography/latest/cryptography/SecretKey-class.html) - * Used by ciphers, message authentication codes, and key derivation functions. -* [KeyPair](https://pub.dev/documentation/cryptography/latest/cryptography/KeyPair-class.html) - * [SimpleKeyPair](https://pub.dev/documentation/cryptography/latest/cryptography/SimpleKeyPair-class.html) - (Octet sequences such as Ed25519 / X25519 32-byte private keys) - * [EcKeyPairData](https://pub.dev/documentation/cryptography/latest/cryptography/EcKeyPair-class.html) - (P-256, P-384, P-521 private keys) - * [RsaKeyPairData](https://pub.dev/documentation/cryptography/latest/cryptography/RsaKeyPair-class.html) - (RSA private keys) -* [PublicKey](https://pub.dev/documentation/cryptography/latest/cryptography/PublicKey-class.html) - * [SimplePublicKey](https://pub.dev/documentation/cryptography/latest/cryptography/SimplePublicKey-class.html) - (Octet sequences such as Ed25519 / X25519 32-byte public keys) - * [EcPublicKey](https://pub.dev/documentation/cryptography/latest/cryptography/EcPublicKey-class.html) - (P-256 / P-384 / P-512 public keys) - * [RsaPublicKey](https://pub.dev/documentation/cryptography/latest/cryptography/RsaPublicKey-class.html) - (RSA public keys) + +- [SecretKey](https://pub.dev/documentation/cryptography_plus/latest/cryptography/SecretKey-class.html) + - Used by ciphers, message authentication codes, and key derivation functions. +- [KeyPair](https://pub.dev/documentation/cryptography_plus/latest/cryptography/KeyPair-class.html) + - [SimpleKeyPair](https://pub.dev/documentation/cryptography_plus/latest/cryptography/SimpleKeyPair-class.html) + (Octet sequences such as Ed25519 / X25519 32-byte private keys) + - [EcKeyPairData](https://pub.dev/documentation/cryptography_plus/latest/cryptography/EcKeyPair-class.html) + (P-256, P-384, P-521 private keys) + - [RsaKeyPairData](https://pub.dev/documentation/cryptography_plus/latest/cryptography/RsaKeyPair-class.html) + (RSA private keys) +- [PublicKey](https://pub.dev/documentation/cryptography_plus/latest/cryptography/PublicKey-class.html) + - [SimplePublicKey](https://pub.dev/documentation/cryptography_plus/latest/cryptography/SimplePublicKey-class.html) + (Octet sequences such as Ed25519 / X25519 32-byte public keys) + - [EcPublicKey](https://pub.dev/documentation/cryptography_plus/latest/cryptography/EcPublicKey-class.html) + (P-256 / P-384 / P-512 public keys) + - [RsaPublicKey](https://pub.dev/documentation/cryptography_plus/latest/cryptography/RsaPublicKey-class.html) + (RSA public keys) Note that SecretKey and KeyPair instances are opaque and asynchronous by default. They may not be in the memory and may not be readable at all. If a SecretKey or KeyPair instance is in memory, it's an instance of one of the following: -* [SecretKeyData](https://pub.dev/documentation/cryptography/latest/cryptography/SecretKeyData-class.html) -* [SimpleKeyPairData](https://pub.dev/documentation/cryptography/latest/cryptography/SimpleKeyPairData-class.html) -* [EcKeyPairData](https://pub.dev/documentation/cryptography/latest/cryptography/EcKeyPairData-class.html) -* [RsaKeyPairData](https://pub.dev/documentation/cryptography/latest/cryptography/RsaKeyPairData-class.html) + +- [SecretKeyData](https://pub.dev/documentation/cryptography_plus/latest/cryptography/SecretKeyData-class.html) +- [SimpleKeyPairData](https://pub.dev/documentation/cryptography_plus/latest/cryptography/SimpleKeyPairData-class.html) +- [EcKeyPairData](https://pub.dev/documentation/cryptography_plus/latest/cryptography/EcKeyPairData-class.html) +- [RsaKeyPairData](https://pub.dev/documentation/cryptography_plus/latest/cryptography/RsaKeyPairData-class.html) For encoding/decoding private/public keys in JWK (JSON Web Key) format, use [package:jwk](https://pub.dev/packages/jwk). @@ -86,120 +92,121 @@ at the moment. ## Wands (recommended) For a bit higher API abstraction and sometimes a performance boost, we encourage developers to use -[Wand](https://pub.dev/documentation/cryptography/latest/cryptography/Wand-class.html) +[Wand](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Wand-class.html) instances which do operations with fixed, "invisible" key (thus "magic wands"). There are currently three types of wands: -* [CipherWand](https://pub.dev/documentation/cryptography/latest/cryptography/CipherWand-class.html) -* [KeyExchangeWand](https://pub.dev/documentation/cryptography/latest/cryptography/KeyExchangeWand-class.html) -* [SignatureWand](https://pub.dev/documentation/cryptography/latest/cryptography/SignatureWand-class.html) + +- [CipherWand](https://pub.dev/documentation/cryptography_plus/latest/cryptography/CipherWand-class.html) +- [KeyExchangeWand](https://pub.dev/documentation/cryptography_plus/latest/cryptography/KeyExchangeWand-class.html) +- [SignatureWand](https://pub.dev/documentation/cryptography_plus/latest/cryptography/SignatureWand-class.html) In the future version 3.x, we plan to transition to wands as the default API for doing operations. ## Ciphers -The following [Cipher](https://pub.dev/documentation/cryptography/latest/cryptography/Cipher-class.html) +The following [Cipher](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Cipher-class.html) implementations are available: -* AES - * [AesCbc](https://pub.dev/documentation/cryptography/latest/cryptography/AesCbc-class.html) ( - AES-CBC) - * The throughput is up to 120 MB / second (Macbook Pro, message size 1 MB). - * [AesCtr](https://pub.dev/documentation/cryptography/latest/cryptography/AesCtr-class.html) ( - AES-CTR) - * The throughput is up to 80 MB / second (Macbook Pro, message size 1 MB). - * [AesGcm](https://pub.dev/documentation/cryptography/latest/cryptography/AesGcm-class.html) ( - AES-GCM) - * The throughput is up to 20 MB / second (Macbook Pro, message size 1 MB). - * In browsers, the package uses Web Cryptography, reaching over 500 MB/s. -* ChaCha20 / XChaCha20 - * [Chacha20](https://pub.dev/documentation/cryptography/latest/cryptography/Chacha20-class.html) - * The throughput is up to 230 MB / second (Macbook Pro, message size 1 MB). - * [Chacha20.poly1305Aead](https://pub.dev/documentation/cryptography/latest/cryptography/Chacha20/Chacha20.poly1305Aead.html) ( - AEAD_CHACHA20_POLY1305) - * The throughput is up to 30 MB / second (Macbook Pro, message size 1 MB). - * [Xchacha20](https://pub.dev/documentation/cryptography/latest/cryptography/Xchacha20-class.html) - * [Xchacha20.poly1305Aead](https://pub.dev/documentation/cryptography/latest/cryptography/Xchacha20/Xchacha20.poly1305Aead.html) ( - AEAD_XCHACHA20_POLY1305) +- AES + - [AesCbc](https://pub.dev/documentation/cryptography_plus/latest/cryptography/AesCbc-class.html) ( + AES-CBC) + - The throughput is up to 120 MB / second (Macbook Pro, message size 1 MB). + - [AesCtr](https://pub.dev/documentation/cryptography_plus/latest/cryptography/AesCtr-class.html) ( + AES-CTR) + - The throughput is up to 80 MB / second (Macbook Pro, message size 1 MB). + - [AesGcm](https://pub.dev/documentation/cryptography_plus/latest/cryptography/AesGcm-class.html) ( + AES-GCM) + - The throughput is up to 20 MB / second (Macbook Pro, message size 1 MB). + - In browsers, the package uses Web Cryptography, reaching over 500 MB/s. +- ChaCha20 / XChaCha20 + - [Chacha20](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Chacha20-class.html) + - The throughput is up to 230 MB / second (Macbook Pro, message size 1 MB). + - [Chacha20.poly1305Aead](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Chacha20/Chacha20.poly1305Aead.html) ( + AEAD_CHACHA20_POLY1305) + - The throughput is up to 30 MB / second (Macbook Pro, message size 1 MB). + - [Xchacha20](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Xchacha20-class.html) + - [Xchacha20.poly1305Aead](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Xchacha20/Xchacha20.poly1305Aead.html) ( + AEAD_XCHACHA20_POLY1305) ## Digital signature algorithms The -following [SignatureAlgorithm](https://pub.dev/documentation/cryptography/latest/cryptography/SignatureAlgorithm-class.html) +following [SignatureAlgorithm](https://pub.dev/documentation/cryptography_plus/latest/cryptography/SignatureAlgorithm-class.html) implementations are available: -* [Ed25519](https://pub.dev/documentation/cryptography/latest/cryptography/Ed25519-class.html) ( +- [Ed25519](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Ed25519-class.html) ( curve25519 EdDSA) - * Performance of the pure Dart implementation is around 200 (signatures or verifications) per - second in VM and about 50 in browsers. -* Elliptic curves approved by NIST - * [Ecdsa.p256](https://pub.dev/documentation/cryptography/latest/cryptography/Ecdsa/Ecdsa.p256.html) ( - ECDSA P256 / secp256r1 / prime256v1 + SHA256) - * [Ecdsa.p384](https://pub.dev/documentation/cryptography/latest/cryptography/Ecdsa/Ecdsa.p384.html) ( - ECDSA P384 / secp384r1 / prime384v1 + SHA384) - * [Ecdsa.p521](https://pub.dev/documentation/cryptography/latest/cryptography/Ecdsa/Ecdsa.p521.html) ( - ECDSA P521 / secp521r1 / prime521v1 + SHA256) - * We don't have implementations of these in pure Dart. -* RSA - * [RsaPss](https://pub.dev/documentation/cryptography/latest/cryptography/RsaPss-class.html) ( - RSA-PSS) - * [RsaSsaPkcs1v15](https://pub.dev/documentation/cryptography/latest/cryptography/RsaSsaPkcs1v15-class.html) ( - RSASSA-PKCS1v15) - * We don't have implementations of these in pure Dart. + - Performance of the pure Dart implementation is around 200 (signatures or verifications) per + second in VM and about 50 in browsers. +- Elliptic curves approved by NIST + - [Ecdsa.p256](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Ecdsa/Ecdsa.p256.html) ( + ECDSA P256 / secp256r1 / prime256v1 + SHA256) + - [Ecdsa.p384](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Ecdsa/Ecdsa.p384.html) ( + ECDSA P384 / secp384r1 / prime384v1 + SHA384) + - [Ecdsa.p521](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Ecdsa/Ecdsa.p521.html) ( + ECDSA P521 / secp521r1 / prime521v1 + SHA256) + - We don't have implementations of these in pure Dart. +- RSA + - [RsaPss](https://pub.dev/documentation/cryptography_plus/latest/cryptography/RsaPss-class.html) ( + RSA-PSS) + - [RsaSsaPkcs1v15](https://pub.dev/documentation/cryptography_plus/latest/cryptography/RsaSsaPkcs1v15-class.html) ( + RSASSA-PKCS1v15) + - We don't have implementations of these in pure Dart. ## Key exchange algorithms -The following [KeyExchangeAlgorithm](https://pub.dev/documentation/cryptography/latest/cryptography/KeyExchangeAlgorithm-class.html) +The following [KeyExchangeAlgorithm](https://pub.dev/documentation/cryptography_plus/latest/cryptography/KeyExchangeAlgorithm-class.html) implementations are available: -* Elliptic curves approved by NIST - * [Ecdh.p256](https://pub.dev/documentation/cryptography/latest/cryptography/Ecdh/Ecdh.p256.html) ( - ECDH P256 / secp256r1 / prime256v1) - * [Ecdh.p384](https://pub.dev/documentation/cryptography/latest/cryptography/Ecdh/Ecdh.p384.html) ( - ECDH P384 / secp384r1 / prime384v1) - * [Ecdh.p521](https://pub.dev/documentation/cryptography/latest/cryptography/Ecdh/Ecdh.p521.html) ( - ECDH P521 / secp521r1 / prime521v1) - * We don't have implementations of these in pure Dart. -* [X25519](https://pub.dev/documentation/cryptography/latest/cryptography/X25519-class.html) ( +- Elliptic curves approved by NIST + - [Ecdh.p256](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Ecdh/Ecdh.p256.html) ( + ECDH P256 / secp256r1 / prime256v1) + - [Ecdh.p384](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Ecdh/Ecdh.p384.html) ( + ECDH P384 / secp384r1 / prime384v1) + - [Ecdh.p521](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Ecdh/Ecdh.p521.html) ( + ECDH P521 / secp521r1 / prime521v1) + - We don't have implementations of these in pure Dart. +- [X25519](https://pub.dev/documentation/cryptography_plus/latest/cryptography/X25519-class.html) ( curve25519 Diffie-Hellman) - * Throughput of the pure Dart implementation is around 1000 key agreements per second (in VM). + - Throughput of the pure Dart implementation is around 1000 key agreements per second (in VM). ### Key derivation / password hashing algorithms -The following [KdfAlgorithm](https://pub.dev/documentation/cryptography/latest/cryptography/KdfAlgorithm-class.html) implementations are available: +The following [KdfAlgorithm](https://pub.dev/documentation/cryptography_plus/latest/cryptography/KdfAlgorithm-class.html) implementations are available: -* [Hchacha20](https://pub.dev/documentation/cryptography/latest/cryptography/Hchacha20-class.html) -* [Hkdf](https://pub.dev/documentation/cryptography/latest/cryptography/Hkdf-class.html) -* [Pbkdf2](https://pub.dev/documentation/cryptography/latest/cryptography/Pbkdf2-class.html) -* [Argon2id](https://pub.dev/documentation/cryptography/latest/cryptography/Argon2id-class.html) - * Argon2id is the recommended algorithm for password hashing. +- [Hchacha20](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Hchacha20-class.html) +- [Hkdf](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Hkdf-class.html) +- [Pbkdf2](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Pbkdf2-class.html) +- [Argon2id](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Argon2id-class.html) + - Argon2id is the recommended algorithm for password hashing. ## Message authentication codes -The following [MacAlgorithm](https://pub.dev/documentation/cryptography/latest/cryptography/MacAlgorithm-class.html) +The following [MacAlgorithm](https://pub.dev/documentation/cryptography_plus/latest/cryptography/MacAlgorithm-class.html) implementations are available: -* [Blake2b](https://pub.dev/documentation/cryptography/latest/cryptography/Blake2b-class.html) -* [Blake2s](https://pub.dev/documentation/cryptography/latest/cryptography/Blake2s-class.html) -* [Hmac](https://pub.dev/documentation/cryptography/latest/cryptography/Hmac-class.html) -* [Poly1305](https://pub.dev/documentation/cryptography/latest/cryptography/Poly1305-class.html) +- [Blake2b](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Blake2b-class.html) +- [Blake2s](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Blake2s-class.html) +- [Hmac](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Hmac-class.html) +- [Poly1305](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Poly1305-class.html) ## Cryptographic hash functions -The following [HashAlgorithm](https://pub.dev/documentation/cryptography/latest/cryptography/HashAlgorithm-class.html) +The following [HashAlgorithm](https://pub.dev/documentation/cryptography_plus/latest/cryptography/HashAlgorithm-class.html) implementations are available: -* [Blake2b](https://pub.dev/documentation/cryptography/latest/cryptography/Blake2b-class.html) +- [Blake2b](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Blake2b-class.html) (BLAKE2B) -* [Blake2s](https://pub.dev/documentation/cryptography/latest/cryptography/Blake2s-class.html) +- [Blake2s](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Blake2s-class.html) (BLAKE2S) -* [Sha1](https://pub.dev/documentation/cryptography/latest/cryptography/Sha1-class.html) (SHA1) -* [Sha224](https://pub.dev/documentation/cryptography/latest/cryptography/Sha224-class.html) +- [Sha1](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Sha1-class.html) (SHA1) +- [Sha224](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Sha224-class.html) (SHA2-224) -* [Sha256](https://pub.dev/documentation/cryptography/latest/cryptography/Sha256-class.html) +- [Sha256](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Sha256-class.html) (SHA2-256) -* [Sha384](https://pub.dev/documentation/cryptography/latest/cryptography/Sha384-class.html) +- [Sha384](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Sha384-class.html) (SHA2-384) -* [Sha512](https://pub.dev/documentation/cryptography/latest/cryptography/Sha512-class.html) +- [Sha512](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Sha512-class.html) (SHA2-512) The performance is excellent! Our pure Dart implementation of Sha256 is around 2 times faster than @@ -214,61 +221,63 @@ We use Dart SDK [Random.secure()](https://api.dart.dev/stable/3.1.0/dart-math/Ra as the default random number in all APIs. If you do want much faster cryptographically reasonably strong random numbers, this package contains -[SecureRandom.fast](https://pub.dev/documentation/cryptography/latest/cryptography/SecureRandom/fast.html). +[SecureRandom.fast](https://pub.dev/documentation/cryptography_plus/latest/cryptography/SecureRandom/fast.html). It generates random numbers by using 12 round version ChaCha cipher. It can generate up to 0.25 GB random data per second because it makes expensive operating system call less frequently after the initial seeding from the operating system. While ChaCha is not designed to be a cryptographic random number generator, it can be acceptable and a related (Blake2-based) RNG is used by Linux kernel. If you need a deterministic random number generator for tests, the package contains -[SecureRandom.forTesting](https://pub.dev/documentation/cryptography/latest/cryptography/SecureRandom/SecureRandom.forTesting.html), +[SecureRandom.forTesting](https://pub.dev/documentation/cryptography_plus/latest/cryptography/SecureRandom/SecureRandom.forTesting.html), which uses the aforementioned ChaCha-based RNG with a fixed seed and no re-seeding. ## Cryptographic factory class -The class [Cryptography](https://pub.dev/documentation/cryptography/latest/cryptography/Cryptography-class.html) +The class [Cryptography](https://pub.dev/documentation/cryptography_plus/latest/cryptography_plus/cryptography_plus-class.html) has factory methods that return implementations of cryptographic algorithms. The default implementation is _BrowserCryptography_ (which works in all platforms, not just browser). We wrote the following three implementations of `Cryptography`: -* [DartCryptography](https://pub.dev/documentation/cryptography/latest/cryptography.dart/DartCryptography-class.html) - * Gives you implementations written in pure Dart implementations. They work in all platforms. - * The algorithms are written and tested by us. They are are licensed under the Apache 2.0 License. - * See the [class documentation](https://pub.dev/documentation/cryptography/latest/cryptography.dart/DartCryptography-class.html) - for list algorithms supported by it. -* [BrowserCryptography](https://pub.dev/documentation/cryptography/latest/cryptography/BrowserCryptography-class.html) - * Uses [Web Cryptography API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) - (_crypto.subtle_) whenever possible. Methods return pure Dart implementations when Web - Cryptography API is not available. - * See the [class documentation](https://pub.dev/documentation/cryptography/latest/cryptography/BrowserCryptography-class.html) - for list algorithms supported by it. -* [FlutterCryptography](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/FlutterCryptography-class.html) - * Makes cryptographic algorithms up to 100 times faster in Android, iOS, and Mac OS X. - * Available in the package [cryptography_flutter](https://pub.dev/packages/cryptography_flutter). - * See the [class documentation](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/FlutterCryptography-class.html) - for list algorithms supported by it. +- [DartCryptography](https://pub.dev/documentation/cryptography_plus/latest/cryptography_plus.dart/DartCryptography-class.html) + - Gives you implementations written in pure Dart implementations. They work in all platforms. + - The algorithms are written and tested by us. They are are licensed under the Apache 2.0 License. + - See the [class documentation](https://pub.dev/documentation/cryptography_plus/latest/cryptography_plus.dart/DartCryptography-class.html) + for list algorithms supported by it. +- [BrowserCryptography](https://pub.dev/documentation/cryptography_plus/latest/cryptography/BrowserCryptography-class.html) + - Uses [Web Cryptography API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) + (_crypto.subtle_) whenever possible. Methods return pure Dart implementations when Web + Cryptography API is not available. + - See the [class documentation](https://pub.dev/documentation/cryptography_plus/latest/cryptography/BrowserCryptography-class.html) + for list algorithms supported by it. +- [FlutterCryptography](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/FlutterCryptography-class.html) + - Makes cryptographic algorithms up to 100 times faster in Android, iOS, and Mac OS X. + - Available in the package [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus). + - See the [class documentation](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/FlutterCryptography-class.html) + for list algorithms supported by it. ## Deterministic behavior in tests + If you want to have deterministic behavior in tests, you can supply your own random number generator: For example: + ```dart -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; void main() { setUp(() { Cryptography.instance = Cryptography.instance.withRandom(SecureRandom.forTesting(seed: 42)); }); - + test('example', () async { final algorithm = AesGcm.with256bits(); - + // This will will always return the same secret key. // because we use a deterministic random number generator. final secretKey = await algorithm.newSecretKey(); - + // ... }); } @@ -279,11 +288,11 @@ void main() { ## Digital signature In this example, we use -[Ed25519](https://pub.dev/documentation/cryptography/latest/cryptography/Ed25519-class.html), +[Ed25519](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Ed25519-class.html), a popular signature algorithm: ```dart -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; Future main() async { // The message that we will sign @@ -313,11 +322,11 @@ Future main() async { ## Key agreement In this example, we -use [X25519](https://pub.dev/documentation/cryptography/latest/cryptography/X25519-class.html), +use [X25519](https://pub.dev/documentation/cryptography_plus/latest/cryptography/X25519-class.html), a popular key agreement algorithm: ```dart -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; Future main() async { final algorithm = X25519(); @@ -334,33 +343,36 @@ Future main() async { keyPair: aliceKeyPair, remotePublicKey: bobPublicKey, ); - final sharedSecretBytes = await aliceKeyPair.extractBytes(); + final sharedSecretBytes = await sharedSecret.extractBytes(); print('Shared secret: $sharedSecretBytes'); } ``` ## Authenticated encryption + When you encrypt, you need: -* Clear text (bytes you are encrypting) -* [SecretKey](https://pub.dev/documentation/cryptography/latest/cryptography/SecretKey-class.html). + +- Clear text (bytes you are encrypting) +- [SecretKey](https://pub.dev/documentation/cryptography_plus/latest/cryptography/SecretKey-class.html). You can generate a random secret key with - [cipher.newSecretKey()](https://pub.dev/documentation/cryptography/latest/cryptography/Cipher/newSecretKey.html). -* An optional _nonce_ (also known as "IV", "Initialization Vector", "salt"), which is some + [cipher.newSecretKey()](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Cipher/newSecretKey.html). +- An optional _nonce_ (also known as "IV", "Initialization Vector", "salt"), which is some non-secret byte sequence that MUST be unique each time you encrypt. If you don't provide a nonce, a random nonce will be automatically generated for you. -The output of encrypting is [SecretBox](https://pub.dev/documentation/cryptography/latest/cryptography/SecretBox-class.html) +The output of encrypting is [SecretBox](https://pub.dev/documentation/cryptography_plus/latest/cryptography/SecretBox-class.html) that contains the nonce, the cipher text (the encrypted message), and -[Mac](https://pub.dev/documentation/cryptography/latest/cryptography/Mac-class.html) (a message +[Mac](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Mac-class.html) (a message authentication code). When you decrypt, you need the _SecretBox_ and the secret key. In the following example, we encrypt a message -with [AesGcm](https://pub.dev/documentation/cryptography/latest/cryptography/AesGcm-class.html): +with [AesGcm](https://pub.dev/documentation/cryptography_plus/latest/cryptography/AesGcm-class.html): + ```dart import 'dart:convert'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; Future main() async { // Choose the cipher @@ -379,7 +391,7 @@ Future main() async { print('Nonce: ${secretBox.nonce}'); // Randomly generated nonce print('Ciphertext: ${secretBox.cipherText}'); // Encrypted message print('MAC: ${secretBox.mac}'); // Message authentication code - + // If you are sending the secretBox somewhere, you can concatenate all parts of it: final concatenatedBytes = secretBox.concatenation(); print('All three parts concatenated: $concatenatedBytes'); @@ -394,9 +406,11 @@ Future main() async { ``` ## Password hashing -In this example, we use [Argon2id](https://pub.dev/documentation/cryptography/latest/cryptography/Argon2id-class.html): + +In this example, we use [Argon2id](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Argon2id-class.html): + ```dart -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; Future main() async { final algorithm = Argon2id( @@ -405,7 +419,7 @@ Future main() async { iterations: 1, // For more security, you should usually raise memory parameter, not iterations. hashLength: 32, // Number of bytes in the returned hash ); - + final secretKey = await algorithm.deriveKeyFromPassword( password: 'qwerty', nonce: [1, 2, 3], @@ -417,9 +431,11 @@ Future main() async { ``` ## Hashing -In this example, we use [Sha256](https://pub.dev/documentation/cryptography/latest/cryptography/Sha256-class.html): + +In this example, we use [Sha256](https://pub.dev/documentation/cryptography_plus/latest/cryptography/Sha256-class.html): + ```dart -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; Future main() async { final sink = Sha256().newHashSink(); @@ -435,4 +451,4 @@ Future main() async { print('SHA-512 hash: ${hash.bytes}'); } -``` \ No newline at end of file +``` diff --git a/cryptography/example/lib/example.dart b/cryptography/example/lib/example.dart index 0ab4db3..0d50e92 100644 --- a/cryptography/example/lib/example.dart +++ b/cryptography/example/lib/example.dart @@ -1,4 +1,4 @@ -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; Future main() async { final algorithm = AesGcm.with256bits(); diff --git a/cryptography/example/pubspec.yaml b/cryptography/example/pubspec.yaml index 4124339..b0937ca 100644 --- a/cryptography/example/pubspec.yaml +++ b/cryptography/example/pubspec.yaml @@ -1,8 +1,8 @@ name: example environment: - sdk: '>=2.17.0 <3.0.0' + sdk: ">=2.17.0 <3.0.0" dependencies: - cryptography: - path: '..' \ No newline at end of file + cryptography_plus: + path: ".." diff --git a/cryptography/lib/browser.dart b/cryptography/lib/browser.dart index bf28041..1d4490c 100644 --- a/cryptography/lib/browser.dart +++ b/cryptography/lib/browser.dart @@ -15,9 +15,9 @@ /// @nodoc @Deprecated( 'This library will be removed in a future major version.' - ' You can find `BrowserCryptography` class in "package:cryptography/cryptography.dart".', + ' You can find `BrowserCryptography` class in "package:cryptography_plus/cryptography_plus.dart".', ) -library cryptography.browser; +library cryptography_plus.browser; export 'src/browser/browser_cryptography_when_not_browser.dart' if (dart.library.html) 'src/browser/browser_cryptography.dart'; diff --git a/cryptography/lib/cryptography.dart b/cryptography/lib/cryptography_plus.dart similarity index 96% rename from cryptography/lib/cryptography.dart rename to cryptography/lib/cryptography_plus.dart index 0bbcdbc..9c491ec 100644 --- a/cryptography/lib/cryptography.dart +++ b/cryptography/lib/cryptography_plus.dart @@ -24,9 +24,9 @@ /// /// ## Factory methods /// [Cryptography] contains factory methods for cryptographic algorithms. -library cryptography; +library cryptography_plus; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; export 'src/browser/browser_cryptography_when_not_browser.dart' if (dart.library.html) 'src/browser/browser_cryptography.dart'; diff --git a/cryptography/lib/dart.dart b/cryptography/lib/dart.dart index 51d9347..f98d6e8 100644 --- a/cryptography/lib/dart.dart +++ b/cryptography/lib/dart.dart @@ -15,9 +15,9 @@ /// Cryptographic algorithms implemented in pure Dart. /// /// See [DartCryptography]. -library cryptography.dart; +library cryptography_plus.dart; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/dart.dart'; export 'src/dart/aes_cbc.dart'; export 'src/dart/aes_ctr.dart'; diff --git a/cryptography/lib/helpers.dart b/cryptography/lib/helpers.dart index 8680c05..70e7d75 100644 --- a/cryptography/lib/helpers.dart +++ b/cryptography/lib/helpers.dart @@ -13,7 +13,7 @@ // limitations under the License. /// Various helpers for cryptography. -library cryptography.helpers; +library cryptography_plus.helpers; export 'src/helpers/constant_time_equality.dart'; export 'src/helpers/delegating_classes.dart'; diff --git a/cryptography/lib/src/browser/aes_cbc.dart b/cryptography/lib/src/browser/aes_cbc.dart index 9303658..0e8a069 100644 --- a/cryptography/lib/src/browser/aes_cbc.dart +++ b/cryptography/lib/src/browser/aes_cbc.dart @@ -15,7 +15,7 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '_javascript_bindings.dart' show jsArrayBufferFrom; import '_javascript_bindings.dart' as web_crypto; diff --git a/cryptography/lib/src/browser/aes_ctr.dart b/cryptography/lib/src/browser/aes_ctr.dart index 2594bdf..68c65f0 100644 --- a/cryptography/lib/src/browser/aes_ctr.dart +++ b/cryptography/lib/src/browser/aes_ctr.dart @@ -15,7 +15,7 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '_javascript_bindings.dart' show jsArrayBufferFrom; import '_javascript_bindings.dart' as web_crypto; diff --git a/cryptography/lib/src/browser/aes_gcm.dart b/cryptography/lib/src/browser/aes_gcm.dart index 6381a09..44aa5be 100644 --- a/cryptography/lib/src/browser/aes_gcm.dart +++ b/cryptography/lib/src/browser/aes_gcm.dart @@ -16,8 +16,8 @@ import 'dart:html' as html; import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/src/browser/browser_secret_key.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/src/browser/browser_secret_key.dart'; import '_javascript_bindings.dart' show jsArrayBufferFrom; import '_javascript_bindings.dart' as web_crypto; diff --git a/cryptography/lib/src/browser/browser_cryptography.dart b/cryptography/lib/src/browser/browser_cryptography.dart index bfb1a0a..298de18 100644 --- a/cryptography/lib/src/browser/browser_cryptography.dart +++ b/cryptography/lib/src/browser/browser_cryptography.dart @@ -14,10 +14,10 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/browser/rsa_pss.dart'; -import 'package:cryptography/src/browser/rsa_ssa_pkcs1v15.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/browser/rsa_pss.dart'; +import 'package:cryptography_plus/src/browser/rsa_ssa_pkcs1v15.dart'; import 'package:meta/meta.dart'; import '_javascript_bindings.dart' show isWebCryptoAvailable; diff --git a/cryptography/lib/src/browser/browser_cryptography_when_not_browser.dart b/cryptography/lib/src/browser/browser_cryptography_when_not_browser.dart index 66ae330..586d1b5 100644 --- a/cryptography/lib/src/browser/browser_cryptography_when_not_browser.dart +++ b/cryptography/lib/src/browser/browser_cryptography_when_not_browser.dart @@ -14,8 +14,8 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:meta/meta.dart'; /// An implementation of [Cryptography] that uses [Web Cryptography API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) diff --git a/cryptography/lib/src/browser/browser_ec_key_pair.dart b/cryptography/lib/src/browser/browser_ec_key_pair.dart index 3c860e6..1da786c 100644 --- a/cryptography/lib/src/browser/browser_ec_key_pair.dart +++ b/cryptography/lib/src/browser/browser_ec_key_pair.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; import '_javascript_bindings.dart' as web_crypto; class BrowserEcKeyPair extends KeyPair implements EcKeyPair { diff --git a/cryptography/lib/src/browser/browser_secret_key.dart b/cryptography/lib/src/browser/browser_secret_key.dart index 621f17d..074a632 100644 --- a/cryptography/lib/src/browser/browser_secret_key.dart +++ b/cryptography/lib/src/browser/browser_secret_key.dart @@ -15,7 +15,7 @@ import 'dart:math'; import 'dart:typed_data'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; import '../../helpers.dart'; import '_javascript_bindings.dart' as web_crypto; import '_javascript_bindings.dart'; diff --git a/cryptography/lib/src/browser/ecdh.dart b/cryptography/lib/src/browser/ecdh.dart index eacba5e..d085211 100644 --- a/cryptography/lib/src/browser/ecdh.dart +++ b/cryptography/lib/src/browser/ecdh.dart @@ -15,7 +15,7 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '_javascript_bindings.dart' as web_crypto; import 'browser_ec_key_pair.dart'; diff --git a/cryptography/lib/src/browser/ecdsa.dart b/cryptography/lib/src/browser/ecdsa.dart index ccdb7b4..7252a72 100644 --- a/cryptography/lib/src/browser/ecdsa.dart +++ b/cryptography/lib/src/browser/ecdsa.dart @@ -15,7 +15,7 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '_javascript_bindings.dart' as web_crypto; import 'browser_ec_key_pair.dart'; diff --git a/cryptography/lib/src/browser/hash.dart b/cryptography/lib/src/browser/hash.dart index 3c99f09..285b3f2 100644 --- a/cryptography/lib/src/browser/hash.dart +++ b/cryptography/lib/src/browser/hash.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:meta/meta.dart'; import '_javascript_bindings.dart' as web_crypto; diff --git a/cryptography/lib/src/browser/hkdf.dart b/cryptography/lib/src/browser/hkdf.dart index d94920c..a55779a 100644 --- a/cryptography/lib/src/browser/hkdf.dart +++ b/cryptography/lib/src/browser/hkdf.dart @@ -14,8 +14,8 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/src/browser/hash.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/src/browser/hash.dart'; import '_javascript_bindings.dart' show jsArrayBufferFrom; import '_javascript_bindings.dart' as web_crypto; diff --git a/cryptography/lib/src/browser/hmac.dart b/cryptography/lib/src/browser/hmac.dart index a475457..9244ac3 100644 --- a/cryptography/lib/src/browser/hmac.dart +++ b/cryptography/lib/src/browser/hmac.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '_javascript_bindings.dart' as web_crypto; import '_javascript_bindings.dart' show jsArrayBufferFrom; diff --git a/cryptography/lib/src/browser/pbkdf2.dart b/cryptography/lib/src/browser/pbkdf2.dart index 12708a2..6d87cd6 100644 --- a/cryptography/lib/src/browser/pbkdf2.dart +++ b/cryptography/lib/src/browser/pbkdf2.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '_javascript_bindings.dart' show jsArrayBufferFrom; import '_javascript_bindings.dart' as web_crypto; diff --git a/cryptography/lib/src/browser/rsa_pss.dart b/cryptography/lib/src/browser/rsa_pss.dart index 9cf2e5e..2932dc7 100644 --- a/cryptography/lib/src/browser/rsa_pss.dart +++ b/cryptography/lib/src/browser/rsa_pss.dart @@ -15,7 +15,7 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '_javascript_bindings.dart' as web_crypto; import '_javascript_bindings.dart' diff --git a/cryptography/lib/src/browser/rsa_ssa_pkcs1v15.dart b/cryptography/lib/src/browser/rsa_ssa_pkcs1v15.dart index 6e4d005..7b6cf23 100644 --- a/cryptography/lib/src/browser/rsa_ssa_pkcs1v15.dart +++ b/cryptography/lib/src/browser/rsa_ssa_pkcs1v15.dart @@ -15,7 +15,7 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '_javascript_bindings.dart' as web_crypto; import '_javascript_bindings.dart' diff --git a/cryptography/lib/src/cryptography/_cupertino_der.dart b/cryptography/lib/src/cryptography/_cupertino_der.dart index 0a5b21c..89b22a4 100644 --- a/cryptography/lib/src/cryptography/_cupertino_der.dart +++ b/cryptography/lib/src/cryptography/_cupertino_der.dart @@ -1,4 +1,4 @@ -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; bool bytesStartsWith(List bytes, List prefix, int index) { if (bytes.length < index + prefix.length) { diff --git a/cryptography/lib/src/cryptography/algorithms.dart b/cryptography/lib/src/cryptography/algorithms.dart index 697d9b9..d9b6b8a 100644 --- a/cryptography/lib/src/cryptography/algorithms.dart +++ b/cryptography/lib/src/cryptography/algorithms.dart @@ -1,9 +1,9 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/helpers.dart'; import 'package:meta/meta.dart'; /// _AES-CBC_ (cipher block chaining mode) [Cipher]. @@ -13,7 +13,7 @@ import 'package:meta/meta.dart'; /// On other platforms, [DartAesCbc] will be used. /// /// If you use Flutter, you can enable -/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter). +/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus). /// It can improve performance in many cases. /// /// ## Things to know @@ -31,7 +31,7 @@ import 'package:meta/meta.dart'; /// /// ## Example /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final message = [1,2,3]; @@ -164,7 +164,7 @@ abstract class AesCbc extends Cipher { /// On other platforms, [DartAesCtr] will be used. /// /// If you use Flutter, you can enable -/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter). +/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus). /// It can improve performance in many cases. /// /// ## Things to know @@ -181,7 +181,7 @@ abstract class AesCbc extends Cipher { /// /// ## Example /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final message = [1,2,3]; @@ -316,7 +316,7 @@ abstract class AesCtr extends StreamingCipher { /// On other platforms, [DartAesGcm] will be used. /// /// If you use Flutter, you can enable -/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter). +/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus). /// It can improve performance in many cases. /// /// ## Things to know @@ -334,7 +334,7 @@ abstract class AesCtr extends StreamingCipher { /// /// ## Example /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final message = [1,2,3]; @@ -474,7 +474,7 @@ abstract class AesGcm extends Cipher { /// /// ## Example /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final algorithm = Argon2id( @@ -497,7 +497,7 @@ abstract class AesGcm extends Cipher { /// ## In need of synchronous APIs? /// /// If you need to perform operations synchronously, use [DartArgon2id] in -/// _package:cryptography/dart.dart_. +/// _package:cryptography_plus/dart.dart_. /// abstract class Argon2id extends KdfAlgorithm { factory Argon2id({ @@ -585,7 +585,7 @@ abstract class Argon2id extends KdfAlgorithm { /// /// ## Example: Hashing a byte list /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final algorithm = Blake2b(); @@ -599,7 +599,7 @@ abstract class Argon2id extends KdfAlgorithm { /// /// ## Example: Hashing a sequence of chunks /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// final algorithm = Blake2b(); @@ -714,7 +714,7 @@ abstract class Blake2b extends HashAlgorithm implements MacAlgorithm { /// /// ## Example: Hashing a byte list /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final algorithm = Blake2s(); @@ -726,7 +726,7 @@ abstract class Blake2b extends HashAlgorithm implements MacAlgorithm { /// /// ## Example: Hashing a sequence of chunks /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// final algorithm = Blake2s(); @@ -825,7 +825,7 @@ abstract class Blake2s extends HashAlgorithm implements MacAlgorithm { /// By default, [DartChacha20] will be used. It is a pure Dart implementation. /// /// If you use Flutter, you can enable -/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter). +/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus). /// It can improve performance in many cases. /// /// ## Things to know @@ -836,7 +836,7 @@ abstract class Blake2s extends HashAlgorithm implements MacAlgorithm { /// /// ## Example /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final message = [1,2,3]; @@ -886,7 +886,7 @@ abstract class Chacha20 extends StreamingCipher { /// on _ChaCha20_. /// /// If you use Flutter, you can enable - /// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter). + /// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus). /// It can improve performance in many cases. /// /// ## Things to know @@ -897,7 +897,7 @@ abstract class Chacha20 extends StreamingCipher { /// /// ## Example /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final message = [1,2,3]; @@ -970,7 +970,7 @@ abstract class Chacha20 extends StreamingCipher { /// On other platforms, [DartEcdh] will be used. /// /// If you use Flutter, you can enable -/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter). +/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus). /// It can improve performance in many cases. /// /// ## Things to know @@ -981,7 +981,7 @@ abstract class Chacha20 extends StreamingCipher { /// /// ## Example /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final algorithm = Ecdh.p256(); @@ -1051,7 +1051,7 @@ abstract class Ecdh extends KeyExchangeAlgorithm { /// On other platforms, [DartEcdsa] will be used. /// /// If you use Flutter, you can enable -/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter). +/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus). /// It can improve performance in many cases. /// /// ## Things to know @@ -1062,7 +1062,7 @@ abstract class Ecdh extends KeyExchangeAlgorithm { /// /// ## Example /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// // In this example, we use ECDSA-P256-SHA256 @@ -1136,7 +1136,7 @@ abstract class Ecdsa extends SignatureAlgorithm { /// /// By default, [DartEd25519] will be used. /// If you use Flutter, you can enable -/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter). +/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus). /// It can improve performance in many cases. /// /// ## Things to know @@ -1151,7 +1151,7 @@ abstract class Ecdsa extends SignatureAlgorithm { /// /// ## Example /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final algorithm = Ed25519(); @@ -1179,7 +1179,7 @@ abstract class Ecdsa extends SignatureAlgorithm { /// ## In need of synchronous APIs? /// /// If you need to perform operations synchronously, use [DartEd25519] in -/// _package:cryptography/dart.dart_. +/// _package:cryptography_plus/dart.dart_. /// abstract class Ed25519 extends SignatureAlgorithm { final Random? _random; @@ -1244,12 +1244,12 @@ abstract class Hchacha20 { /// [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API), /// which has very good HKDF performance. /// -/// Flutter developers should add [cryptography_flutter](https://pub.dev/packages/cryptography_flutter), +/// Flutter developers should add [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus), /// as a dependency for the best possible HKDF performance. /// /// ## Example /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// final algorithm = Hkdf( @@ -1307,7 +1307,7 @@ abstract class Hkdf extends KdfAlgorithm { /// [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API), /// which has very good HMAC performance. /// -/// Flutter developers should add [cryptography_flutter](https://pub.dev/packages/cryptography_flutter), +/// Flutter developers should add [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus), /// as a dependency for the best possible HMAC performance. /// /// ## Things to know @@ -1330,7 +1330,7 @@ abstract class Hkdf extends KdfAlgorithm { /// /// ## Example /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// final message = [1,2,3]; @@ -1350,8 +1350,8 @@ abstract class Hkdf extends KdfAlgorithm { /// absolutely need do computations synchronously: /// /// ```dart -/// import 'package:cryptography/cryptography.dart'; -/// import 'package:cryptography/dart.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; +/// import 'package:cryptography_plus/dart.dart'; /// /// void main() { /// final algorithm = DartHmac.sha256(); @@ -1445,7 +1445,7 @@ abstract class Hmac extends MacAlgorithm { /// [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API), /// which has very good PBKDF2 performance. /// -/// Flutter developers should add [cryptography_flutter](https://pub.dev/packages/cryptography_flutter), +/// Flutter developers should add [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus), /// as a dependency for the best possible PBKDF2 performance. /// /// ## Things to know @@ -1461,7 +1461,7 @@ abstract class Hmac extends MacAlgorithm { /// /// ## Example /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final pbkdf2 = Pbkdf2( @@ -1602,7 +1602,7 @@ abstract class Poly1305 extends MacAlgorithm { /// /// ## Example /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final algorithm = RsaPss(Sha256()); @@ -1715,7 +1715,7 @@ abstract class RsaPss extends SignatureAlgorithm { /// /// ## Example /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final algorithm = RsaSsaPkcs1v15(Sha256()); @@ -1791,7 +1791,7 @@ abstract class RsaSsaPkcs1v15 extends SignatureAlgorithm { /// /// ## Asynchronous usage (recommended) /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final message = [1,2,3]; @@ -1807,7 +1807,7 @@ abstract class RsaSsaPkcs1v15 extends SignatureAlgorithm { /// This enables you to handle very large inputs without keeping everything in /// memory: /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// // Create a sink @@ -1853,7 +1853,7 @@ abstract class Sha1 extends HashAlgorithm { /// /// ## Asynchronous usage (recommended) /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final message = [1,2,3]; @@ -1869,7 +1869,7 @@ abstract class Sha1 extends HashAlgorithm { /// This enables you to handle very large inputs without keeping everything in /// memory: /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// // Create a sink @@ -1917,7 +1917,7 @@ abstract class Sha224 extends HashAlgorithm { /// /// ## Asynchronous usage (recommended) /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final message = [1,2,3]; @@ -1933,7 +1933,7 @@ abstract class Sha224 extends HashAlgorithm { /// This enables you to handle very large inputs without keeping everything in /// memory: /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// // Create a sink @@ -1981,7 +1981,7 @@ abstract class Sha256 extends HashAlgorithm { /// /// ## Asynchronous usage (recommended) /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final message = [1,2,3]; @@ -1997,7 +1997,7 @@ abstract class Sha256 extends HashAlgorithm { /// This enables you to handle very large inputs without keeping everything in /// memory: /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// // Create a sink @@ -2045,7 +2045,7 @@ abstract class Sha384 extends HashAlgorithm { /// /// ## Asynchronous usage (recommended) /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final message = [1,2,3]; @@ -2061,7 +2061,7 @@ abstract class Sha384 extends HashAlgorithm { /// This enables you to handle very large inputs without keeping everything in /// memory: /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// // Create a sink @@ -2147,7 +2147,7 @@ abstract class StreamingCipher extends Cipher { /// /// By default, [DartX25519] will be used. /// If you use Flutter, you can enable -/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter). +/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus). /// It can improve performance in many cases. /// /// ## Things to know @@ -2159,7 +2159,7 @@ abstract class StreamingCipher extends Cipher { /// /// ## Example /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final algorithm = X25519(); @@ -2181,7 +2181,7 @@ abstract class StreamingCipher extends Cipher { /// ## In need of synchronous APIs? /// /// If you need to perform operations synchronously, use [DartX25519] in -/// _package:cryptography/dart.dart_. +/// _package:cryptography_plus/dart.dart_. /// abstract class X25519 extends KeyExchangeAlgorithm { final Random? _random; @@ -2216,7 +2216,7 @@ abstract class X25519 extends KeyExchangeAlgorithm { /// By default, [DartXchacha20] will be used. /// /// If you use Flutter, you can enable -/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter). +/// [cryptography_flutter](https://pub.dev/packages/cryptography_flutter_plus). /// It can improve performance in many cases. /// /// ## Things to know diff --git a/cryptography/lib/src/cryptography/cipher.dart b/cryptography/lib/src/cryptography/cipher.dart index bcb349d..13c7fa6 100644 --- a/cryptography/lib/src/cryptography/cipher.dart +++ b/cryptography/lib/src/cryptography/cipher.dart @@ -17,8 +17,8 @@ import 'dart:convert'; import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/helpers.dart'; import 'package:meta/meta.dart'; import '../../dart.dart'; @@ -37,7 +37,7 @@ import '../../dart.dart'; /// ## Example /// An example of using [AesCtr] and [Hmac]: /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final message = [1,2,3]; @@ -399,7 +399,7 @@ abstract class Cipher { String clearText, { required SecretKey secretKey, }) async { - final bytes = utf8.encode(clearText) as Uint8List; + final bytes = utf8.encode(clearText); final secretBox = await encrypt( bytes, secretKey: secretKey, @@ -496,7 +496,7 @@ abstract class Cipher { /// /// ## Example /// ``` - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() { /// final cipher = Chacha20.poly1305Aead().toSync(); diff --git a/cryptography/lib/src/cryptography/cipher_state.dart b/cryptography/lib/src/cryptography/cipher_state.dart index 7edc8f7..0ee8851 100644 --- a/cryptography/lib/src/cryptography/cipher_state.dart +++ b/cryptography/lib/src/cryptography/cipher_state.dart @@ -15,7 +15,7 @@ import 'dart:async'; import 'dart:typed_data'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; /// A state of [Cipher], which helps you to encrypt or decrypt data that does /// not fit in memory. diff --git a/cryptography/lib/src/cryptography/cipher_wand.dart b/cryptography/lib/src/cryptography/cipher_wand.dart index 48002eb..3032904 100644 --- a/cryptography/lib/src/cryptography/cipher_wand.dart +++ b/cryptography/lib/src/cryptography/cipher_wand.dart @@ -15,7 +15,7 @@ import 'dart:convert'; import 'dart:typed_data'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; /// An opaque object that possesses some non-extractable secret key. /// @@ -24,7 +24,7 @@ import '../../cryptography.dart'; /// ## Example /// In this example, we use [Chacha20.poly1305Aead]: /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final cipher = Chacha20.poly1305Aead(); @@ -54,7 +54,7 @@ abstract class CipherWand extends Wand { /// ## Example /// In this example, we use [Chacha20.poly1305Aead]: /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final cipher = Chacha20.poly1305Aead(); @@ -86,7 +86,7 @@ abstract class CipherWand extends Wand { /// ## Example /// In this example, we use [Chacha20.poly1305Aead]: /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final cipher = Chacha20.poly1305Aead(); @@ -124,7 +124,7 @@ abstract class CipherWand extends Wand { /// ## Example /// In this example, we use [Chacha20.poly1305Aead]: /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final cipher = Chacha20.poly1305Aead(); @@ -158,7 +158,7 @@ abstract class CipherWand extends Wand { /// ## Example /// In this example, we use [Chacha20.poly1305Aead]: /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final cipher = Chacha20.poly1305Aead(); @@ -177,7 +177,7 @@ abstract class CipherWand extends Wand { /// } /// ``` Future encryptString(String clearText) async { - final bytes = utf8.encode(clearText) as Uint8List; + final bytes = utf8.encode(clearText); final secretBox = await encrypt( bytes, possibleBuffer: bytes, diff --git a/cryptography/lib/src/cryptography/cryptography.dart b/cryptography/lib/src/cryptography/cryptography.dart index 17c37e7..89e4397 100644 --- a/cryptography/lib/src/cryptography/cryptography.dart +++ b/cryptography/lib/src/cryptography/cryptography.dart @@ -14,8 +14,8 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; /// A factory for cryptographic algorithms. /// @@ -26,14 +26,14 @@ import 'package:cryptography/dart.dart'; /// ## Implementations /// * [DartCryptography] /// * [BrowserCryptography] -/// * [FlutterCryptography](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/FlutterCryptography-class.html) (_package:cryptography_flutter_) +/// * [FlutterCryptography](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/FlutterCryptography-class.html) (_package:cryptography_flutter_) /// /// ## Setting implementation /// /// In shipped application, it's a good practice to freeze the value of static /// variable with [freezeInstance]: /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() { /// Cryptography.freezeInstance(yourInstance); @@ -44,8 +44,8 @@ import 'package:cryptography/dart.dart'; /// /// ## Writing you own subclass /// ```dart -/// import 'package:cryptography/browser.dart'; -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/browser.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// class MyCryptography extends BrowserCryptography { /// @override diff --git a/cryptography/lib/src/cryptography/ec_key_pair.dart b/cryptography/lib/src/cryptography/ec_key_pair.dart index 847d21e..19592eb 100644 --- a/cryptography/lib/src/cryptography/ec_key_pair.dart +++ b/cryptography/lib/src/cryptography/ec_key_pair.dart @@ -15,8 +15,8 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/helpers.dart'; import '../_internal/hex.dart'; import '_cupertino_der.dart'; diff --git a/cryptography/lib/src/cryptography/ec_public_key.dart b/cryptography/lib/src/cryptography/ec_public_key.dart index 0cb2c11..f2a94cd 100644 --- a/cryptography/lib/src/cryptography/ec_public_key.dart +++ b/cryptography/lib/src/cryptography/ec_public_key.dart @@ -15,8 +15,8 @@ import 'dart:typed_data'; import 'package:collection/collection.dart'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/src/cryptography/_cupertino_der.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/src/cryptography/_cupertino_der.dart'; /// Public key of _P-256_ / _P-384_ / _P-521_ key pair. /// diff --git a/cryptography/lib/src/cryptography/hash.dart b/cryptography/lib/src/cryptography/hash.dart index 863983c..1a09ff0 100644 --- a/cryptography/lib/src/cryptography/hash.dart +++ b/cryptography/lib/src/cryptography/hash.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/helpers.dart'; import 'package:meta/meta.dart'; /// A digest calculated with some [HashAlgorithm]. diff --git a/cryptography/lib/src/cryptography/hash_algorithm.dart b/cryptography/lib/src/cryptography/hash_algorithm.dart index b9ca8ce..270356f 100644 --- a/cryptography/lib/src/cryptography/hash_algorithm.dart +++ b/cryptography/lib/src/cryptography/hash_algorithm.dart @@ -15,8 +15,8 @@ import 'dart:convert'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; /// A hash algorithm that produces a [Hash]. /// @@ -31,7 +31,7 @@ import 'package:cryptography/dart.dart'; /// /// ## Example: simple usage /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// final algorithm = Sha256(); @@ -42,7 +42,7 @@ import 'package:cryptography/dart.dart'; /// /// ## Example: hashing many chunks /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// // Create a sink @@ -84,7 +84,7 @@ abstract class HashAlgorithm { /// ## Example /// An example with [Sha256]: /// ``` - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// // Create a sink @@ -117,7 +117,7 @@ abstract class HashAlgorithm { /// ## Example /// An example with [Sha256]: /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// // Create a sink diff --git a/cryptography/lib/src/cryptography/kdf_algorithm.dart b/cryptography/lib/src/cryptography/kdf_algorithm.dart index fa185b0..3e79b49 100644 --- a/cryptography/lib/src/cryptography/kdf_algorithm.dart +++ b/cryptography/lib/src/cryptography/kdf_algorithm.dart @@ -14,7 +14,7 @@ import 'dart:convert'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; /// Abstract superclass for Key Derivation Algorithms (KDFs). /// diff --git a/cryptography/lib/src/cryptography/key_exchange_algorithm.dart b/cryptography/lib/src/cryptography/key_exchange_algorithm.dart index c7652eb..c5b1a22 100644 --- a/cryptography/lib/src/cryptography/key_exchange_algorithm.dart +++ b/cryptography/lib/src/cryptography/key_exchange_algorithm.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; /// Abstract superclass for key exchange algorithms. /// @@ -28,7 +28,7 @@ import 'package:cryptography/cryptography.dart'; /// ## Example /// In this example, we use [X25519]: /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// // Generate a key pair for Alice @@ -72,7 +72,7 @@ abstract class KeyExchangeAlgorithm { /// ## Example /// In this example, we use [X25519]: /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final algorithm = X25519(); @@ -90,7 +90,7 @@ abstract class KeyExchangeAlgorithm { /// In this example, we use [X25519]: /// ```dart /// import 'dart:convert'; - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// // X25519 seed is any 32 bytes. @@ -113,7 +113,7 @@ abstract class KeyExchangeAlgorithm { /// ## Example /// In this example, we use [X25519]: /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final algorithm = X25519(); diff --git a/cryptography/lib/src/cryptography/key_exchange_wand.dart b/cryptography/lib/src/cryptography/key_exchange_wand.dart index 04534e8..133f9aa 100644 --- a/cryptography/lib/src/cryptography/key_exchange_wand.dart +++ b/cryptography/lib/src/cryptography/key_exchange_wand.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; /// An opaque object that has some key pair and support for [sharedSecretKey]. /// @@ -21,7 +21,7 @@ import '../../cryptography.dart'; /// /// ## Example /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final x25519 = X25519(); @@ -44,7 +44,7 @@ abstract class KeyExchangeWand extends Wand { /// /// ## Example /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final x25519 = X25519(); diff --git a/cryptography/lib/src/cryptography/key_pair.dart b/cryptography/lib/src/cryptography/key_pair.dart index d445ff3..0ea7ffd 100644 --- a/cryptography/lib/src/cryptography/key_pair.dart +++ b/cryptography/lib/src/cryptography/key_pair.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:meta/meta.dart'; /// A key pair composed of a private key ([KeyPairData]) and [PublicKey]. diff --git a/cryptography/lib/src/cryptography/key_pair_type.dart b/cryptography/lib/src/cryptography/key_pair_type.dart index d925b59..244875c 100644 --- a/cryptography/lib/src/cryptography/key_pair_type.dart +++ b/cryptography/lib/src/cryptography/key_pair_type.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:meta/meta.dart'; /// Static information about a key pair type. diff --git a/cryptography/lib/src/cryptography/mac.dart b/cryptography/lib/src/cryptography/mac.dart index cb1cce5..a0c902c 100644 --- a/cryptography/lib/src/cryptography/mac.dart +++ b/cryptography/lib/src/cryptography/mac.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/helpers.dart'; import 'package:meta/meta.dart'; /// A Message Authentication Code (MAC). Usually obtained from some diff --git a/cryptography/lib/src/cryptography/mac_algorithm.dart b/cryptography/lib/src/cryptography/mac_algorithm.dart index 1fdc187..b2c2b2c 100644 --- a/cryptography/lib/src/cryptography/mac_algorithm.dart +++ b/cryptography/lib/src/cryptography/mac_algorithm.dart @@ -16,8 +16,8 @@ import 'dart:async'; import 'dart:convert'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; /// A Message Authentication Code (MAC) algorithm. /// @@ -94,7 +94,7 @@ abstract class MacAlgorithm { /// /// ## Example /// ``` - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() { /// final secretKey = SecretKey([1,2,3]); @@ -156,7 +156,7 @@ abstract class MacAlgorithm { /// /// ## Example /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() { /// final secretKey = SecretKey([1,2,3]); diff --git a/cryptography/lib/src/cryptography/rsa_key_pair.dart b/cryptography/lib/src/cryptography/rsa_key_pair.dart index 3bad5b3..d78d71c 100644 --- a/cryptography/lib/src/cryptography/rsa_key_pair.dart +++ b/cryptography/lib/src/cryptography/rsa_key_pair.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/helpers.dart'; /// Opaque reference to RSA key pair. /// diff --git a/cryptography/lib/src/cryptography/rsa_public_key.dart b/cryptography/lib/src/cryptography/rsa_public_key.dart index ea35dec..14888ff 100644 --- a/cryptography/lib/src/cryptography/rsa_public_key.dart +++ b/cryptography/lib/src/cryptography/rsa_public_key.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/helpers.dart'; /// RSA public key. /// diff --git a/cryptography/lib/src/cryptography/secret_box.dart b/cryptography/lib/src/cryptography/secret_box.dart index 046ddfa..d9e98b7 100644 --- a/cryptography/lib/src/cryptography/secret_box.dart +++ b/cryptography/lib/src/cryptography/secret_box.dart @@ -14,8 +14,8 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/src/utils.dart'; /// Output of encrypting bytes with a [Cipher]. /// @@ -29,7 +29,7 @@ import 'package:cryptography/src/utils.dart'; /// You can use [concatenation] and [SecretBox.fromConcatenation] to concatenate /// the fields into a single byte array: /// ``` -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// final aesGcm = AesGcm.with256bits(); diff --git a/cryptography/lib/src/cryptography/secret_key.dart b/cryptography/lib/src/cryptography/secret_key.dart index be20d99..78775cb 100644 --- a/cryptography/lib/src/cryptography/secret_key.dart +++ b/cryptography/lib/src/cryptography/secret_key.dart @@ -17,7 +17,7 @@ import 'dart:typed_data' show Uint8List; import 'package:meta/meta.dart'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; import '../utils.dart'; /// An opaque reference to a secret sequence of bytes used for encryption and @@ -201,6 +201,7 @@ class SecretKeyData extends SecretKey { @override void destroy() { _bytes.destroy(); + super.destroy(); } @override diff --git a/cryptography/lib/src/cryptography/secret_key_type.dart b/cryptography/lib/src/cryptography/secret_key_type.dart index 0c8daf8..44e97f7 100644 --- a/cryptography/lib/src/cryptography/secret_key_type.dart +++ b/cryptography/lib/src/cryptography/secret_key_type.dart @@ -12,7 +12,7 @@ // // See the License for the specific language governing permissions and // // limitations under the License. // -// import 'package:cryptography/cryptography.dart'; +// import 'package:cryptography_plus/cryptography_plus.dart'; // import 'package:meta/meta.dart'; // // class SecretKeyType { diff --git a/cryptography/lib/src/cryptography/secure_random.dart b/cryptography/lib/src/cryptography/secure_random.dart index 25a8481..a7c1a49 100644 --- a/cryptography/lib/src/cryptography/secure_random.dart +++ b/cryptography/lib/src/cryptography/secure_random.dart @@ -15,7 +15,7 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:meta/meta.dart'; const _bit20 = 0x100000; @@ -54,7 +54,7 @@ abstract class SecureRandom implements Random { /// /// ## Example /// ```dart - /// import 'package:cryptography/random.dart'; + /// import 'package:cryptography_plus/random.dart'; /// /// void main() { /// final random = SecureRandom.instance; @@ -89,7 +89,7 @@ abstract class SecureRandom implements Random { /// /// ## Example /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() { /// final random = SecureRandom.forTesting(seed: 0); diff --git a/cryptography/lib/src/cryptography/sensitive_bytes.dart b/cryptography/lib/src/cryptography/sensitive_bytes.dart index 7484948..c6453ac 100644 --- a/cryptography/lib/src/cryptography/sensitive_bytes.dart +++ b/cryptography/lib/src/cryptography/sensitive_bytes.dart @@ -15,7 +15,7 @@ import 'dart:collection'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; /// List of security-sensitive bytes that can be destroyed with [destroy]. /// diff --git a/cryptography/lib/src/cryptography/signature.dart b/cryptography/lib/src/cryptography/signature.dart index 5e8f958..7d4b5ce 100644 --- a/cryptography/lib/src/cryptography/signature.dart +++ b/cryptography/lib/src/cryptography/signature.dart @@ -13,7 +13,7 @@ // limitations under the License. import 'package:collection/collection.dart'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; /// A digital signature by some [SignatureAlgorithm]. /// diff --git a/cryptography/lib/src/cryptography/signature_algorithm.dart b/cryptography/lib/src/cryptography/signature_algorithm.dart index 19abe0e..9d0d02a 100644 --- a/cryptography/lib/src/cryptography/signature_algorithm.dart +++ b/cryptography/lib/src/cryptography/signature_algorithm.dart @@ -14,7 +14,7 @@ import 'dart:convert'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; /// An digital signature algorithm that supports [newKeyPair()], [sign()], /// [verify()]. @@ -30,7 +30,7 @@ import 'package:cryptography/cryptography.dart'; /// ## Example /// In this example, we use [Ed25519]: /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final signedMessage = 'Hello, world!'; @@ -95,7 +95,7 @@ abstract class SignatureAlgorithm { /// ## Example /// In this example, we use [Ed25519]: /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final signedMessage = [1,2,3]; @@ -126,7 +126,7 @@ abstract class SignatureAlgorithm { /// ## Example /// In this example, we use [Ed25519]: /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final signedMessage = 'Hello, world!'; @@ -160,7 +160,7 @@ abstract class SignatureAlgorithm { /// ## Example /// In this example, we use [Ed25519]: /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final signedMessage = [1,2,3]; @@ -191,7 +191,7 @@ abstract class SignatureAlgorithm { /// ## Example /// In this example, we use [Ed25519]: /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final signedMessage = 'Hello, world!'; diff --git a/cryptography/lib/src/cryptography/signature_wand.dart b/cryptography/lib/src/cryptography/signature_wand.dart index 2a6d54f..bd16f11 100644 --- a/cryptography/lib/src/cryptography/signature_wand.dart +++ b/cryptography/lib/src/cryptography/signature_wand.dart @@ -14,7 +14,7 @@ import 'dart:convert'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; /// An opaque object that has some key pair and support for [sign]. /// @@ -23,7 +23,7 @@ import '../../cryptography.dart'; /// /// ## Example /// ```dart -/// import 'package:cryptography/cryptography.dart'; +/// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final ed25519 = Ed25519(); @@ -42,7 +42,7 @@ abstract class SignatureWand extends Wand { /// /// ## Example /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final ed25519 = Ed25519(); @@ -61,7 +61,7 @@ abstract class SignatureWand extends Wand { /// /// ## Example /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// Future main() async { /// final signedMessage = 'Hello, world!'; diff --git a/cryptography/lib/src/cryptography/simple_key_pair.dart b/cryptography/lib/src/cryptography/simple_key_pair.dart index 9d75c56..87e3d86 100644 --- a/cryptography/lib/src/cryptography/simple_key_pair.dart +++ b/cryptography/lib/src/cryptography/simple_key_pair.dart @@ -15,7 +15,7 @@ import 'dart:async'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:meta/meta.dart'; /// An opaque [KeyPair] that is made of two simple byte sequences. diff --git a/cryptography/lib/src/cryptography/simple_public_key.dart b/cryptography/lib/src/cryptography/simple_public_key.dart index d403313..18e5b6b 100644 --- a/cryptography/lib/src/cryptography/simple_public_key.dart +++ b/cryptography/lib/src/cryptography/simple_public_key.dart @@ -13,7 +13,7 @@ // limitations under the License. import 'package:collection/collection.dart'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:meta/meta.dart'; /// A [PublicKey] that is a sequence of bytes. diff --git a/cryptography/lib/src/cryptography/wand.dart b/cryptography/lib/src/cryptography/wand.dart index 7775c74..6f743f5 100644 --- a/cryptography/lib/src/cryptography/wand.dart +++ b/cryptography/lib/src/cryptography/wand.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:meta/meta.dart'; /// Superclass of [SignatureWand], [KeyExchangeWand], and [CipherWand]. diff --git a/cryptography/lib/src/dart/_helpers.dart b/cryptography/lib/src/dart/_helpers.dart index 4b45473..0265038 100644 --- a/cryptography/lib/src/dart/_helpers.dart +++ b/cryptography/lib/src/dart/_helpers.dart @@ -18,7 +18,7 @@ import 'dart:typed_data'; import 'package:crypto/crypto.dart' as other; import 'package:meta/meta.dart'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; import '../../dart.dart'; /// Throws an error if the system is not little-endian. diff --git a/cryptography/lib/src/dart/aes_cbc.dart b/cryptography/lib/src/dart/aes_cbc.dart index 5d38685..87fdcf9 100644 --- a/cryptography/lib/src/dart/aes_cbc.dart +++ b/cryptography/lib/src/dart/aes_cbc.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../utils.dart'; import 'aes_impl.dart'; diff --git a/cryptography/lib/src/dart/aes_ctr.dart b/cryptography/lib/src/dart/aes_ctr.dart index 353eb98..05640c5 100644 --- a/cryptography/lib/src/dart/aes_ctr.dart +++ b/cryptography/lib/src/dart/aes_ctr.dart @@ -14,8 +14,8 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import '../../helpers.dart'; import '../utils.dart'; diff --git a/cryptography/lib/src/dart/aes_gcm.dart b/cryptography/lib/src/dart/aes_gcm.dart index 62b9c41..00129fa 100644 --- a/cryptography/lib/src/dart/aes_gcm.dart +++ b/cryptography/lib/src/dart/aes_gcm.dart @@ -14,8 +14,8 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/src/dart/dart_mac_algorithm.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/src/dart/dart_mac_algorithm.dart'; import 'package:meta/meta.dart'; import '../../helpers.dart'; diff --git a/cryptography/lib/src/dart/aes_impl.dart b/cryptography/lib/src/dart/aes_impl.dart index 8b25d19..6e14c8d 100644 --- a/cryptography/lib/src/dart/aes_impl.dart +++ b/cryptography/lib/src/dart/aes_impl.dart @@ -14,8 +14,8 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/helpers.dart'; import '../../dart.dart'; import 'aes_impl_constants.dart' as constants; diff --git a/cryptography/lib/src/dart/argon2.dart b/cryptography/lib/src/dart/argon2.dart index 3497a47..b4ef330 100644 --- a/cryptography/lib/src/dart/argon2.dart +++ b/cryptography/lib/src/dart/argon2.dart @@ -16,11 +16,11 @@ import 'dart:async'; import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/dart/_helpers.dart'; -import 'package:cryptography/src/dart/argon2_impl_browser.dart' - if (dart.library.ffi) 'package:cryptography/src/dart/argon2_impl_vm.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/dart/_helpers.dart'; +import 'package:cryptography_plus/src/dart/argon2_impl_browser.dart' + if (dart.library.ffi) 'package:cryptography_plus/src/dart/argon2_impl_vm.dart'; import 'package:meta/meta.dart'; const _bit32 = 0x100000000; diff --git a/cryptography/lib/src/dart/argon2_impl_browser.dart b/cryptography/lib/src/dart/argon2_impl_browser.dart index 890faee..aebbca1 100644 --- a/cryptography/lib/src/dart/argon2_impl_browser.dart +++ b/cryptography/lib/src/dart/argon2_impl_browser.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/dart.dart'; typedef DartArgon2StateImpl = DartArgon2StateImplBrowser; diff --git a/cryptography/lib/src/dart/blake2b.dart b/cryptography/lib/src/dart/blake2b.dart index 24a2206..e40fe8f 100644 --- a/cryptography/lib/src/dart/blake2b.dart +++ b/cryptography/lib/src/dart/blake2b.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'blake2b_impl_vm.dart' if (dart.library.html) 'blake2b_impl_browser.dart'; diff --git a/cryptography/lib/src/dart/blake2b_impl_browser.dart b/cryptography/lib/src/dart/blake2b_impl_browser.dart index c383c91..03107aa 100644 --- a/cryptography/lib/src/dart/blake2b_impl_browser.dart +++ b/cryptography/lib/src/dart/blake2b_impl_browser.dart @@ -14,9 +14,9 @@ import 'dart:typed_data'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/src/utils.dart'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; import '../../dart.dart'; import '_helpers.dart'; diff --git a/cryptography/lib/src/dart/blake2b_impl_vm.dart b/cryptography/lib/src/dart/blake2b_impl_vm.dart index 7697892..9e14b3e 100644 --- a/cryptography/lib/src/dart/blake2b_impl_vm.dart +++ b/cryptography/lib/src/dart/blake2b_impl_vm.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/src/cryptography/secret_key.dart'; +import 'package:cryptography_plus/src/cryptography/secret_key.dart'; import '../../dart.dart'; import '_helpers.dart'; diff --git a/cryptography/lib/src/dart/blake2s.dart b/cryptography/lib/src/dart/blake2s.dart index 4a00c4d..d0e136a 100644 --- a/cryptography/lib/src/dart/blake2s.dart +++ b/cryptography/lib/src/dart/blake2s.dart @@ -14,9 +14,9 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/dart/_helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/dart/_helpers.dart'; import '../_internal/rotate.dart'; diff --git a/cryptography/lib/src/dart/chacha20.dart b/cryptography/lib/src/dart/chacha20.dart index 4068ed1..100fc44 100644 --- a/cryptography/lib/src/dart/chacha20.dart +++ b/cryptography/lib/src/dart/chacha20.dart @@ -14,9 +14,9 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/utils.dart'; /// [Chacha20] implemented in pure Dart. /// diff --git a/cryptography/lib/src/dart/chacha20_poly1305_aead_mac_algorithm.dart b/cryptography/lib/src/dart/chacha20_poly1305_aead_mac_algorithm.dart index 94b07fd..632a181 100644 --- a/cryptography/lib/src/dart/chacha20_poly1305_aead_mac_algorithm.dart +++ b/cryptography/lib/src/dart/chacha20_poly1305_aead_mac_algorithm.dart @@ -14,8 +14,8 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:meta/meta.dart'; import '../../dart.dart'; @@ -36,7 +36,7 @@ class DartChacha20Poly1305AeadMacAlgorithm extends MacAlgorithm /// /// ## Example /// ```dart - /// import 'package:cryptography/dart.dart'; + /// import 'package:cryptography_plus/dart.dart'; /// /// void main() { /// final algorithm = DartChacha20Poly1305AeadMacAlgorithm(); diff --git a/cryptography/lib/src/dart/cryptography.dart b/cryptography/lib/src/dart/cryptography.dart index f70f99e..5830680 100644 --- a/cryptography/lib/src/dart/cryptography.dart +++ b/cryptography/lib/src/dart/cryptography.dart @@ -14,8 +14,8 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; /// An implementation of [Cryptography] in pure Dart. /// diff --git a/cryptography/lib/src/dart/dart_cipher.dart b/cryptography/lib/src/dart/dart_cipher.dart index 6c5f339..44d8c2e 100644 --- a/cryptography/lib/src/dart/dart_cipher.dart +++ b/cryptography/lib/src/dart/dart_cipher.dart @@ -16,8 +16,8 @@ import 'dart:async'; import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:meta/meta.dart'; /// Superclass for pure Dart implementations of [Cipher]. diff --git a/cryptography/lib/src/dart/dart_hash_algorithm.dart b/cryptography/lib/src/dart/dart_hash_algorithm.dart index f965115..1d1ea44 100644 --- a/cryptography/lib/src/dart/dart_hash_algorithm.dart +++ b/cryptography/lib/src/dart/dart_hash_algorithm.dart @@ -15,7 +15,7 @@ import 'dart:async'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:meta/meta.dart'; abstract class DartHashAlgorithm extends HashAlgorithm { diff --git a/cryptography/lib/src/dart/dart_key_exchange_algorithm.dart b/cryptography/lib/src/dart/dart_key_exchange_algorithm.dart index 247cde2..0a66793 100644 --- a/cryptography/lib/src/dart/dart_key_exchange_algorithm.dart +++ b/cryptography/lib/src/dart/dart_key_exchange_algorithm.dart @@ -14,7 +14,7 @@ import 'dart:async'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; /// A mixin for pure Dart implementations of [KeyExchangeAlgorithm]. mixin DartKeyExchangeAlgorithmMixin implements KeyExchangeAlgorithm { @@ -35,7 +35,7 @@ mixin DartKeyExchangeAlgorithmMixin implements KeyExchangeAlgorithm { /// ## Example /// In this example, we use [DartX25519] class: /// ```dart - /// import 'package:cryptography/cryptography.dart'; + /// import 'package:cryptography_plus/cryptography_plus.dart'; /// /// void main() async { /// final algorithm = DartX25519(); diff --git a/cryptography/lib/src/dart/dart_mac_algorithm.dart b/cryptography/lib/src/dart/dart_mac_algorithm.dart index 62f774e..9d6ea10 100644 --- a/cryptography/lib/src/dart/dart_mac_algorithm.dart +++ b/cryptography/lib/src/dart/dart_mac_algorithm.dart @@ -15,7 +15,7 @@ import 'dart:async'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:meta/meta.dart'; abstract class DartMacAlgorithm extends MacAlgorithm { diff --git a/cryptography/lib/src/dart/dart_signature_algorithm.dart b/cryptography/lib/src/dart/dart_signature_algorithm.dart index 555804a..fd2db13 100644 --- a/cryptography/lib/src/dart/dart_signature_algorithm.dart +++ b/cryptography/lib/src/dart/dart_signature_algorithm.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; /// A mixin for pure Dart implementations of [SignatureAlgorithm]. mixin DartSignatureAlgorithmMixin implements SignatureAlgorithm { diff --git a/cryptography/lib/src/dart/ecdh.dart b/cryptography/lib/src/dart/ecdh.dart index 5a4c8b6..393a4d5 100644 --- a/cryptography/lib/src/dart/ecdh.dart +++ b/cryptography/lib/src/dart/ecdh.dart @@ -14,7 +14,7 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; /// [Ecdh] (P256, P384, P521) implementation in pure Dart. Currently it throws /// [UnimplementedError] if you try to use it. diff --git a/cryptography/lib/src/dart/ecdsa.dart b/cryptography/lib/src/dart/ecdsa.dart index 60acda9..4cfdb0b 100644 --- a/cryptography/lib/src/dart/ecdsa.dart +++ b/cryptography/lib/src/dart/ecdsa.dart @@ -14,7 +14,7 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; /// [Ecdsa] (P256, P384, P521) implementation in pure Dart. Currently it throws /// [UnimplementedError] if you try to use it. diff --git a/cryptography/lib/src/dart/ed25519.dart b/cryptography/lib/src/dart/ed25519.dart index ef055e6..f970146 100644 --- a/cryptography/lib/src/dart/ed25519.dart +++ b/cryptography/lib/src/dart/ed25519.dart @@ -15,7 +15,7 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../utils.dart'; import 'ed25519_impl.dart'; diff --git a/cryptography/lib/src/dart/hchacha20.dart b/cryptography/lib/src/dart/hchacha20.dart index f4ef13d..1caa7ba 100644 --- a/cryptography/lib/src/dart/hchacha20.dart +++ b/cryptography/lib/src/dart/hchacha20.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../_internal/bytes.dart'; import 'chacha20.dart'; diff --git a/cryptography/lib/src/dart/hkdf.dart b/cryptography/lib/src/dart/hkdf.dart index 9701df0..f385d1e 100644 --- a/cryptography/lib/src/dart/hkdf.dart +++ b/cryptography/lib/src/dart/hkdf.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; /// [Hkdf] implemented in pure Dart. /// diff --git a/cryptography/lib/src/dart/hmac.dart b/cryptography/lib/src/dart/hmac.dart index 06e41ba..b1c2ebc 100644 --- a/cryptography/lib/src/dart/hmac.dart +++ b/cryptography/lib/src/dart/hmac.dart @@ -14,8 +14,8 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; /// An implementation of [Hmac] in pure Dart. /// diff --git a/cryptography/lib/src/dart/pbkdf2.dart b/cryptography/lib/src/dart/pbkdf2.dart index b07f59e..7f29d4c 100644 --- a/cryptography/lib/src/dart/pbkdf2.dart +++ b/cryptography/lib/src/dart/pbkdf2.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; /// [Pbkdf2] implemented in pure Dart. /// diff --git a/cryptography/lib/src/dart/poly1305.dart b/cryptography/lib/src/dart/poly1305.dart index eceee33..165415d 100644 --- a/cryptography/lib/src/dart/poly1305.dart +++ b/cryptography/lib/src/dart/poly1305.dart @@ -14,8 +14,8 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:meta/meta.dart'; /// [Poly1305] implemented in pure Dart. diff --git a/cryptography/lib/src/dart/rsa_pss.dart b/cryptography/lib/src/dart/rsa_pss.dart index 7db6f6d..e1d7823 100644 --- a/cryptography/lib/src/dart/rsa_pss.dart +++ b/cryptography/lib/src/dart/rsa_pss.dart @@ -14,7 +14,7 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; /// [RsaPss] implementation in pure Dart. Currently it throws /// [UnimplementedError] if you try to use it. diff --git a/cryptography/lib/src/dart/rsa_ssa_pkcs1v15.dart b/cryptography/lib/src/dart/rsa_ssa_pkcs1v15.dart index 9c1a0f4..8a62fc4 100644 --- a/cryptography/lib/src/dart/rsa_ssa_pkcs1v15.dart +++ b/cryptography/lib/src/dart/rsa_ssa_pkcs1v15.dart @@ -14,7 +14,7 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; /// [DartRsaSsaPkcs1v15] implementation in pure Dart. Currently it throws /// [UnimplementedError] if you try to use it. diff --git a/cryptography/lib/src/dart/sha1.dart b/cryptography/lib/src/dart/sha1.dart index 9f75974..58ffab0 100644 --- a/cryptography/lib/src/dart/sha1.dart +++ b/cryptography/lib/src/dart/sha1.dart @@ -13,8 +13,8 @@ // limitations under the License. import 'package:crypto/crypto.dart' as other; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:meta/meta.dart'; import '_helpers.dart'; diff --git a/cryptography/lib/src/dart/sha256.dart b/cryptography/lib/src/dart/sha256.dart index bf0b3df..44acaee 100644 --- a/cryptography/lib/src/dart/sha256.dart +++ b/cryptography/lib/src/dart/sha256.dart @@ -14,10 +14,10 @@ import 'dart:typed_data'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:meta/meta.dart'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; import '../_internal/rotate.dart'; /// A pure Dart implementation of [Sha224]. diff --git a/cryptography/lib/src/dart/sha512.dart b/cryptography/lib/src/dart/sha512.dart index 26cc439..e20739c 100644 --- a/cryptography/lib/src/dart/sha512.dart +++ b/cryptography/lib/src/dart/sha512.dart @@ -13,8 +13,8 @@ // limitations under the License. import 'package:crypto/crypto.dart' as other; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:meta/meta.dart'; import '_helpers.dart'; diff --git a/cryptography/lib/src/dart/x25519.dart b/cryptography/lib/src/dart/x25519.dart index e7cfbd5..a1d86f9 100644 --- a/cryptography/lib/src/dart/x25519.dart +++ b/cryptography/lib/src/dart/x25519.dart @@ -15,8 +15,8 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'ed25519_impl.dart'; import 'x25519_impl.dart'; diff --git a/cryptography/lib/src/dart/xchacha20.dart b/cryptography/lib/src/dart/xchacha20.dart index 285b980..dcd5e6e 100644 --- a/cryptography/lib/src/dart/xchacha20.dart +++ b/cryptography/lib/src/dart/xchacha20.dart @@ -14,8 +14,8 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; /// [Xchacha20] implemented in pure Dart. /// diff --git a/cryptography/lib/src/helpers/delegating_classes.dart b/cryptography/lib/src/helpers/delegating_classes.dart index 8c351ce..015bddf 100644 --- a/cryptography/lib/src/helpers/delegating_classes.dart +++ b/cryptography/lib/src/helpers/delegating_classes.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; /// Delegating base class for [Cipher] implementations. abstract class DelegatingCipher implements Cipher { diff --git a/cryptography/lib/src/helpers/math.dart b/cryptography/lib/src/helpers/math.dart index 27f896a..4c68249 100644 --- a/cryptography/lib/src/helpers/math.dart +++ b/cryptography/lib/src/helpers/math.dart @@ -20,7 +20,7 @@ import 'dart:typed_data'; /// /// ## Example /// ``` -/// import 'package:cryptography/helpers.dart'; +/// import 'package:cryptography_plus/helpers.dart'; /// /// void main() { /// final bytes = [0,2,255]; diff --git a/cryptography/lib/src/helpers/random_bytes.dart b/cryptography/lib/src/helpers/random_bytes.dart index 6ce6a1a..b5dd0b1 100644 --- a/cryptography/lib/src/helpers/random_bytes.dart +++ b/cryptography/lib/src/helpers/random_bytes.dart @@ -15,9 +15,9 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/helpers.dart'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; export 'random_bytes_impl_default.dart' if (dart.library.html) 'random_bytes_impl_browser.dart'; diff --git a/cryptography/lib/src/helpers/random_bytes_impl_browser.dart b/cryptography/lib/src/helpers/random_bytes_impl_browser.dart index 72501cc..fc4d19d 100644 --- a/cryptography/lib/src/helpers/random_bytes_impl_browser.dart +++ b/cryptography/lib/src/helpers/random_bytes_impl_browser.dart @@ -16,7 +16,7 @@ import 'dart:html' as html; import 'dart:math'; import 'dart:typed_data'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; const _bit32 = 0x10000 * 0x10000; diff --git a/cryptography/lib/src/helpers/random_bytes_impl_default.dart b/cryptography/lib/src/helpers/random_bytes_impl_default.dart index 0cfebb3..66f0dc8 100644 --- a/cryptography/lib/src/helpers/random_bytes_impl_default.dart +++ b/cryptography/lib/src/helpers/random_bytes_impl_default.dart @@ -15,7 +15,7 @@ import 'dart:math'; import 'dart:typed_data'; -import '../../cryptography.dart'; +import '../../cryptography_plus.dart'; const _bit32 = 0x10000 * 0x10000; diff --git a/cryptography/pubspec.yaml b/cryptography/pubspec.yaml index 7fdafac..3d03501 100644 --- a/cryptography/pubspec.yaml +++ b/cryptography/pubspec.yaml @@ -1,12 +1,14 @@ -name: cryptography -version: 2.7.0 -homepage: https://github.com/dint-dev/cryptography +name: cryptography_plus +version: 2.7.1 +homepage: https://github.com/emz-hanauer/dart-cryptography description: Cryptographic algorithms for encryption, digital signatures, key agreement, authentication, and hashing. AES, Chacha20, ED25519, X25519, Argon2, and more. Good cross-platform support. +topics: + - crypto environment: - sdk: '>=3.1.0 <4.0.0' + sdk: ">=3.1.0 <4.0.0" dependencies: # @@ -15,7 +17,7 @@ dependencies: collection: ^1.17.0 crypto: ^3.0.3 ffi: ^2.1.0 - js: ^0.6.7 + js: ^0.7.1 meta: ^1.8.0 typed_data: ^1.3.0 diff --git a/cryptography/test/algorithms/aes_cbc_test.dart b/cryptography/test/algorithms/aes_cbc_test.dart index adf8e86..9a3bb4e 100644 --- a/cryptography/test/algorithms/aes_cbc_test.dart +++ b/cryptography/test/algorithms/aes_cbc_test.dart @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/aes_ctr_test.dart b/cryptography/test/algorithms/aes_ctr_test.dart index ba6fcdc..d22955d 100644 --- a/cryptography/test/algorithms/aes_ctr_test.dart +++ b/cryptography/test/algorithms/aes_ctr_test.dart @@ -14,9 +14,9 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/_internal/hex.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/_internal/hex.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/aes_gcm_test.dart b/cryptography/test/algorithms/aes_gcm_test.dart index 5ba1312..c204b80 100644 --- a/cryptography/test/algorithms/aes_gcm_test.dart +++ b/cryptography/test/algorithms/aes_gcm_test.dart @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/_internal/hex.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/_internal/hex.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/aes_impl_test.dart b/cryptography/test/algorithms/aes_impl_test.dart index e7cd2e3..97a7f24 100644 --- a/cryptography/test/algorithms/aes_impl_test.dart +++ b/cryptography/test/algorithms/aes_impl_test.dart @@ -14,10 +14,10 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/src/_internal/hex.dart'; -import 'package:cryptography/src/dart/aes_impl.dart' as aes; -import 'package:cryptography/src/dart/aes_impl_constants.dart' as constants; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/src/_internal/hex.dart'; +import 'package:cryptography_plus/src/dart/aes_impl.dart' as aes; +import 'package:cryptography_plus/src/dart/aes_impl_constants.dart' as constants; import 'package:test/expect.dart'; import 'package:test/scaffolding.dart'; diff --git a/cryptography/test/algorithms/argon2_test.dart b/cryptography/test/algorithms/argon2_test.dart index f1a949e..9671655 100644 --- a/cryptography/test/algorithms/argon2_test.dart +++ b/cryptography/test/algorithms/argon2_test.dart @@ -15,9 +15,9 @@ import 'dart:convert'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/_internal/hex.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/_internal/hex.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/blake2b_test.dart b/cryptography/test/algorithms/blake2b_test.dart index 2acce86..32d8ee4 100644 --- a/cryptography/test/algorithms/blake2b_test.dart +++ b/cryptography/test/algorithms/blake2b_test.dart @@ -15,8 +15,8 @@ import 'dart:convert'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/blake2s_test.dart b/cryptography/test/algorithms/blake2s_test.dart index bdc8ec3..a4b110f 100644 --- a/cryptography/test/algorithms/blake2s_test.dart +++ b/cryptography/test/algorithms/blake2s_test.dart @@ -15,8 +15,8 @@ import 'dart:convert'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/chacha20_poly1305_aead_test.dart b/cryptography/test/algorithms/chacha20_poly1305_aead_test.dart index 8c14c10..25a4aac 100644 --- a/cryptography/test/algorithms/chacha20_poly1305_aead_test.dart +++ b/cryptography/test/algorithms/chacha20_poly1305_aead_test.dart @@ -15,9 +15,9 @@ import 'dart:async'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/chacha20_test.dart b/cryptography/test/algorithms/chacha20_test.dart index b13f390..4ae7a69 100644 --- a/cryptography/test/algorithms/chacha20_test.dart +++ b/cryptography/test/algorithms/chacha20_test.dart @@ -14,9 +14,9 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/ed25519_impl_test.dart b/cryptography/test/algorithms/ed25519_impl_test.dart index f70a2a7..20250a2 100644 --- a/cryptography/test/algorithms/ed25519_impl_test.dart +++ b/cryptography/test/algorithms/ed25519_impl_test.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/src/dart/ed25519_impl.dart'; +import 'package:cryptography_plus/src/dart/ed25519_impl.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/generated/generate.go b/cryptography/test/algorithms/generated/generate.go index d3ecbab..774cb9c 100644 --- a/cryptography/test/algorithms/generated/generate.go +++ b/cryptography/test/algorithms/generated/generate.go @@ -34,8 +34,8 @@ func main() { fmt.Printf("Creating \"%v\".\n", absPath) w.WriteString("import 'dart:typed_data';\n") w.WriteString("\n") - w.WriteString("import 'package:cryptography/cryptography.dart';\n") - w.WriteString("import 'package:cryptography/src/utils.dart';\n") + w.WriteString("import 'package:cryptography_plus/cryptography_plus.dart';\n") + w.WriteString("import 'package:cryptography_plus/src/utils.dart';\n") w.WriteString("import 'package:test/test.dart';\n") w.WriteString("\n") w.WriteString("import '_generated.dart';\n") diff --git a/cryptography/test/algorithms/hchacha20_test.dart b/cryptography/test/algorithms/hchacha20_test.dart index c21a817..7cf1aa5 100644 --- a/cryptography/test/algorithms/hchacha20_test.dart +++ b/cryptography/test/algorithms/hchacha20_test.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/hmac_test.dart b/cryptography/test/algorithms/hmac_test.dart index 989f749..4a9d7c6 100644 --- a/cryptography/test/algorithms/hmac_test.dart +++ b/cryptography/test/algorithms/hmac_test.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/pbkdf2_test.dart b/cryptography/test/algorithms/pbkdf2_test.dart index ac6f633..40b2528 100644 --- a/cryptography/test/algorithms/pbkdf2_test.dart +++ b/cryptography/test/algorithms/pbkdf2_test.dart @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/poly1305_test.dart b/cryptography/test/algorithms/poly1305_test.dart index 6731426..f7c6f39 100644 --- a/cryptography/test/algorithms/poly1305_test.dart +++ b/cryptography/test/algorithms/poly1305_test.dart @@ -15,8 +15,8 @@ import 'dart:convert'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/rsa_pss_test.dart b/cryptography/test/algorithms/rsa_pss_test.dart index 63b6e61..bb301ab 100644 --- a/cryptography/test/algorithms/rsa_pss_test.dart +++ b/cryptography/test/algorithms/rsa_pss_test.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/rsa_ssa_pkcs1v15_test.dart b/cryptography/test/algorithms/rsa_ssa_pkcs1v15_test.dart index f15f5b0..36cd13b 100644 --- a/cryptography/test/algorithms/rsa_ssa_pkcs1v15_test.dart +++ b/cryptography/test/algorithms/rsa_ssa_pkcs1v15_test.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/sha256_test.dart b/cryptography/test/algorithms/sha256_test.dart index 9b79cbe..ec240a2 100644 --- a/cryptography/test/algorithms/sha256_test.dart +++ b/cryptography/test/algorithms/sha256_test.dart @@ -16,9 +16,9 @@ import 'dart:typed_data'; import 'package:collection/collection.dart'; import 'package:crypto/crypto.dart' as google_crypto; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/sha2_and_sha1_test.dart b/cryptography/test/algorithms/sha2_and_sha1_test.dart index 44667ef..0da8cd6 100644 --- a/cryptography/test/algorithms/sha2_and_sha1_test.dart +++ b/cryptography/test/algorithms/sha2_and_sha1_test.dart @@ -13,9 +13,9 @@ // limitations under the License. import 'package:crypto/crypto.dart' as google_crypto; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/algorithms/xchacha20_test.dart b/cryptography/test/algorithms/xchacha20_test.dart index 2f95c1f..1e412cc 100644 --- a/cryptography/test/algorithms/xchacha20_test.dart +++ b/cryptography/test/algorithms/xchacha20_test.dart @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/benchmark/argon2.dart b/cryptography/test/benchmark/argon2.dart index 246232a..0b53c8a 100644 --- a/cryptography/test/benchmark/argon2.dart +++ b/cryptography/test/benchmark/argon2.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'benchmark_helpers.dart'; diff --git a/cryptography/test/benchmark/cipher.dart b/cryptography/test/benchmark/cipher.dart index 57870e7..230c628 100644 --- a/cryptography/test/benchmark/cipher.dart +++ b/cryptography/test/benchmark/cipher.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'benchmark_helpers.dart'; diff --git a/cryptography/test/benchmark/cipher_with_gigabytes_of_input.dart b/cryptography/test/benchmark/cipher_with_gigabytes_of_input.dart index de425e7..d8e167e 100644 --- a/cryptography/test/benchmark/cipher_with_gigabytes_of_input.dart +++ b/cryptography/test/benchmark/cipher_with_gigabytes_of_input.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; Future main() async { final stopwatch = Stopwatch()..start(); diff --git a/cryptography/test/benchmark/hash.dart b/cryptography/test/benchmark/hash.dart index 1720008..9be65aa 100644 --- a/cryptography/test/benchmark/hash.dart +++ b/cryptography/test/benchmark/hash.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'benchmark_helpers.dart'; diff --git a/cryptography/test/benchmark/key_exchange.dart b/cryptography/test/benchmark/key_exchange.dart index 5cdbe52..c3ae09b 100644 --- a/cryptography/test/benchmark/key_exchange.dart +++ b/cryptography/test/benchmark/key_exchange.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'benchmark_helpers.dart'; diff --git a/cryptography/test/benchmark/pkbdf.dart b/cryptography/test/benchmark/pkbdf.dart index 6ef0e4a..022a9b8 100644 --- a/cryptography/test/benchmark/pkbdf.dart +++ b/cryptography/test/benchmark/pkbdf.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'benchmark_helpers.dart'; diff --git a/cryptography/test/benchmark/random.dart b/cryptography/test/benchmark/random.dart index fb086d4..1f03b59 100644 --- a/cryptography/test/benchmark/random.dart +++ b/cryptography/test/benchmark/random.dart @@ -14,7 +14,7 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'benchmark_helpers.dart'; diff --git a/cryptography/test/benchmark/signature.dart b/cryptography/test/benchmark/signature.dart index 883fed5..ed461b5 100644 --- a/cryptography/test/benchmark/signature.dart +++ b/cryptography/test/benchmark/signature.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'benchmark_helpers.dart'; diff --git a/cryptography/test/browser_cryptography_test.dart b/cryptography/test/browser_cryptography_test.dart index cb9ce06..7d2375a 100644 --- a/cryptography/test/browser_cryptography_test.dart +++ b/cryptography/test/browser_cryptography_test.dart @@ -13,14 +13,14 @@ // limitations under the License. @TestOn('chrome') -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/browser/aes_cbc.dart'; -import 'package:cryptography/src/browser/aes_ctr.dart'; -import 'package:cryptography/src/browser/aes_gcm.dart'; -import 'package:cryptography/src/browser/hash.dart'; -import 'package:cryptography/src/browser/hmac.dart'; -import 'package:cryptography/src/browser/pbkdf2.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/browser/aes_cbc.dart'; +import 'package:cryptography_plus/src/browser/aes_ctr.dart'; +import 'package:cryptography_plus/src/browser/aes_gcm.dart'; +import 'package:cryptography_plus/src/browser/hash.dart'; +import 'package:cryptography_plus/src/browser/hmac.dart'; +import 'package:cryptography_plus/src/browser/pbkdf2.dart'; import 'package:test/expect.dart'; import 'package:test/scaffolding.dart'; diff --git a/cryptography/test/cryptography_with_seeded_random_test.dart b/cryptography/test/cryptography_with_seeded_random_test.dart index 43cf3df..3cfa7a5 100644 --- a/cryptography/test/cryptography_with_seeded_random_test.dart +++ b/cryptography/test/cryptography_with_seeded_random_test.dart @@ -15,9 +15,9 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography/src/utils.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_plus/src/utils.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/ec_key_pair_extraction_test.dart b/cryptography/test/ec_key_pair_extraction_test.dart index 9bda560..0a70374 100644 --- a/cryptography/test/ec_key_pair_extraction_test.dart +++ b/cryptography/test/ec_key_pair_extraction_test.dart @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/ec_key_pair_test.dart b/cryptography/test/ec_key_pair_test.dart index 7386f47..c4bfd84 100644 --- a/cryptography/test/ec_key_pair_test.dart +++ b/cryptography/test/ec_key_pair_test.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/hash_test.dart b/cryptography/test/hash_test.dart index c9f273e..782cd7a 100644 --- a/cryptography/test/hash_test.dart +++ b/cryptography/test/hash_test.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/mac_test.dart b/cryptography/test/mac_test.dart index e436f79..c7a7b4b 100644 --- a/cryptography/test/mac_test.dart +++ b/cryptography/test/mac_test.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/padding_algorithm_test.dart b/cryptography/test/padding_algorithm_test.dart index 9eb60bd..23d1021 100644 --- a/cryptography/test/padding_algorithm_test.dart +++ b/cryptography/test/padding_algorithm_test.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/rsa_key_pair_test.dart b/cryptography/test/rsa_key_pair_test.dart index c539a79..fe3caf5 100644 --- a/cryptography/test/rsa_key_pair_test.dart +++ b/cryptography/test/rsa_key_pair_test.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/secret_box_test.dart b/cryptography/test/secret_box_test.dart index e530756..0fc7411 100644 --- a/cryptography/test/secret_box_test.dart +++ b/cryptography/test/secret_box_test.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/secret_key_test.dart b/cryptography/test/secret_key_test.dart index a420c03..860bafe 100644 --- a/cryptography/test/secret_key_test.dart +++ b/cryptography/test/secret_key_test.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/secure_random_test.dart b/cryptography/test/secure_random_test.dart index 09ecb5c..e740219 100644 --- a/cryptography/test/secure_random_test.dart +++ b/cryptography/test/secure_random_test.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/signature_test.dart b/cryptography/test/signature_test.dart index 2fe4187..e63a605 100644 --- a/cryptography/test/signature_test.dart +++ b/cryptography/test/signature_test.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/simple_key_pair_test.dart b/cryptography/test/simple_key_pair_test.dart index eaee26f..264528c 100644 --- a/cryptography/test/simple_key_pair_test.dart +++ b/cryptography/test/simple_key_pair_test.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/simple_public_key_test.dart b/cryptography/test/simple_public_key_test.dart index c2d96b4..758d300 100644 --- a/cryptography/test/simple_public_key_test.dart +++ b/cryptography/test/simple_public_key_test.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography/test/utils_test.dart b/cryptography/test/utils_test.dart index 4d0157b..90729ad 100644 --- a/cryptography/test/utils_test.dart +++ b/cryptography/test/utils_test.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/helpers.dart'; import 'package:test/test.dart'; void main() { diff --git a/cryptography_flutter/CHANGELOG.md b/cryptography_flutter/CHANGELOG.md index 62e3543..2968776 100644 --- a/cryptography_flutter/CHANGELOG.md +++ b/cryptography_flutter/CHANGELOG.md @@ -1,81 +1,98 @@ +## 2.3.4 + +- **fix**(iOS, MacOS): compilation issue, rename podspec +- **fix**(Android): Remove registrar build error on v1 plugin + +## 2.3.3 + +**Release of package under new name** + +- **fix**: AGP 8.x compatibility + Flutter 3.24 + ## 2.3.2 -* Improves documentation. + +- Improves documentation. ## 2.3.1 -* Raises Dart SDK minimum to 3.1.0 and other small changes related to dependency constraints. -* Fixes type inference warnings by Swift compiler. + +- Raises Dart SDK minimum to 3.1.0 and other small changes related to dependency constraints. +- Fixes type inference warnings by Swift compiler. ## 2.3.0 -* Adds support for algorithms. In this version, the following operating system API adapters pass + +- Adds support for algorithms. In this version, the following operating system API adapters pass tests: - * Android: - * FlutterAesGcm - * FlutterChacha20.poly1305Aead() - * FlutterHmac.sha1() - * FlutterHmac.sha224() - * FlutterHmac.sha256() - * FlutterHmac.sha384() - * FlutterHmac.sha512() - * FlutterPbkdf2() - * Apple operating systems: - * FlutterAesGcm - * FlutterChacha20.poly1305Aead() - * FlutterEd25519() - * FlutterEcdh.p256() - * FlutterEcdh.p384() - * FlutterEcdh.p521() - * FlutterEcdsa.p256() - * FlutterEcdsa.p384() - * FlutterEcdsa.p521() - * FlutterHmac.sha256() - * FlutterHmac.sha512() - * FlutterX25519() -* Requires "package:cryptography" 2.5.0, which has enough DER encoding/decoding support for us to + - Android: + - FlutterAesGcm + - FlutterChacha20.poly1305Aead() + - FlutterHmac.sha1() + - FlutterHmac.sha224() + - FlutterHmac.sha256() + - FlutterHmac.sha384() + - FlutterHmac.sha512() + - FlutterPbkdf2() + - Apple operating systems: + - FlutterAesGcm + - FlutterChacha20.poly1305Aead() + - FlutterEd25519() + - FlutterEcdh.p256() + - FlutterEcdh.p384() + - FlutterEcdh.p521() + - FlutterEcdsa.p256() + - FlutterEcdsa.p384() + - FlutterEcdsa.p521() + - FlutterHmac.sha256() + - FlutterHmac.sha512() + - FlutterX25519() +- Requires "package:cryptography" 2.5.0, which has enough DER encoding/decoding support for us to use Apple's CryptoKit ECDH/ECDSA functions. -* Adds support for reading names of crypto providers in Android. -* Adds more tests. +- Adds support for reading names of crypto providers in Android. +- Adds more tests. ## 2.2.0 -* Makes the package use the new convention for enabling Flutter plugins. You no longer need to call + +- Makes the package use the new convention for enabling Flutter plugins. You no longer need to call `CryptographyFlutter.enable()` in your `main` function. -* Improves documentation. +- Improves documentation. ## 2.1.1 -* Bumps Kotlin Gradle plugin version. + +- Bumps Kotlin Gradle plugin version. ## 2.1.0 -* Many, major bug fixes. -* Some breaking changes to the API, but we decided not to increment the major version because we + +- Many, major bug fixes. +- Some breaking changes to the API, but we decided not to increment the major version because we don't expect them to affect many developers (while we do want the bug fixes to reach everyone who uses the package). -* Many new features. -* We have a completely new test suite that ensures correctness and also reports performance with +- Many new features. +- We have a completely new test suite that ensures correctness and also reports performance with different input sizes. ## 2.0.2 -* Fixes ["cryptography_flutter: Fix propagating error to Flutter + fix fallback to non-plugin encrypt/decrypt"](https://github.com/dint-dev/cryptography/pull/76) -* Prints a debug message if a fallback to a Dart implementation happens because of an error. -* Updates dependency constraints and linting rules. +- Fixes ["cryptography_flutter: Fix propagating error to Flutter + fix fallback to non-plugin encrypt/decrypt"](https://github.com/emz-hanauer/dart-cryptography/pull/76) +- Prints a debug message if a fallback to a Dart implementation happens because of an error. +- Updates dependency constraints and linting rules. ## 2.0.1 -* Improves behavior in browsers. -* Improves documentation. +- Improves behavior in browsers. +- Improves documentation. ## 2.0.0 -* Finishes null safety migration. +- Finishes null safety migration. ## 2.0.0-nullsafety.1 -* Fixes SDK and dependency constraints. +- Fixes SDK and dependency constraints. ## 2.0.0-nullsafety.0 -* Upgrades to _package:cryptography_ version 2.x. -* Adds supports for AES and ChaCha20 in Android. +- Upgrades to _package:cryptography_ version 2.x. +- Adds supports for AES and ChaCha20 in Android. ## 1.0.0 -* Initial version +- Initial version diff --git a/cryptography_flutter/README.md b/cryptography_flutter/README.md index 5ee5c23..8b3b5c4 100644 --- a/cryptography_flutter/README.md +++ b/cryptography_flutter/README.md @@ -1,47 +1,50 @@ -[![Pub Package](https://img.shields.io/pub/v/cryptography_flutter.svg)](https://pub.dev/packages/cryptography_flutter) -[![Github Actions CI](https://github.com/dint-dev/cryptography/workflows/Dart%20CI/badge.svg)](https://github.com/dint-dev/cryptography/actions) +[![Pub Package](https://img.shields.io/pub/v/cryptography_flutter_plus.svg)](https://pub.dev/packages/cryptography_flutter_plus) +[![Github Actions CI](https://github.com/emz-hanauer/dart-cryptography/workflows/Dart%20CI/badge.svg)](https://github.com/emz-hanauer/dart-cryptography/actions) # Overview This is a Flutter plugin that -enables [pub.dev/packages/cryptography](https://pub.dev/packages/cryptography) +enables [pub.dev/packages/cryptography_plus](https://pub.dev/packages/cryptography_plus) to use native APIs of Android, iOS, and Mac OS X. -Maintained by [gohilla.com](https://gohilla.com). Licensed under the [Apache License 2.0](LICENSE). +> Package was maintained by [gohilla.com](https://gohilla.com). Repository was moved to [emz-hanauer/dart-cryptography](https://github.com/emz-hanauer/dart-cryptography) due to lack of maintenance. + +Licensed under the [Apache License 2.0](LICENSE). ## Why? -* __Secure__ - * Operating system APIs are preferable from security point of view. -* __Performant__. - * Operating system APIs are up to 100 times faster than pure Dart implementations. -* __Cross-platform__. - * The implementations fall back to "package:cryptography" implementations when operating system + +- **Secure** + - Operating system APIs are preferable from security point of view. +- **Performant**. + - Operating system APIs are up to 100 times faster than pure Dart implementations. +- **Cross-platform**. + - The implementations fall back to "package:cryptography" implementations when operating system APIs can't be used. ## General behavior -The package is tested with [cryptography_test](https://pub.dev/packages/cryptography_test). +The package is tested with [cryptography_test](https://github.com/emz-hanauer/dart-cryptography/cryptography_test). This package contains two kinds of classes: -* Classes such - as [FlutterChacha20](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/FlutterChacha20-class.html) +- Classes such + as [FlutterChacha20](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/FlutterChacha20-class.html) use operating system APIs in Android / iOS / Mac OS X. If the operating system does not support the algorithm, the background implementation (such as `BackgroundChacha20`) or a pure Dart implementation (such - as [DartChacha20](https://pub.dev/documentation/cryptography/latest/cryptography.dart/DartChacha20-class.html)) + as [DartChacha20](https://pub.dev/documentation/cryptography_plus/latest/cryptography_plus.dart/DartChacha20-class.html)) when available. -* Classes such - as [BackgroundChacha20](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/BackgroundChacha20-class.html) +- Classes such + as [BackgroundChacha20](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/BackgroundChacha20-class.html) move lengthy computations to a background isolate by using [compute](https://api.flutter.dev/flutter/foundation/compute-constant.html) function in Flutter SDK. -* Both compute very small inputs in the same isolate if the overhead of message passing does not +- Both compute very small inputs in the same isolate if the overhead of message passing does not make sense. For example, if you encrypt a 16 byte message, the computation is done in the same isolate. -* Too large inputs are also computed in the same isolate (because you probably should not +- Too large inputs are also computed in the same isolate (because you probably should not allocate a gigabyte cross-isolate message on a mobile phone). -* We also have a queue to prevent memory exhaustion that could happen if you send lots of requests +- We also have a queue to prevent memory exhaustion that could happen if you send lots of requests concurrently. # Getting started @@ -50,7 +53,7 @@ In _pubspec.yaml_: ```yaml dependencies: - cryptography: ^2.7.0 + cryptography_plus: ^2.7.0 cryptography_flutter: ^2.3.2 ``` @@ -63,59 +66,59 @@ at [pub.dev/packages/cryptography](https://pub.dev/packages/cryptography). ## AES-GCM -[FlutterAesGcm](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/FlutterAesGcm-class.html) +[FlutterAesGcm](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/FlutterAesGcm-class.html) is used in Android, iOS, and Mac OS X. Our benchmarks have shown up to ~50 times better performance than -[DartAesGcm](https://pub.dev/documentation/cryptography/latest/cryptography.dart/DartAesGcm-class.html) +[DartAesGcm](https://pub.dev/documentation/cryptography_plus/latest/cryptography_plus.dart/DartAesGcm-class.html) (the pure Dart implementation). -[BackgroundAesGcm](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/BackgroundAesGcm-class.html) +[BackgroundAesGcm](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/BackgroundAesGcm-class.html) is used in Windows and Linux for inputs that are large enough. ## ChaCha20-Poly1305-AEAD -[FlutterChacha20](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/FlutterChacha20-class.html) +[FlutterChacha20](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/FlutterChacha20-class.html) is available for Android and Apple operating systems. Our benchmarks have shown up to ~50 times better performance than -[DartChacha20](https://pub.dev/documentation/cryptography/latest/cryptography.dart/DartChacha20-class.html) +[DartChacha20](https://pub.dev/documentation/cryptography_plus/latest/cryptography_plus.dart/DartChacha20-class.html) (the pure Dart implementation). -[BackgroundChacha20](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/BackgroundChacha20-class.html) +[BackgroundChacha20](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/BackgroundChacha20-class.html) is used in Windows and Linux for inputs that are large enough. ## NIST ECDH / ECDSA -[FlutterEcdh](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/FlutterEcdh-class.html) -and [FlutterEcdsa](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/FlutterEcdsa-class.html) +[FlutterEcdh](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/FlutterEcdh-class.html) +and [FlutterEcdsa](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/FlutterEcdsa-class.html) are available for Apple operating systems. ## Ed25519 -[FlutterEd25519](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/FlutterEd25519-class.html) -and [BackgroundEd25519](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/BackgroundEd25519-class.html) +[FlutterEd25519](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/FlutterEd25519-class.html) +and [BackgroundEd25519](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/BackgroundEd25519-class.html) are available for Apple operating systems. ## X25519 -[FlutterX25519](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/FlutterX25519-class.html) -and [BackgroundX25519](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/BackgroundX25519-class.html) +[FlutterX25519](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/FlutterX25519-class.html) +and [BackgroundX25519](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/BackgroundX25519-class.html) are available for Apple operating systems. ## HMAC -[FlutterHmac](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/FlutterHmac-class.html) +[FlutterHmac](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/FlutterHmac-class.html) is available for Android.. ## PBKDF2 -[FlutterPbkdf2](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/FlutterPbkdf2-class.html) +[FlutterPbkdf2](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/FlutterPbkdf2-class.html) is available for Android. -[BackgroundPbkdf2](https://pub.dev/documentation/cryptography_flutter/latest/cryptography_flutter/BackgroundPbkdf2-class.html) +[BackgroundPbkdf2](https://pub.dev/documentation/cryptography_flutter_plus/latest/cryptography_flutter/BackgroundPbkdf2-class.html) is used in Apple operating systems, Windows and Linux. ## Links -* [Github project](https://github.com/dint-dev/cryptography) -* [Issue tracker](https://github.com/dint-dev/cryptography/issues) -* [Pub package](https://pub.dev/packages/cryptography_flutter) -* [API reference](https://pub.dev/documentation/cryptography_flutter/latest/) +- [Github project](https://github.com/emz-hanauer/dart-cryptography) +- [Issue tracker](https://github.com/emz-hanauer/dart-cryptography/issues) +- [Pub package](https://pub.dev/packages/cryptography_flutter_plus) +- [API reference](https://pub.dev/documentation/cryptography_flutter_plus/latest/) diff --git a/cryptography_flutter/android/build.gradle b/cryptography_flutter/android/build.gradle index 6b37889..1d7214f 100644 --- a/cryptography_flutter/android/build.gradle +++ b/cryptography_flutter/android/build.gradle @@ -2,15 +2,15 @@ group 'dev.dint.cryptography_flutter' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = "1.7.10" repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath("com.android.tools.build:gradle:8.5.0") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") } } @@ -25,8 +25,10 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 31 - + if (project.android.hasProperty("namespace")) { + namespace = "dev.dint.cryptography_flutter" + } + compileSdk 34 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -43,9 +45,9 @@ android { defaultConfig { minSdkVersion 21 } -} -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation "androidx.security:security-crypto:1.1.0-alpha05" -} \ No newline at end of file + dependencies { + testImplementation("org.jetbrains.kotlin:kotlin-test") + testImplementation("org.mockito:mockito-core:5.0.0") + } +} diff --git a/cryptography_flutter/android/gradle.properties b/cryptography_flutter/android/gradle.properties index 38c8d45..598d13f 100644 --- a/cryptography_flutter/android/gradle.properties +++ b/cryptography_flutter/android/gradle.properties @@ -1,4 +1,3 @@ -org.gradle.jvmargs=-Xmx1536M -android.enableR8=true +org.gradle.jvmargs=-Xmx4G android.useAndroidX=true android.enableJetifier=true diff --git a/cryptography_flutter/android/gradlew b/cryptography_flutter/android/gradlew index 9d82f78..1aa94a4 100755 --- a/cryptography_flutter/android/gradlew +++ b/cryptography_flutter/android/gradlew @@ -1,74 +1,127 @@ -#!/usr/bin/env bash +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum -warn ( ) { +warn () { echo "$*" -} +} >&2 -die ( ) { +die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -77,84 +130,120 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/cryptography_flutter/android/gradlew.bat b/cryptography_flutter/android/gradlew.bat index aec9973..6689b85 100644 --- a/cryptography_flutter/android/gradlew.bat +++ b/cryptography_flutter/android/gradlew.bat @@ -1,4 +1,20 @@ -@if "%DEBUG%" == "" @echo off +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -8,20 +24,24 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -35,7 +55,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -45,44 +65,26 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/cryptography_flutter/android/src/main/AndroidManifest.xml b/cryptography_flutter/android/src/main/AndroidManifest.xml index ffa4097..969e3f4 100644 --- a/cryptography_flutter/android/src/main/AndroidManifest.xml +++ b/cryptography_flutter/android/src/main/AndroidManifest.xml @@ -1,2 +1,3 @@ - - + + \ No newline at end of file diff --git a/cryptography_flutter/android/src/main/kotlin/dev/dint/cryptography_flutter/CryptographyFlutterPlugin.kt b/cryptography_flutter/android/src/main/kotlin/dev/dint/cryptography_flutter/CryptographyFlutterPlugin.kt index f37d14e..c920921 100644 --- a/cryptography_flutter/android/src/main/kotlin/dev/dint/cryptography_flutter/CryptographyFlutterPlugin.kt +++ b/cryptography_flutter/android/src/main/kotlin/dev/dint/cryptography_flutter/CryptographyFlutterPlugin.kt @@ -21,7 +21,6 @@ import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.Result -import io.flutter.plugin.common.PluginRegistry.Registrar import java.math.BigInteger import java.security.* import java.security.interfaces.* diff --git a/cryptography_flutter/example/ios/Podfile.lock b/cryptography_flutter/example/ios/Podfile.lock index 14ff258..ede708e 100644 --- a/cryptography_flutter/example/ios/Podfile.lock +++ b/cryptography_flutter/example/ios/Podfile.lock @@ -4,17 +4,17 @@ PODS: - Flutter (1.0.0) DEPENDENCIES: - - cryptography_flutter (from `.symlinks/plugins/cryptography_flutter/ios`) + - cryptography_flutter_plus_plus (from `.symlinks/plugins/cryptography_flutter/ios`) - Flutter (from `Flutter`) EXTERNAL SOURCES: - cryptography_flutter: + cryptography_flutter_plus: :path: ".symlinks/plugins/cryptography_flutter/ios" Flutter: :path: Flutter SPEC CHECKSUMS: - cryptography_flutter: 381bdacc984abcfbe3ca45ef7c76566ff061614c + cryptography_flutter_plus: 381bdacc984abcfbe3ca45ef7c76566ff061614c Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 diff --git a/cryptography_flutter/example/lib/main.dart b/cryptography_flutter/example/lib/main.dart index 772db1f..bf54771 100644 --- a/cryptography_flutter/example/lib/main.dart +++ b/cryptography_flutter/example/lib/main.dart @@ -14,7 +14,7 @@ import 'dart:convert'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:flutter/material.dart'; void main() { diff --git a/cryptography_flutter/example/macos/Podfile.lock b/cryptography_flutter/example/macos/Podfile.lock index bdbe013..7996af2 100644 --- a/cryptography_flutter/example/macos/Podfile.lock +++ b/cryptography_flutter/example/macos/Podfile.lock @@ -4,17 +4,17 @@ PODS: - FlutterMacOS (1.0.0) DEPENDENCIES: - - cryptography_flutter (from `Flutter/ephemeral/.symlinks/plugins/cryptography_flutter/macos`) + - cryptography_flutter_plus (from `Flutter/ephemeral/.symlinks/plugins/cryptography_flutter/macos`) - FlutterMacOS (from `Flutter/ephemeral`) EXTERNAL SOURCES: - cryptography_flutter: + cryptography_flutter_plus: :path: Flutter/ephemeral/.symlinks/plugins/cryptography_flutter/macos FlutterMacOS: :path: Flutter/ephemeral SPEC CHECKSUMS: - cryptography_flutter: c9fa581b52e6fe19475432b6f44489c387f61e19 + cryptography_flutter_plus: c9fa581b52e6fe19475432b6f44489c387f61e19 FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 diff --git a/cryptography_flutter/example/pubspec.yaml b/cryptography_flutter/example/pubspec.yaml index be9c8dc..1522f62 100644 --- a/cryptography_flutter/example/pubspec.yaml +++ b/cryptography_flutter/example/pubspec.yaml @@ -1,14 +1,14 @@ name: example description: A new Flutter project. -publish_to: 'none' +publish_to: "none" version: 1.0.0+1 environment: - sdk: '>=2.19.2 <3.0.0' + sdk: ">=2.19.2 <3.0.0" dependencies: - cryptography: - cryptography_flutter: + cryptography_plus: + cryptography_flutter_plus: flutter: sdk: flutter cupertino_icons: ^1.0.2 @@ -22,7 +22,7 @@ flutter: uses-material-design: true dependency_overrides: - cryptography: + cryptography_plus: path: ../../cryptography - cryptography_flutter: - path: ../ \ No newline at end of file + cryptography_flutter_plus: + path: ../ diff --git a/cryptography_flutter/ios/cryptography_flutter.podspec b/cryptography_flutter/ios/cryptography_flutter_plus.podspec similarity index 87% rename from cryptography_flutter/ios/cryptography_flutter.podspec rename to cryptography_flutter/ios/cryptography_flutter_plus.podspec index 93dfd66..c1fe8ce 100644 --- a/cryptography_flutter/ios/cryptography_flutter.podspec +++ b/cryptography_flutter/ios/cryptography_flutter_plus.podspec @@ -3,13 +3,13 @@ # Run `pod lib lint cryptography_flutter.podspec' to validate before publishing. # Pod::Spec.new do |s| - s.name = 'cryptography_flutter' + s.name = 'cryptography_flutter_plus' s.version = '0.2.0' s.summary = 'A cryptography plugin for Flutter.' s.description = <<-DESC A new flutter plugin project. DESC - s.homepage = 'http://github.com/dint-dev/cryptography' + s.homepage = 'http://github.com/emz-hanauer/dart-cryptography' s.license = { :file => '../LICENSE' } s.author = { 'Gohilla' => 'opensource@gohilla.com' } s.source = { :path => '.' } diff --git a/cryptography_flutter/lib/android.dart b/cryptography_flutter/lib/android.dart index eef9884..7ec3162 100644 --- a/cryptography_flutter/lib/android.dart +++ b/cryptography_flutter/lib/android.dart @@ -1,5 +1,5 @@ /// Helpers for Android. -library cryptography_flutter.android; +library cryptography_flutter_plus.android; import 'package:flutter/services.dart'; diff --git a/cryptography_flutter/lib/cryptography_flutter.dart b/cryptography_flutter/lib/cryptography_flutter_plus.dart similarity index 93% rename from cryptography_flutter/lib/cryptography_flutter.dart rename to cryptography_flutter/lib/cryptography_flutter_plus.dart index ba3e1f5..0f42346 100644 --- a/cryptography_flutter/lib/cryptography_flutter.dart +++ b/cryptography_flutter/lib/cryptography_flutter_plus.dart @@ -15,9 +15,9 @@ /// An optimized version of [package:cryptography](https://pub.dev/packages/cryptography). /// /// See [FlutterCryptography] for usage instructions. -library cryptography_flutter; +library cryptography_flutter_plus; -import 'package:cryptography_flutter/cryptography_flutter.dart'; +import 'package:cryptography_flutter_plus/cryptography_flutter_plus.dart'; export 'src/background/background_aes_gcm.dart'; export 'src/background/background_chacha20.dart'; diff --git a/cryptography_flutter/lib/src/_internal.dart b/cryptography_flutter/lib/src/_internal.dart index 47c279a..836912e 100644 --- a/cryptography_flutter/lib/src/_internal.dart +++ b/cryptography_flutter/lib/src/_internal.dart @@ -17,7 +17,7 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; -import '../cryptography_flutter.dart'; +import '../cryptography_flutter_plus.dart'; import '_internal_impl_non_browser.dart' if (dart.library.html) '_internal_impl_browser.dart'; diff --git a/cryptography_flutter/lib/src/background/background_aes_gcm.dart b/cryptography_flutter/lib/src/background/background_aes_gcm.dart index 1f2642a..8840a02 100644 --- a/cryptography_flutter/lib/src/background/background_aes_gcm.dart +++ b/cryptography_flutter/lib/src/background/background_aes_gcm.dart @@ -14,11 +14,11 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:flutter/foundation.dart'; -import '../../cryptography_flutter.dart'; +import '../../cryptography_flutter_plus.dart'; /// [AesGcm] that's optimized to use [compute]. class BackgroundAesGcm extends AesGcm with BackgroundCipherMixin { diff --git a/cryptography_flutter/lib/src/background/background_chacha20.dart b/cryptography_flutter/lib/src/background/background_chacha20.dart index ce8c0e8..b82c6b5 100644 --- a/cryptography_flutter/lib/src/background/background_chacha20.dart +++ b/cryptography_flutter/lib/src/background/background_chacha20.dart @@ -14,11 +14,11 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:flutter/foundation.dart'; -import '../../cryptography_flutter.dart'; +import '../../cryptography_flutter_plus.dart'; /// [Chacha20.poly1305Aead] that's optimized to use [compute]. class BackgroundChacha extends Chacha20 with BackgroundCipherMixin { diff --git a/cryptography_flutter/lib/src/background/background_cipher.dart b/cryptography_flutter/lib/src/background/background_cipher.dart index ac23ca9..8fc4f67 100644 --- a/cryptography_flutter/lib/src/background/background_cipher.dart +++ b/cryptography_flutter/lib/src/background/background_cipher.dart @@ -14,8 +14,8 @@ import 'dart:async'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography_flutter/cryptography_flutter.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_flutter_plus/cryptography_flutter_plus.dart'; import 'package:flutter/foundation.dart'; import '../_internal.dart'; diff --git a/cryptography_flutter/lib/src/background/background_pbkdf2.dart b/cryptography_flutter/lib/src/background/background_pbkdf2.dart index 4a94819..a50e3c4 100644 --- a/cryptography_flutter/lib/src/background/background_pbkdf2.dart +++ b/cryptography_flutter/lib/src/background/background_pbkdf2.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:flutter/foundation.dart'; /// [Pbkdf2] that's optimized to use [compute]. diff --git a/cryptography_flutter/lib/src/flutter/flutter_aes_gcm.dart b/cryptography_flutter/lib/src/flutter/flutter_aes_gcm.dart index 4780d52..eb3812e 100644 --- a/cryptography_flutter/lib/src/flutter/flutter_aes_gcm.dart +++ b/cryptography_flutter/lib/src/flutter/flutter_aes_gcm.dart @@ -14,10 +14,10 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:flutter/services.dart'; -import '../../cryptography_flutter.dart'; +import '../../cryptography_flutter_plus.dart'; import '../_internal.dart'; /// [AesGcm] that uses platform APIs in Android, iOS, and Mac OS X. diff --git a/cryptography_flutter/lib/src/flutter/flutter_chacha20.dart b/cryptography_flutter/lib/src/flutter/flutter_chacha20.dart index a906136..4c7540e 100644 --- a/cryptography_flutter/lib/src/flutter/flutter_chacha20.dart +++ b/cryptography_flutter/lib/src/flutter/flutter_chacha20.dart @@ -14,10 +14,10 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; -import '../../cryptography_flutter.dart'; +import '../../cryptography_flutter_plus.dart'; import '../_internal.dart'; /// [Chacha20] that uses platform APIs in Android, iOS, and Mac OS X. diff --git a/cryptography_flutter/lib/src/flutter/flutter_cipher.dart b/cryptography_flutter/lib/src/flutter/flutter_cipher.dart index b82e9d4..74811bd 100644 --- a/cryptography_flutter/lib/src/flutter/flutter_cipher.dart +++ b/cryptography_flutter/lib/src/flutter/flutter_cipher.dart @@ -14,11 +14,11 @@ import 'dart:async'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; -import '../../cryptography_flutter.dart'; +import '../../cryptography_flutter_plus.dart'; import '../_flutter_cryptography_implementation.dart'; import '../_internal.dart'; diff --git a/cryptography_flutter/lib/src/flutter/flutter_ecdh.dart b/cryptography_flutter/lib/src/flutter/flutter_ecdh.dart index fec59dc..a70f8bc 100644 --- a/cryptography_flutter/lib/src/flutter/flutter_ecdh.dart +++ b/cryptography_flutter/lib/src/flutter/flutter_ecdh.dart @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; -import '../../cryptography_flutter.dart'; +import '../../cryptography_flutter_plus.dart'; import '../_flutter_cryptography_implementation.dart'; import '../_internal.dart'; @@ -59,7 +59,7 @@ class FlutterEcdh extends Ecdh implements PlatformCryptographicAlgorithm { @override bool get isSupportedPlatform => - FlutterCryptography.isPluginPresent && isCupertino; + FlutterCryptography.isPluginPresent && (isAndroid || isCupertino); String get _curveName { switch (keyPairType) { diff --git a/cryptography_flutter/lib/src/flutter/flutter_ecdsa.dart b/cryptography_flutter/lib/src/flutter/flutter_ecdsa.dart index 67e8ac2..d5501fc 100644 --- a/cryptography_flutter/lib/src/flutter/flutter_ecdsa.dart +++ b/cryptography_flutter/lib/src/flutter/flutter_ecdsa.dart @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:flutter/services.dart'; -import '../../cryptography_flutter.dart'; +import '../../cryptography_flutter_plus.dart'; import '../_flutter_cryptography_implementation.dart'; import '../_internal.dart'; diff --git a/cryptography_flutter/lib/src/flutter/flutter_ed25519.dart b/cryptography_flutter/lib/src/flutter/flutter_ed25519.dart index 0f2145c..91ab6af 100644 --- a/cryptography_flutter/lib/src/flutter/flutter_ed25519.dart +++ b/cryptography_flutter/lib/src/flutter/flutter_ed25519.dart @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/helpers.dart'; import 'package:flutter/foundation.dart'; -import '../../cryptography_flutter.dart'; +import '../../cryptography_flutter_plus.dart'; import '../_flutter_cryptography_implementation.dart'; import '../_internal.dart'; diff --git a/cryptography_flutter/lib/src/flutter/flutter_hmac.dart b/cryptography_flutter/lib/src/flutter/flutter_hmac.dart index 956f696..f9cb3af 100644 --- a/cryptography_flutter/lib/src/flutter/flutter_hmac.dart +++ b/cryptography_flutter/lib/src/flutter/flutter_hmac.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import '../_flutter_cryptography_implementation.dart'; import '../_internal.dart'; diff --git a/cryptography_flutter/lib/src/flutter/flutter_pbkdf2.dart b/cryptography_flutter/lib/src/flutter/flutter_pbkdf2.dart index b4b21e8..7267cfc 100644 --- a/cryptography_flutter/lib/src/flutter/flutter_pbkdf2.dart +++ b/cryptography_flutter/lib/src/flutter/flutter_pbkdf2.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../_internal.dart'; diff --git a/cryptography_flutter/lib/src/flutter/flutter_rsa_pss.dart b/cryptography_flutter/lib/src/flutter/flutter_rsa_pss.dart index 8c6790a..07115cb 100644 --- a/cryptography_flutter/lib/src/flutter/flutter_rsa_pss.dart +++ b/cryptography_flutter/lib/src/flutter/flutter_rsa_pss.dart @@ -15,8 +15,8 @@ import 'dart:convert'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/helpers.dart'; import '../_flutter_cryptography_implementation.dart'; import '../_internal.dart'; diff --git a/cryptography_flutter/lib/src/flutter/flutter_rsa_ssa_pkcs1v15.dart b/cryptography_flutter/lib/src/flutter/flutter_rsa_ssa_pkcs1v15.dart index ae1f70f..32f0f93 100644 --- a/cryptography_flutter/lib/src/flutter/flutter_rsa_ssa_pkcs1v15.dart +++ b/cryptography_flutter/lib/src/flutter/flutter_rsa_ssa_pkcs1v15.dart @@ -15,8 +15,8 @@ import 'dart:convert'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/helpers.dart'; import '../_flutter_cryptography_implementation.dart'; import '../_internal.dart'; diff --git a/cryptography_flutter/lib/src/flutter/flutter_x25519.dart b/cryptography_flutter/lib/src/flutter/flutter_x25519.dart index e61a8eb..80a2681 100644 --- a/cryptography_flutter/lib/src/flutter/flutter_x25519.dart +++ b/cryptography_flutter/lib/src/flutter/flutter_x25519.dart @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/helpers.dart'; import 'package:flutter/foundation.dart'; -import '../../cryptography_flutter.dart'; +import '../../cryptography_flutter_plus.dart'; import '../_flutter_cryptography_implementation.dart'; import '../_internal.dart'; diff --git a/cryptography_flutter/lib/src/flutter_cryptography.dart b/cryptography_flutter/lib/src/flutter_cryptography.dart index 6188787..37e24a5 100644 --- a/cryptography_flutter/lib/src/flutter_cryptography.dart +++ b/cryptography_flutter/lib/src/flutter_cryptography.dart @@ -14,19 +14,19 @@ import 'dart:math'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography_flutter/src/flutter/flutter_hmac.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_flutter_plus/src/flutter/flutter_hmac.dart'; import 'package:flutter/foundation.dart'; -import '../cryptography_flutter.dart'; +import '../cryptography_flutter_plus.dart'; import '_internal.dart'; /// An implementation [Cryptography] that uses native operating system APIs. /// /// ## Getting started /// ``` -/// import 'package:cryptography_flutter/cryptography_flutter.dart' show FlutterCryptography; +/// import 'package:cryptography_flutter_plus/cryptography_flutter_plus.dart' show FlutterCryptography; /// /// void main() { /// // Enables use of Flutter cryptography. diff --git a/cryptography_flutter/macos/cryptography_flutter.podspec b/cryptography_flutter/macos/cryptography_flutter_plus.podspec similarity index 84% rename from cryptography_flutter/macos/cryptography_flutter.podspec rename to cryptography_flutter/macos/cryptography_flutter_plus.podspec index 8f9b8cb..e1ea1f3 100644 --- a/cryptography_flutter/macos/cryptography_flutter.podspec +++ b/cryptography_flutter/macos/cryptography_flutter_plus.podspec @@ -3,13 +3,13 @@ # Run `pod lib lint cryptography_flutter.podspec' to validate before publishing. # Pod::Spec.new do |s| - s.name = 'cryptography_flutter' + s.name = 'cryptography_flutter_plus' s.version = '0.2.0' s.summary = 'A cryptography plugin for Flutter.' s.description = <<-DESC A new flutter plugin project. DESC - s.homepage = 'http://github.com/dint-dev/cryptography' + s.homepage = 'http://github.com/emz-hanauer/dart-cryptography' s.license = { :file => '../LICENSE' } s.author = { 'Gohilla' => 'opensource@gohilla.com' } s.source = { :path => '.' } @@ -19,4 +19,4 @@ A new flutter plugin project. s.platform = :osx, '10.11' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.swift_version = '5.0' -end \ No newline at end of file +end diff --git a/cryptography_flutter/pubspec.yaml b/cryptography_flutter/pubspec.yaml index 3257d56..e211585 100644 --- a/cryptography_flutter/pubspec.yaml +++ b/cryptography_flutter/pubspec.yaml @@ -1,13 +1,15 @@ -name: cryptography_flutter +name: cryptography_flutter_plus +version: 2.3.4 +homepage: https://github.com/emz-hanauer/dart-cryptography description: - Makes 'package:cryptography' use platform APIs in Android, iOS, and Mac OS X. The package can + Makes 'package:cryptography_plus' use platform APIs in Android, iOS, and Mac OS X. The package can make performance up to 100 times better. -version: 2.3.2 -homepage: https://github.com/dint-dev/cryptography +topics: + - crypto environment: - sdk: '>=3.1.0 <4.0.0' - flutter: '>=3.13.0' + sdk: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" # Open-source contributors: # @@ -18,7 +20,7 @@ dependencies: # # Packages by github.com/dint-dev: # - cryptography: ^2.7.0 + cryptography_plus: ^2.7.1 flutter: sdk: flutter @@ -29,7 +31,7 @@ dev_dependencies: flutter_lints: ^2.0.3 dependency_overrides: - cryptography: + cryptography_plus: path: ../cryptography flutter: diff --git a/cryptography_flutter_integration_test/ios/Podfile.lock b/cryptography_flutter_integration_test/ios/Podfile.lock index 37704db..a6fac8d 100644 --- a/cryptography_flutter_integration_test/ios/Podfile.lock +++ b/cryptography_flutter_integration_test/ios/Podfile.lock @@ -6,12 +6,12 @@ PODS: - Flutter DEPENDENCIES: - - cryptography_flutter (from `.symlinks/plugins/cryptography_flutter/ios`) + - cryptography_flutter_plus (from `.symlinks/plugins/cryptography_flutter/ios`) - Flutter (from `Flutter`) - integration_test (from `.symlinks/plugins/integration_test/ios`) EXTERNAL SOURCES: - cryptography_flutter: + cryptography_flutter_plus: :path: ".symlinks/plugins/cryptography_flutter/ios" Flutter: :path: Flutter @@ -19,7 +19,7 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/integration_test/ios" SPEC CHECKSUMS: - cryptography_flutter: 381bdacc984abcfbe3ca45ef7c76566ff061614c + cryptography_flutter_plus: 381bdacc984abcfbe3ca45ef7c76566ff061614c Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 integration_test: 13825b8a9334a850581300559b8839134b124670 diff --git a/cryptography_flutter_integration_test/macos/Podfile.lock b/cryptography_flutter_integration_test/macos/Podfile.lock index bdbe013..7996af2 100644 --- a/cryptography_flutter_integration_test/macos/Podfile.lock +++ b/cryptography_flutter_integration_test/macos/Podfile.lock @@ -4,17 +4,17 @@ PODS: - FlutterMacOS (1.0.0) DEPENDENCIES: - - cryptography_flutter (from `Flutter/ephemeral/.symlinks/plugins/cryptography_flutter/macos`) + - cryptography_flutter_plus (from `Flutter/ephemeral/.symlinks/plugins/cryptography_flutter/macos`) - FlutterMacOS (from `Flutter/ephemeral`) EXTERNAL SOURCES: - cryptography_flutter: + cryptography_flutter_plus: :path: Flutter/ephemeral/.symlinks/plugins/cryptography_flutter/macos FlutterMacOS: :path: Flutter/ephemeral SPEC CHECKSUMS: - cryptography_flutter: c9fa581b52e6fe19475432b6f44489c387f61e19 + cryptography_flutter_plus: c9fa581b52e6fe19475432b6f44489c387f61e19 FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 diff --git a/cryptography_flutter_integration_test/pubspec.yaml b/cryptography_flutter_integration_test/pubspec.yaml index f824531..f6a2c8e 100644 --- a/cryptography_flutter_integration_test/pubspec.yaml +++ b/cryptography_flutter_integration_test/pubspec.yaml @@ -1,15 +1,15 @@ name: cryptography_flutter_integration_test description: A new Flutter project. -publish_to: 'none' +publish_to: "none" version: 1.0.0+1 environment: - sdk: '>=3.1.0 <4.0.0' - flutter: '>=3.13.0' + sdk: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" dependencies: - cryptography: ^2.6.0 - cryptography_flutter: ^2.3.1 + cryptography_plus: ^2.6.0 + cryptography_flutter_plus: ^2.3.1 flutter: sdk: flutter cupertino_icons: ^1.0.2 @@ -26,9 +26,9 @@ flutter: uses-material-design: true dependency_overrides: - cryptography: + cryptography_plus: path: ../cryptography - cryptography_flutter: + cryptography_flutter_plus: path: ../cryptography_flutter cryptography_test: - path: ../cryptography_test \ No newline at end of file + path: ../cryptography_test diff --git a/cryptography_flutter_integration_test/test/_android_crypto_provider.dart b/cryptography_flutter_integration_test/test/_android_crypto_provider.dart index fe6dfff..1f4eb31 100644 --- a/cryptography_flutter_integration_test/test/_android_crypto_provider.dart +++ b/cryptography_flutter_integration_test/test/_android_crypto_provider.dart @@ -14,7 +14,7 @@ import 'dart:io'; -import 'package:cryptography_flutter/android.dart'; +import 'package:cryptography_flutter_plus/android.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/cryptography_flutter_integration_test/test/_ciphers.dart b/cryptography_flutter_integration_test/test/_ciphers.dart index 2126e57..a06de7c 100644 --- a/cryptography_flutter_integration_test/test/_ciphers.dart +++ b/cryptography_flutter_integration_test/test/_ciphers.dart @@ -15,9 +15,9 @@ import 'dart:math'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography_flutter/cryptography_flutter.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_flutter_plus/cryptography_flutter_plus.dart'; import 'package:flutter_test/flutter_test.dart'; import '_helpers.dart'; diff --git a/cryptography_flutter_integration_test/test/_ed25519.dart b/cryptography_flutter_integration_test/test/_ed25519.dart index 7073099..d709648 100644 --- a/cryptography_flutter_integration_test/test/_ed25519.dart +++ b/cryptography_flutter_integration_test/test/_ed25519.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:cryptography_test/algorithms/ed25519.dart' as shared; import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/cryptography_flutter_integration_test/test/_flutter_cryptography.dart b/cryptography_flutter_integration_test/test/_flutter_cryptography.dart index 9c7e39a..e8d7b07 100644 --- a/cryptography_flutter_integration_test/test/_flutter_cryptography.dart +++ b/cryptography_flutter_integration_test/test/_flutter_cryptography.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography_flutter/cryptography_flutter.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_flutter_plus/cryptography_flutter_plus.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/cryptography_flutter_integration_test/test/_pbkdf2.dart.dart b/cryptography_flutter_integration_test/test/_pbkdf2.dart.dart index abd4e18..f298437 100644 --- a/cryptography_flutter_integration_test/test/_pbkdf2.dart.dart +++ b/cryptography_flutter_integration_test/test/_pbkdf2.dart.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography_flutter/cryptography_flutter.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_flutter_plus/cryptography_flutter_plus.dart'; import 'package:cryptography_test/algorithms/pbkdf2.dart' as shared; import 'package:flutter_test/flutter_test.dart'; diff --git a/cryptography_flutter_integration_test/test/_rsa_pss.dart b/cryptography_flutter_integration_test/test/_rsa_pss.dart index 6342ad6..e22e246 100644 --- a/cryptography_flutter_integration_test/test/_rsa_pss.dart +++ b/cryptography_flutter_integration_test/test/_rsa_pss.dart @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography_flutter/cryptography_flutter.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_flutter_plus/cryptography_flutter_plus.dart'; import 'package:cryptography_test/algorithms/rsa_pss.dart' as shared; import 'package:flutter_test/flutter_test.dart'; diff --git a/cryptography_flutter_integration_test/test/_rsa_ssa_pkcs1v15.dart b/cryptography_flutter_integration_test/test/_rsa_ssa_pkcs1v15.dart index 2ae053e..4e7626c 100644 --- a/cryptography_flutter_integration_test/test/_rsa_ssa_pkcs1v15.dart +++ b/cryptography_flutter_integration_test/test/_rsa_ssa_pkcs1v15.dart @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; -import 'package:cryptography_flutter/cryptography_flutter.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; +import 'package:cryptography_flutter_plus/cryptography_flutter_plus.dart'; import 'package:cryptography_test/algorithms/rsa_ssa_pkcs5v15.dart' as shared; import 'package:flutter_test/flutter_test.dart'; diff --git a/cryptography_flutter_integration_test/test/_x25519.dart b/cryptography_flutter_integration_test/test/_x25519.dart index d0129a6..63347cc 100644 --- a/cryptography_flutter_integration_test/test/_x25519.dart +++ b/cryptography_flutter_integration_test/test/_x25519.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:cryptography_test/algorithms/x25519.dart' as shared; import 'package:flutter_test/flutter_test.dart'; diff --git a/cryptography_flutter_integration_test/test/main_test.dart b/cryptography_flutter_integration_test/test/main_test.dart index 24be78f..25ea472 100644 --- a/cryptography_flutter_integration_test/test/main_test.dart +++ b/cryptography_flutter_integration_test/test/main_test.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography_flutter/cryptography_flutter.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_flutter_plus/cryptography_flutter_plus.dart'; import 'package:flutter_test/flutter_test.dart'; import '_android_crypto_provider.dart'; diff --git a/cryptography_test/README.md b/cryptography_test/README.md index 0fef336..92af8d1 100644 --- a/cryptography_test/README.md +++ b/cryptography_test/README.md @@ -1,12 +1,12 @@ # Introduction If you are implementing a cryptographic algorithm that implements interfaces of -[pub.dev/packages/cryptography](https://pub.dev/packages/cryptography), this package helps you test +[pub.dev/packages/cryptography_plus](https://pub.dev/packages/cryptography_plus), this package helps you test that: -* Your implementation complies with the API specifications. -* Your implementation doesn't fail any sanity checks. -* Your implementation produces same outputs as some existing implementation (when there is one). +- Your implementation complies with the API specifications. +- Your implementation doesn't fail any sanity checks. +- Your implementation produces same outputs as some existing implementation (when there is one). # Usage @@ -18,8 +18,9 @@ dev_dependencies: ``` If you have something like: + ```dart -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; class MyExample extends Cipher { // ... @@ -27,6 +28,7 @@ class MyExample extends Cipher { ``` Your unit tests will look like: + ```dart import 'package:cryptography_test/cryptography_test.dart'; import 'package:cryptography_test/cipher.dart'; @@ -53,4 +55,4 @@ void main() { }, ); } -``` \ No newline at end of file +``` diff --git a/cryptography_test/lib/algorithms/aes_cbc.dart b/cryptography_test/lib/algorithms/aes_cbc.dart index fca94f9..5b22b35 100644 --- a/cryptography_test/lib/algorithms/aes_cbc.dart +++ b/cryptography_test/lib/algorithms/aes_cbc.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; import '../cipher.dart'; diff --git a/cryptography_test/lib/algorithms/aes_ctr.dart b/cryptography_test/lib/algorithms/aes_ctr.dart index f02bcdc..13de5d1 100644 --- a/cryptography_test/lib/algorithms/aes_ctr.dart +++ b/cryptography_test/lib/algorithms/aes_ctr.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../cipher.dart'; diff --git a/cryptography_test/lib/algorithms/aes_gcm.dart b/cryptography_test/lib/algorithms/aes_gcm.dart index 2f296c2..3f3126a 100644 --- a/cryptography_test/lib/algorithms/aes_gcm.dart +++ b/cryptography_test/lib/algorithms/aes_gcm.dart @@ -14,7 +14,7 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/expect.dart'; import 'package:test/scaffolding.dart'; diff --git a/cryptography_test/lib/algorithms/argon2.dart b/cryptography_test/lib/algorithms/argon2.dart index 2c937a4..50041e9 100644 --- a/cryptography_test/lib/algorithms/argon2.dart +++ b/cryptography_test/lib/algorithms/argon2.dart @@ -14,7 +14,7 @@ import 'dart:convert'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; import '../hex.dart'; diff --git a/cryptography_test/lib/algorithms/blake2b.dart b/cryptography_test/lib/algorithms/blake2b.dart index aa8bee6..424c9ca 100644 --- a/cryptography_test/lib/algorithms/blake2b.dart +++ b/cryptography_test/lib/algorithms/blake2b.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../hash.dart'; diff --git a/cryptography_test/lib/algorithms/blake2s.dart b/cryptography_test/lib/algorithms/blake2s.dart index 5054bad..a516b4c 100644 --- a/cryptography_test/lib/algorithms/blake2s.dart +++ b/cryptography_test/lib/algorithms/blake2s.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../hash.dart'; diff --git a/cryptography_test/lib/algorithms/chacha20.dart b/cryptography_test/lib/algorithms/chacha20.dart index 22ad253..8a75b7e 100644 --- a/cryptography_test/lib/algorithms/chacha20.dart +++ b/cryptography_test/lib/algorithms/chacha20.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../cipher.dart'; diff --git a/cryptography_test/lib/algorithms/ecdh.dart b/cryptography_test/lib/algorithms/ecdh.dart index 155a4ba..153ab73 100644 --- a/cryptography_test/lib/algorithms/ecdh.dart +++ b/cryptography_test/lib/algorithms/ecdh.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:cryptography_test/key_exchange.dart'; import 'package:test/test.dart'; diff --git a/cryptography_test/lib/algorithms/ecdsa.dart b/cryptography_test/lib/algorithms/ecdsa.dart index 42841b6..1d81853 100644 --- a/cryptography_test/lib/algorithms/ecdsa.dart +++ b/cryptography_test/lib/algorithms/ecdsa.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/test.dart'; import '../hex.dart'; diff --git a/cryptography_test/lib/algorithms/ed25519.dart b/cryptography_test/lib/algorithms/ed25519.dart index c53978d..8822f24 100644 --- a/cryptography_test/lib/algorithms/ed25519.dart +++ b/cryptography_test/lib/algorithms/ed25519.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/expect.dart'; import 'package:test/scaffolding.dart'; diff --git a/cryptography_test/lib/algorithms/hkdf.dart b/cryptography_test/lib/algorithms/hkdf.dart index 82a15ee..55d3086 100644 --- a/cryptography_test/lib/algorithms/hkdf.dart +++ b/cryptography_test/lib/algorithms/hkdf.dart @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:test/test.dart'; import '../hex.dart'; diff --git a/cryptography_test/lib/algorithms/hmac.dart b/cryptography_test/lib/algorithms/hmac.dart index ff5ef23..d286e65 100644 --- a/cryptography_test/lib/algorithms/hmac.dart +++ b/cryptography_test/lib/algorithms/hmac.dart @@ -17,8 +17,8 @@ import 'dart:typed_data'; import 'package:collection/collection.dart'; import 'package:crypto/crypto.dart' as crypto; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/helpers.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/helpers.dart'; import 'package:test/test.dart'; import '../hex.dart'; diff --git a/cryptography_test/lib/algorithms/pbkdf2.dart b/cryptography_test/lib/algorithms/pbkdf2.dart index e02ca49..07ac47e 100644 --- a/cryptography_test/lib/algorithms/pbkdf2.dart +++ b/cryptography_test/lib/algorithms/pbkdf2.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/expect.dart'; import 'package:test/scaffolding.dart'; diff --git a/cryptography_test/lib/algorithms/rsa_pss.dart b/cryptography_test/lib/algorithms/rsa_pss.dart index 0d63590..d3faed7 100644 --- a/cryptography_test/lib/algorithms/rsa_pss.dart +++ b/cryptography_test/lib/algorithms/rsa_pss.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../signature.dart'; diff --git a/cryptography_test/lib/algorithms/rsa_ssa_pkcs5v15.dart b/cryptography_test/lib/algorithms/rsa_ssa_pkcs5v15.dart index 18dc3a4..de9da2a 100644 --- a/cryptography_test/lib/algorithms/rsa_ssa_pkcs5v15.dart +++ b/cryptography_test/lib/algorithms/rsa_ssa_pkcs5v15.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../signature.dart'; diff --git a/cryptography_test/lib/algorithms/sha224.dart b/cryptography_test/lib/algorithms/sha224.dart index 5a41cb3..9e3d53e 100644 --- a/cryptography_test/lib/algorithms/sha224.dart +++ b/cryptography_test/lib/algorithms/sha224.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../hash.dart'; diff --git a/cryptography_test/lib/algorithms/sha256.dart b/cryptography_test/lib/algorithms/sha256.dart index 040b57c..f7a801a 100644 --- a/cryptography_test/lib/algorithms/sha256.dart +++ b/cryptography_test/lib/algorithms/sha256.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../hash.dart'; diff --git a/cryptography_test/lib/algorithms/sha384.dart b/cryptography_test/lib/algorithms/sha384.dart index 3aec799..8f79f08 100644 --- a/cryptography_test/lib/algorithms/sha384.dart +++ b/cryptography_test/lib/algorithms/sha384.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../hash.dart'; diff --git a/cryptography_test/lib/algorithms/sha512.dart b/cryptography_test/lib/algorithms/sha512.dart index ad5a167..afc9958 100644 --- a/cryptography_test/lib/algorithms/sha512.dart +++ b/cryptography_test/lib/algorithms/sha512.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../hash.dart'; diff --git a/cryptography_test/lib/algorithms/x25519.dart b/cryptography_test/lib/algorithms/x25519.dart index 9eab1e4..511cee9 100644 --- a/cryptography_test/lib/algorithms/x25519.dart +++ b/cryptography_test/lib/algorithms/x25519.dart @@ -14,8 +14,8 @@ import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:test/expect.dart'; import 'package:test/scaffolding.dart'; diff --git a/cryptography_test/lib/algorithms/xchacha20.dart b/cryptography_test/lib/algorithms/xchacha20.dart index 07f429f..057d955 100644 --- a/cryptography_test/lib/algorithms/xchacha20.dart +++ b/cryptography_test/lib/algorithms/xchacha20.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import '../cipher.dart'; diff --git a/cryptography_test/lib/cipher.dart b/cryptography_test/lib/cipher.dart index 5dbcf2b..c5442a3 100644 --- a/cryptography_test/lib/cipher.dart +++ b/cryptography_test/lib/cipher.dart @@ -16,11 +16,11 @@ /// /// ## Example /// See [testCipher]. -library cryptography_test.cipher; +library cryptography_plus_test.cipher; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:test/expect.dart'; import 'package:test/scaffolding.dart'; import 'package:typed_data/typed_buffers.dart'; diff --git a/cryptography_test/lib/cryptography_test.dart b/cryptography_test/lib/cryptography_test.dart index d3823a0..7a87eae 100644 --- a/cryptography_test/lib/cryptography_test.dart +++ b/cryptography_test/lib/cryptography_test.dart @@ -31,9 +31,9 @@ /// testCryptography(); /// } /// ``` -library cryptography_test; +library cryptography_plus_test; -import 'package:cryptography/cryptography.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; import 'package:cryptography_test/algorithms/argon2.dart'; import 'package:test/scaffolding.dart'; diff --git a/cryptography_test/lib/hash.dart b/cryptography_test/lib/hash.dart index 86beb99..ab56b12 100644 --- a/cryptography_test/lib/hash.dart +++ b/cryptography_test/lib/hash.dart @@ -16,13 +16,13 @@ /// /// ## Example /// See [testHashAlgorithm]. -library cryptography_test.hash_algorithm; +library cryptography_plus_test.hash_algorithm; import 'dart:async'; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:test/test.dart'; import 'hex.dart'; diff --git a/cryptography_test/lib/hex.dart b/cryptography_test/lib/hex.dart index 7c684e4..ea080f9 100644 --- a/cryptography_test/lib/hex.dart +++ b/cryptography_test/lib/hex.dart @@ -31,7 +31,7 @@ /// testCryptography(); /// } /// ``` -library cryptography_test.hex; +library cryptography_plus_test.hex; import 'dart:typed_data'; diff --git a/cryptography_test/lib/key_exchange.dart b/cryptography_test/lib/key_exchange.dart index 665c62f..d40d266 100644 --- a/cryptography_test/lib/key_exchange.dart +++ b/cryptography_test/lib/key_exchange.dart @@ -16,10 +16,10 @@ /// /// ## Example /// See [testKeyExchangeAlgorithm]. -library cryptography_test.key_exchange_algorithm; +library cryptography_plus_test.key_exchange_algorithm; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:test/test.dart'; import 'hex.dart'; diff --git a/cryptography_test/lib/signature.dart b/cryptography_test/lib/signature.dart index 4db7f41..e022f3b 100644 --- a/cryptography_test/lib/signature.dart +++ b/cryptography_test/lib/signature.dart @@ -16,12 +16,12 @@ /// /// ## Example /// See [testSignatureAlgorithm]. -library cryptography_test.signature_algorithm; +library cryptography_plus_test.signature_algorithm; import 'dart:typed_data'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; import 'package:test/expect.dart'; import 'package:test/scaffolding.dart'; diff --git a/cryptography_test/pubspec.yaml b/cryptography_test/pubspec.yaml index e0c72f3..43d01a7 100644 --- a/cryptography_test/pubspec.yaml +++ b/cryptography_test/pubspec.yaml @@ -1,11 +1,12 @@ name: cryptography_test version: 0.1.0 -homepage: https://github.com/dint-dev/cryptography -description: A package for testing and benchmarking cryptographic algorithm implementations that +homepage: https://github.com/emz-hanauer/dart-cryptography +description: + A package for testing and benchmarking cryptographic algorithm implementations that implement "package:cryptography" interfaces. environment: - sdk: '>=3.1.0 <4.0.0' + sdk: ">=3.1.0 <4.0.0" # Open-source contributors: # @@ -24,7 +25,7 @@ dependencies: # # Packages by github.com/dint-dev: # - cryptography: ^2.5.1 + cryptography_plus: ^2.5.1 dev_dependencies: # @@ -33,5 +34,5 @@ dev_dependencies: lints: ^2.1.1 dependency_overrides: - cryptography: - path: ../cryptography \ No newline at end of file + cryptography_plus: + path: ../cryptography diff --git a/jwk/CHANGELOG.md b/jwk/CHANGELOG.md index 25898ec..b111248 100644 --- a/jwk/CHANGELOG.md +++ b/jwk/CHANGELOG.md @@ -1,34 +1,36 @@ ## 0.2.4 -* Improves documentation. + +- Improves documentation. ## 0.2.3 -* Raises Dart SDK minimum to 3.1.0. + +- Raises Dart SDK minimum to 3.1.0. ## 0.2.2 -* Adds p256k support ([#135](https://github.com/dint-dev/cryptography/pull/135)). -* Fixes a padding issue ([#134](https://github.com/dint-dev/cryptography/pull/134)). +- Adds p256k support ([#135](https://github.com/emz-hanauer/dart-cryptography/pull/135)). +- Fixes a padding issue ([#134](https://github.com/emz-hanauer/dart-cryptography/pull/134)). ## 0.2.1 -* Improves documentation. +- Improves documentation. ## 0.2.0 -* Fixes various bugs. +- Fixes various bugs. ## 0.1.1 -* Updates dependency constraints and linting rules. +- Updates dependency constraints and linting rules. ## 0.1.0 -* Finishes null safety migration. +- Finishes null safety migration. ## 0.1.0-nullsafety.1 -* Fixes SDK and dependency constraints. +- Fixes SDK and dependency constraints. ## 0.1.0-nullsafety.0 - * Initial version. \ No newline at end of file +- Initial version. diff --git a/jwk/README.md b/jwk/README.md index 3099554..d74a2c2 100644 --- a/jwk/README.md +++ b/jwk/README.md @@ -1,25 +1,30 @@ -[![Pub Package](https://img.shields.io/pub/v/jwk.svg)](https://pub.dev/packages/jwk) -[![Github Actions CI](https://github.com/dint-dev/cryptography/workflows/Dart%20CI/badge.svg)](https://github.com/dint-dev/cryptography/actions?query=workflow%3A%22Dart+CI%22) +[![Pub Package](https://img.shields.io/pub/v/jwk_plus.svg)](https://pub.dev/packages/jwk_plus) +[![Github Actions CI](https://github.com/emz-hanauer/dart-cryptography/workflows/Dart%20CI/badge.svg)](https://github.com/emz-hanauer/dart-cryptography/actions?query=workflow%3A%22Dart+CI%22) # Overview -JWK (JSON Web Key) encoding and decoding. Designed to be used with -[package:cryptography](https://pub.dev/packages/cryptography). + +JWK plus (JSON Web Key) encoding and decoding. Designed to be used with +[package:cryptography_plus](https://pub.dev/packages/cryptography_plus). Licensed under the [Apache License 2.0](LICENSE). # Getting started + In _pubspec.yaml_ + ```yaml dependencies: - cryptography: ^2.7.0 - jwk: ^0.2.4 + cryptography_plus: ^2.7.0 + jwk_plus: ^0.2.4 ``` # Examples + ## Encoding KeyPair + ```dart -import 'package:cryptography/cryptography.dart'; -import 'package:jwk/jwk.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:jwk_plus/jwk_plus.dart'; Future main() async { final keyPair = await RsaPss().newKeyPair(); @@ -29,8 +34,9 @@ Future main() async { ``` ## Decoding SecretKey + ```dart -import 'package:jwk/jwk.dart'; +import 'package:jwk_plus/jwk_plus.dart'; void main() { final jwk = Jwk.fromJson({ diff --git a/jwk/lib/jwk.dart b/jwk/lib/jwk_plus.dart similarity index 99% rename from jwk/lib/jwk.dart rename to jwk/lib/jwk_plus.dart index b2f6981..4e21cf7 100644 --- a/jwk/lib/jwk.dart +++ b/jwk/lib/jwk_plus.dart @@ -15,14 +15,14 @@ /// JWK (JSON Web Key) encoding and decoding. /// /// See documentation for the class [Jwk]. -library jwk; +library jwk_plus; import 'dart:convert'; import 'dart:typed_data'; import 'package:collection/collection.dart'; -import 'package:cryptography/cryptography.dart'; -import 'package:cryptography/dart.dart'; +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:cryptography_plus/dart.dart'; /// A JWK ([RFC 7517](https://tools.ietf.org/html/rfc7517): "JSON Web Key") /// formatted cryptographic key. diff --git a/jwk/pubspec.yaml b/jwk/pubspec.yaml index b0b3b9e..547d9b1 100644 --- a/jwk/pubspec.yaml +++ b/jwk/pubspec.yaml @@ -1,19 +1,19 @@ -name: jwk +name: jwk_plus version: 0.2.4 -homepage: https://github.com/dint-dev/cryptography +homepage: https://github.com/emz-hanauer/dart-cryptography description: JWK (JSON Web Key) encoding and decoding (for package:cryptography). environment: - sdk: '>=3.1.0 <4.0.0' + sdk: ">=3.1.0 <4.0.0" dependencies: collection: ^1.17.0 - cryptography: ^2.6.0 + cryptography_plus: ^2.7.1 dev_dependencies: lints: ^2.1.1 test: ^1.24.0 dependency_overrides: - cryptography: - path: ../cryptography \ No newline at end of file + cryptography_plus: + path: ../cryptography diff --git a/jwk/test/jwk_test.dart b/jwk/test/jwk_test.dart index 37551c6..d6e5f8f 100644 --- a/jwk/test/jwk_test.dart +++ b/jwk/test/jwk_test.dart @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:jwk/jwk.dart'; +import 'package:jwk_plus/jwk_plus.dart'; import 'package:test/test.dart'; void main() {