file_signature 1.0.0
file_signature: ^1.0.0 copied to clipboard
A pure Dart security utility that validates files by checking Magic Byte signatures. Prevents rename attacks (e.g. .exe as .png) on Mobile, Web, and Desktop.
1.0.0 #
Initial Release - "Don't trust the file extension. Trust the bits."
- Core Validation: Added
FileSignature.guard(file)to validateXFiletypes by reading their Magic Bytes (Hex Signature). - Stream Security: Added
FileSignature.guardStream(stream)to intercept and validate large file uploads without buffering the entire file in RAM. - Boolean Check: Added
FileSignature.isValid(bytes)for quick checks on memory data (Base64/Clipboard). - Supported Formats:
- Images: PNG, JPEG, GIF, WebP, BMP, HEIC.
- Documents: PDF.
- Archives: ZIP (detects DOCX, APK, JAR, etc.).
- Media: MP4, MOV (ISO Base Media detection).
- Security: Added explicit blocking for executable malware:
- Windows (
.exe) - Linux (
.elf) - macOS (
Mach-O)
- Windows (
- Universal Support: Full support for Android, iOS, Web (Blob slicing), macOS, Windows, and Linux.