ForensicWatermark class

Static utility class for forensic (invisible) watermark embedding and extraction using spread-spectrum LSB modulation.

The algorithm modifies the least-significant bit of the blue channel at pseudo-random pixel positions seeded by the secret key. The payload is repeated ForensicConfig.redundancy times and recovered via majority vote, providing resilience against minor image edits.

final watermarked = ForensicWatermark.embed(
  imageBytes: pngBytes,
  payload: 'user@example.com',
  key: 'secret-key',
);

final recovered = ForensicWatermark.extract(
  imageBytes: watermarked,
  key: 'secret-key',
);
print(recovered); // user@example.com

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Static Methods

embed({required Uint8List imageBytes, required String payload, required String key, ForensicConfig config = const ForensicConfig()}) Uint8List
Embeds payload invisibly into imageBytes using key.
extract({required Uint8List imageBytes, required String key, ForensicConfig config = const ForensicConfig()}) String?
Extracts a previously embedded payload from imageBytes using key.