datacapsule 1.0.2

  • Example
  • Installing
  • Versions
  • 50

Data Capsule #

A simple string (only) masking algorithm that hides a readable string value inside a data capsule using a generated key. Generated data capsules will only be opened using the same key that was used to create them.

Setup #

To use this plugin:

Add data capsule in your project's pubspec.yaml

    datacapsule: ^1.0.1

Usage #

See the `example` directory for a complete sample code on using data capsule.

Import it inside your code

import 'package:datacapsule/datacapsule.dart';

Instantiate the data capsule class

DataCapsule _capsule = DataCapsule();

There are 5 methods you can use to pack and unpack data capsules

precription(); // Gets a prescription key. As much as possible, you have to keep this somewhere safe.
pack(String data, String prescription); // Packs a string into a data capsule.
unpack(String data, String prescription); // Unpacks a string into a data capsule.
packList(List<String> data, String prescription); // Packs a list of strings into a data capsule.
unpackList(List<String> data, String prescription); // Unpacks a a list strings into a data capsule.

1.0.2 #

Added home page

1.0.1 #

Added example code.

1.0.0 #

Initial release.


import 'package:datacapsule/datacapsule.dart' as capsule;

class DataCapsule_Examples {
  /// Initialize the data capsule class.
  capsule.DataCapsule _capsule = capsule.DataCapsule();

  /// Sample method to generate a data capsule.
  void GenerateCapsule() {
    /// * Must get a prescription key before performing any methods of DataCapsule.s
    /// * A prescription key will be used to encrypt and decrypt. The idea is to create an algorithm
    /// * that will hide a readable string inside a data capsule using a prescription key and opening the
    /// * data capsule to get the original readable string would require the same key.
    /// ! If you try to decrypt a string using a different key from what was used to encrypt it,
    /// ! the returned string will be different from the original string.

    /// Get the prescription key
    String _prescription = _capsule.prescription();

    /// Pack the string inside a data capsule
    String _encryptedString = _capsule.pack(
        "I am a string to be placed inside a data capsule.", _prescription);

    /// Unpack the data capsule using the same prescription key that was used for packing.
    print(_capsule.unpack(_encryptedString, _prescription));

Use this package as a library

1. Depend on it

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

  datacapsule: ^1.0.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:datacapsule/datacapsule.dart';
Version Uploaded Documentation Archive
1.0.2 Dec 9, 2018 Go to the documentation of datacapsule 1.0.2 Download datacapsule 1.0.2 archive
1.0.1 Sep 25, 2018 Go to the documentation of datacapsule 1.0.1 Download datacapsule 1.0.1 archive
1.0.0 Sep 25, 2018 Go to the documentation of datacapsule 1.0.0 Download datacapsule 1.0.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 4, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:datacapsule/datacapsule.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0