This document outlines the integrity verification system integrated into RED Engine that validates file signatures and displays verification status to users.
- the Obsidian RED Signer plugin create
manifest.jsonin vault directories - Format:
{ "filepath": { "file_hash": "hex", "public_key": "hex", "signature": "hex" } } - Each entry signs the file's SHA-256 hash using Ed25519 cryptography
contributors.jsonat the repo root lists trusted public keys- Format:
[
{ "name": "StandardCodebase", "public_key": "66f32e250b0bafb2683ae987e65a390901f030ccbc7745435d99f35da1bfccf1" }
]- Load trusted keys from
contributors.json(by public_key hex string) - Scan data directories for
manifest.jsonfiles - For each markdown file:
- Calculate SHA-256 hash of file content
- Look up matching entry in manifest by filename
- Compare stored hash with calculated hash
- Verify signature using Ed25519 public key
- Check if public key is in trusted contributors list
- Set Article status:
Verified=true+Author=nameif signature valid and key trustedVerified=false+Author="Unverified / Unknown Origin"otherwise
- Security Badge: Prominently shows verification status at top of each article
- Hash Footer: Displays full SHA-256 checksum for manual verification
- Visual Indicators:
- ✅ Verified Contributor: Green badge with contributor name
⚠️ Unverified / Unknown Origin: Red badge for unsigned/untrusted files
Key improvements:
- Updated manifest structure to support flat format:
{filepath: entry} - Added
parseManifestJSON()helper to handle both wrapped and flat formats - Changed lookup from hash-based to filepath-based
- Fixed field names:
file_hash(not justhash) - Proper Ed25519 verification using
ed25519.Verify()
Important structs:
type ManifestEntry struct {
FileHash string `json:"file_hash"`
PublicKey string `json:"public_key"`
Signature string `json:"signature"`
}Visual improvements:
- Added emoji indicators (✅ /
⚠️ ) to badges - Better spacing and visual hierarchy
- Emphasized "Verified Contributor: " text
- Marked hash as "File integrity hash"
Enhanced styling:
- Gradient backgrounds for badges
- Better box shadows and borders
- Improved hash footer layout
- Added
user-select: allfor easy copying - Responsive design maintained
- Ensure
contributors.jsonexists with trusted keys - Create
manifest.jsonin vault with signed entries - Start RED Engine:
./red -config config.json - Browse to any article
- Check for:
- Green ✅ badge if file is verified
- Red
⚠️ badge if unverified - SHA-256 hash displayed at bottom
- Vault:
data/remote/API/ - Test files:
File.md,Future proofing.md - Contributors:
contributors.json(root level) - Manifest:
data/remote/API/manifest.json
- Files are verified using Ed25519 signatures
- Only files signed by trusted contributors are marked as verified
- Hash tampering is detected (hash mismatch → unverified)
- Untrusted signers are rejected even with valid signatures
- Does NOT prevent serving unverified files (UI shows warning instead)
- Does NOT auto-reject unsigned files (design choice: inform, don't block)
- Verification happens at serve time (not on write)
- No automatic signature generation (external tool responsibility)
- Generate Ed25519 keypair
- Register public key in
contributors.json - Create/update
manifest.jsonwith:- File path as key
- SHA-256 hash of file content
- Signature of content (Ed25519)
- Public key reference
- Ensure
contributors.jsonexists and is accessible - Point
dataDirto vault containingmanifest.json - Restart RED Engine to reload verification data
- Monitor UI badges for verification status
- Add API endpoint
/api/verifyto check file integrity programmatically - Implement file access control (reject unverified files if policy set)
- Add signature timestamp for audit trails
- Support multiple signatures per file
- Add admin panel to manage contributors
internal/store/store.go- Core verification logicinternal/router/templates/base.html- Visual displayinternal/router/static/article.css- Enhanced styling