datacapsule 1.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new56

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

dependencies:
    datacapsule: ^1.0.0

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.1

Added example code.

1.0.0

Initial release.

example/example.dart

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);
    print(_encryptedString);

    /// 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:


dependencies:
  datacapsule: ^1.0.1

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.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
Popularity:
Describes how popular the package is relative to other packages. [more]
20
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
56
Learn more about scoring.

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

Detected platforms: Flutter, web, other

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

Maintenance issues and suggestions

Homepage does not exists. (-20 points)

We were unable to access https://norgelera.visualstudio.com/DataCapsule at the time of the analysis.

Dependencies

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