GithubHelp home page GithubHelp logo

viktorvoltz / flutter_steganograph Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 43 KB

๐Ÿน Flutter Steganograph is a digital image encoding package.

Home Page: https://pub.dev/packages/flutter_steganograph

License: BSD 3-Clause "New" or "Revised" License

Dart 100.00%
cryptography cryptology steganography steganography-encoding

flutter_steganograph's Introduction

Flutter Steganograph


Flutter Steganograph is a digital image encoding package. it simply takes a message (text or image) and embeds (conceals ๐Ÿ•ต๏ธโ€โ™‚๏ธ) it inside of a cover image with minimum possible alteration to the original cover image.

Installation ๐Ÿ›ธ

Add flutter_steganograph to your pubspec.yaml:

dependencies:
  flutter_steganograph: ^0.0.1

Usage ๐Ÿ“ฆ

Importing the Package

import 'package:flutter_steganograph/flutter_steganograph.dart';

Embed a text into an image ๐Ÿ”ฉ

Embeds a text string into an image. Optional saveImage argument to download embedded image to gallery. Returns the encoded bytes -> Uint8List.

import 'package:image/image.dart' as dImage;
import 'package:flutter_steganograph/src/flutter_steganograph.dart';

final steganograph = Steganograph();
final coverImage = dImage.decodePng(File('/cover_image.png').readAsBytesSync())!;

final embeddedTextImage = steganograph.embedText(
    image: coverImage, 
    text: 'super secret text',
    saveImage: true
    );
// to covert to material image
Image.memory(embeddedTextImage);

Extract a secret text from the encoded image ๐Ÿ”ฌ

Extracts a secret text string from an encoded image. Returns the extracted secret String

import 'package:image/image.dart' as dImage;
import 'package:flutter_steganograph/src/flutter_steganograph.dart';

final steganograph = Steganograph();
final encodedImage = dImage.decodePng(File('/encoded_image.png').readAsBytesSync())!;
int secretLength = secretText.length;

String secretText = steganograph.extractText(
    image: encodedImage, 
    length: secretLength,
    );

Embed a secret Image inside a cover image ๐Ÿ–ผ๏ธ

Embed/encode a secret image inside a cover image. secret image dimensions are smaller than cover image dimensions. Returns the embedded bytes -> Uint8List of encoded image.

import 'package:image/image.dart' as dImage;
import 'package:flutter_steganograph/src/flutter_steganograph.dart';

final steganograph = Steganograph();
final coverImage = dImage.decodePng(File('/cover_image.png').readAsBytesSync())!;
final secretImage = dImage.decodePng(File('/secret_image.png').readAsBytesSync())!;

Uint8List embeddedImage = steganograph.embedImage(
        coverImage: coverImage,
        secretImage: secretImage,
      );
//to covert to material image
Image.memory(embeddedImage);

Extract secret Image from an encoded image ๐Ÿงฎ

decode a secret image from the encoded image. Returns the embedded bytes -> Uint8List of secret image.

import 'package:image/image.dart' as dImage;
import 'package:flutter_steganograph/src/flutter_steganograph.dart';

final steganograph = Steganograph();
final encodedImage = dImage.decodePng(File('/encodedImage_image.png').readAsBytesSync())!;
int secretImageHeight;
int secretImageWith;

Uint8List extractedImage = steganograph.extractImage(
        embeddedImage: encodedImage!,
        secretWidth: secretImageHeight,
        secretHeight: secretImageHeight,
      );
//to covert to material image
Image.memory(extractedImage);

Coming soon

encryption ๐Ÿ”’ of secret text and image

Contribution

Feel free to open pull requests that improve the quality of images or performance of the library. Any bugs should be submitted to Issues

flutter_steganograph's People

Contributors

viktorvoltz avatar

Stargazers

 avatar Oyeniyi Bright avatar  avatar

Watchers

Lucian avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.