Skip to content

ente-io/ente_crypto_dart

Repository files navigation

ente_crypto_dart

The core of the ente's crypto library.

Getting started

  • Import the package
import 'package:ente_crypto_dart/ente_crypto_dart.dart';
  • Call the following inside the main function
WidgetsFlutterBinding.ensureInitialized();
initCryptoUtil();
  • Just start consuming the CryptoUtil class, see usage below

Usage

import 'package:ente_crypto_dart/ente_crypto_dart.dart';

final utf8Str = CryptoUtil.strToBin("Hello");

Integration tests

Use the Following command for running them from the example directory of this project.

Setup Files

Download and place this file in example/test_data folder with file name png-5mb-1.png

OR

Run the following commands from terminal

cd example
flutter create .
mkdir test_data
cd test_data
curl -O https://freetestdata.com/wp-content/uploads/2021/09/png-5mb-1.png
cd ../..

Running Tests

For this one remember to select a desktop target like macos as tests may fail on android & iOS due to clash of libsodium and on web as it is not supported

cd example
flutter test integration_test --dart-define=PWD=$(PWD)

Additional information

This library is made by Ente.io developers and used in auth and photos app.

This is GPL-3.0 Licensed and wouldn't be possible without libsodium library and the sodium dart package.

About

The core of the ente.io crypto library.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages