file_signature 1.0.1
file_signature: ^1.0.1 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.1 #
- Fix: Updated README banner and badge URLs to render correctly in IDEs and on Pub.dev.
- Test: Fixed guardStream unit tests to handle small payloads and stream buffering correctly.
- Docs: Improved repository documentation visibility and formatting.
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.