An Image Digital Signature uses steganography (LSB - Least Significant Bit technique) to embed digital signatures directly into raster image pixels. This method allows you to add invisible, password-protected signatures to images while maintaining image quality. The signature data is embedded into the least significant bits of image pixels, making the signature undetectable to the naked eye.
Key Features
Invisible Signatures: Signatures are embedded directly into image pixels using steganography
Password Protection: Signatures are protected with a password (minimum 4 characters)
Format Support: Works with PNG and JPG image formats
This example shows how to sign an image with a digital signature using steganography.
using(Signaturesignature=newSignature("image.png")){// Create sign options with passwordImageDigitalSignOptionssignOptions=newImageDigitalSignOptions{Password="MySecurePassword123"};// Sign the imageSignResultsignResult=signature.Sign("signed_image.png",signOptions);Console.WriteLine($"Image signed successfully. Found {signResult.Succeeded.Count} signatures.");}
Signing Images from Streams
You can also sign images using streams instead of file paths:
The library automatically validates password length and image size requirements. Handle exceptions appropriately:
try{using(Signaturesignature=newSignature("image.png")){ImageDigitalSignOptionssignOptions=newImageDigitalSignOptions{Password="MyPassword123"// Minimum 4 characters required};SignResultsignResult=signature.Sign("signed_image.png",signOptions);Console.WriteLine("✓ Image signed successfully!");}}catch(ArgumentExceptionex){Console.WriteLine($"Password validation error: {ex.Message}");// Password must be at least 4 characters long}catch(InvalidOperationExceptionex){Console.WriteLine($"Image size error: {ex.Message}");// Image is too small for digital steganography signature}
Limitations and Considerations
Format Limitations
PNG: Fully supported ✅
JPG/JPEG: Fully supported ✅
BMP: Not supported ❌
Other formats: Not supported ❌
Image Size Limitations
Images smaller than 8x8 pixels cannot be signed
Images with fewer than 16,384 pixels cannot be signed
Steganography Considerations
Image compression (especially JPG) may affect signature detection
Image editing may corrupt embedded signatures
Always keep original signed images for verification
The signature is embedded invisibly in the image pixels
Summary
This guide demonstrates how to use GroupDocs.Signature to sign images with digital signatures using steganography. It covers loading images, configuring password-protected digital signatures that are embedded invisibly into image pixels, and saving signed images. The feature provides invisible authentication while maintaining image quality and requires minimum size requirements for images.
Advanced Usage Topics
To learn more about document eSign features, please refer to the advanced usage section.
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: