-
-
Notifications
You must be signed in to change notification settings - Fork 0
MEDF
- Version: 1.0.0
- Status: Stable Implementation (MirAI Ecosystem)
- Author: Yoga (MirAI Development)
- 1. Introduction
- 2. Security Philosophy
- 3. Technical Specifications
- 3.1. Encryption Algorithm
- 3.2. Data Structure (Anatomy)
- 3.3. Double Header Verification
- 4. Media-as-Code Concept
- 5.Client-Side Implementation
- 6. Primary Use Cases
- 7. Glossary & Terminology.
MirAI Encrypted Data Files (.medf) is a text-based encrypted data storage format designed for secure data exchange within untrusted frontend environments. This format allows developers to store sensitive information locally without relying on backend infrastructure for the encryption process.
The .medf format is built upon the Zero-Knowledge Architecture principle. This means:
-
Data Sovereignty: The encryption key (password) is entirely managed by the user or creator. -
Browser Autonomy: All processes utilize Vanilla JS (Web Crypto API), ensuring raw data never touches the network. -
String Consistency: Data is handled as JSON Strings to ensure compatibility across different web environments before being locked by encryption.
The system utilizes AES-GCM (Advanced Encryption Standard - Galois/Counter Mode) with a 256-bit key length. AES-GCM was selected for:
- Confidentiality: Keeping the content private.
- Authenticity: Ensuring the data has not been modified by third parties (tamper-proof).
Post-decryption, the .medf file contents follow this structure:
{
"_signature": {
"headerText": "{MirAI Encrypted Data Files v1.0 By Allwaysever}",
"headerCode": "037502370321034802010225010202130336030303480369034203540309030601020210029703540297010202160321033003090351010203600153014401500102020403690102020103300330036302970369035103090360030903480381",
"timestamp": "2026-01-03T04:08:01.887Z",
"version": "1.0"
},
"savedTheme": "mirai-dark",
"miraiTheme": "dark",
"miraiLanguage": "en",
"miraiPersona": "default",
"_metadata": {
"version": "2.12.0-Beta5",
"persona": "default",
"language": "id",
"exportDate": "2026-01-03T04:07:55.380Z",
"model": "gemini-2.5-flash",
"format": "mirai-backup-v2"
}
}To prevent file-type spoofing or injection attacks, .medf employs two layers of identification:
- Primary Header: Identifies the file as an authentic part of the MirAI ecosystem.
- Secondary Header: Validates the specific content type (e.g., distinguishing between a backup file and an API Key configuration).
Unlike traditional binary storage, .medf treats visual assets as text data:
- Assets/Images: Converted into Base64 Strings or SVG Code.
- Advantage: Entire datasets, including visual assets, can be bundled into a single self-contained file, eliminating the need for complex multi-file management.
Implementation is achieved using Vanilla JavaScript (specifically the window.crypto.subtle API) without third-party libraries like CryptoJS. This minimizes the attack surface and ensures maximum performance.
- Key Methods:
crypto.subtle.deriveKey():Transforms user passwords into cryptographic keys usingPBKDF2or -similar.crypto.subtle.encrypt(): Encrypts the stringified JSONpayload.crypto.subtle.decrypt(): Reverts the ciphertext back to readable data after password verification.
Encrypted Frontend Environment: Securing API Keys (serving as an encrypted ".env") within the browser environment.
- Secure Backup System: A dedicated storage container for MirAI application data backups.
- Private Data Exchange: Allowing MirAI users to share sensitive data through public channels with end-to-end encryption.
- AES-GCM: The current gold standard for symmetric encryption, providing both speed and security.
- Vanilla JS: Pure JavaScript code without external frameworks or libraries.
- Base64: A binary-to-text encoding scheme used to represent images as strings.Ciphertext: The encrypted version of the data, unreadable without the correct key.
© 2025-2026 Allwaysever Project: MirAI This project is under Apache 2.0 license