SteganographyController class

Main API: encrypts UTF-8 text into an image and extracts it back.

Create once with a 32-byte key, method, and optional cipher, then call encrypt / decrypt. Call dispose when the key is no longer needed.

final key = Uint8List.fromList(List.filled(32, 0x42));
final controller = SteganographyController(
  key: key,
  method: SteganographyMethod.lsb,
);
final stego = await controller.encrypt(
  imageBytes: pngBytes,
  text: 'secret',
);
final text = await controller.decrypt(imageBytes: stego);
controller.dispose();

Constructors

SteganographyController({required Uint8List key, required SteganographyMethod method, SteganographyCipher cipher = SteganographyCipher.aes256Gcm})
Creates a controller.

Properties

cipher SteganographyCipher
Cipher used to protect the payload before embedding.
final
hashCode int
The hash code for this object.
no setterinherited
method SteganographyMethod
Steganography algorithm used for embed and extract.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

decrypt({required Uint8List imageBytes}) Future<String>
Extracts and decrypts hidden data from imageBytes as UTF-8 text.
dispose() → void
Zeroes the key in memory. Further calls throw StateError.
encrypt({required Uint8List imageBytes, required String text}) Future<Uint8List>
Encrypts text and embeds it into imageBytes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited