dart_secure 0.2.0 copy "dart_secure: ^0.2.0" to clipboard
dart_secure: ^0.2.0 copied to clipboard

A new Flutter Framework that uses Dart Programming Language

# Dart Secure Package

A Dart package that provides a set of functionalities for enhancing user authentication and data encryption in your Dart applications. This package integrates multiple cybersecurity practices to help you secure sensitive user data and interactions. The package includes the following features:

## Features

### Biometric User Authentication
String iosIntegration = '''
iOS Integration
Note that this plugin works with both Touch ID and Face ID. However, to use the latter, you need to also add:

<key>NSFaceIDUsageDescription</key>
<string>Why is my app authenticating using face id?</string>
to your Info.plist file. Failure to do so results in a dialog that tells the user your app has not been updated to use Face ID.
''';

String androidIntegration = '''
Android Integration
* The plugin will build and run on SDK 16+, but isDeviceSupported() will always return false before SDK 23 (Android 6.0).
  ''';

String activityChanges = '''
Activity Changes
Note that local_auth requires the use of a FragmentActivity instead of an Activity. To update your application:

If you are using FlutterActivity directly, change it to FlutterFragmentActivity in your AndroidManifest.xml.

If you are using a custom activity, update your MainActivity.java:

import io.flutter.embedding.android.FlutterFragmentActivity;

public class MainActivity extends FlutterFragmentActivity {
// ...
}
or MainActivity.kt:

import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity extends FlutterFragmentActivity {
// ...
}
to inherit from FlutterFragmentActivity.
''';

String permissions = '''
Permissions
Update your project's AndroidManifest.xml file to include the USE_BIOMETRIC permissions:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app">
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
</manifest>
''';

String readmeContent = iosIntegration + '\n' + androidIntegration + '\n' + activityChanges + '\n' + permissions;
print(readmeContent);  // This would print the combined content for your README file.

The `biometricAuth` feature provides a simple and secure way to implement biometric user authentication in your application. It supports various biometric authentication methods available on the device. Here's a sample usage:

```dart
var authStatus = await biometricAuth();
if (authStatus == AuthenticationStatus.successful) {
  print("Authentication successful, continue");
} else {
  print("Authentication unsuccessful, try again");
}

In-App Encryption #

The InAppEncryption feature allows you to encrypt sensitive data within your application using a specified encryption key. This helps protect data from unauthorized access. Here's a sample usage:

String encryptedAddress = inAppEncrypt(text: "User's Address", key: "MyUsersAddress");

Hash Encryption #

The hashEncryption feature provides a way to securely hash data, making it useful for scenarios like password storage. It helps ensure that sensitive data cannot be easily reversed. Here's a sample usage:

String encryptedAddress = hashEncrypt(text: "User's Address", key: "MyUsersAddress");

In-App Decryption #

The InAppDecryption feature allows you to decrypt encrypted data within your application using the appropriate decryption key. This feature is used to retrieve the original data after encryption. Here's a sample usage:

String encryptedAddress = InAppDecryption(cipher: "######################", key: "MyUsersAddress");

Getting Started #

To use this package, add dart_secure as a dependency in your pubspec.yaml file:

dependencies:
  dart_secure: ^0.1.0

Then import the necessary features in your Dart code:

import 'package:dart_secure/dart_secure.dart';

Version History #

0.1.0 #

Initial release of the Dart Secure framework that integrates multiple cybersecurity practices.

For more details and information about the package usage, please refer to the package's GitHub repository.

If you encounter any issues or have suggestions for improvement, feel free to open an issue on GitHub.

Happy coding!

3
likes
0
points
101
downloads

Publisher

verified publishersaifalmajd.blogspot.com

Weekly Downloads

A new Flutter Framework that uses Dart Programming Language

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

encrypt, flutter, local_auth

More

Packages that depend on dart_secure