Converts data to color hashes it and rebuilds it on seperate computer with no network needed
Converts data to color hashes and rebuilds it on separate computers with no network needed
The Hashkey Desktop App is a secure, networkless file transfer system that uses cryptographic hashing and color-based data encoding. It allows you to generate hash keys from folded input data on one machine and verify/reconstruct that data on another machine without any network connection.
The system consists of four core Python scripts that work together:
- Purpose: Converts RGB color values into expanded "folded" states
- Function:
expand_rgb_to_fold_state(r, g, b) - Process:
- Tri-vector expansion (multiplies RGB values by 3)
- Converts to 8-bit binary and doubles the binary representation
- Returns both folded RGB values and binary representation
- Purpose: Generates cryptographic hash keys from user data and folded input
- Key Features:
- Creates hash objects with UID, seed phrase, input data, and timestamp
- Uses SHA-256 for cryptographic hashing
- Saves hash metadata to
~/.ai_core/hashkeys/ - Creates
known_hash.txtwith the generated hash key
- Purpose: Verifies hash keys against saved metadata
- Usage:
python3 hashkey_verifier.py <folded_input.json> <known_hash.txt> - Process:
- Loads metadata from user's saved hashkey file
- Reconstructs original hash object
- Compares generated hash with known hash
- Purpose: Recovers original folded input data from hash keys
- Features:
- Automatic recovery from saved metadata files
- Stateless recovery mode for manual reconstruction
- Interactive input prompts for missing data
- Python 3.6 or higher
- Required Python modules:
json,hashlib,os,pathlib,sys,time
Hashkey_desktop_app/
├── color_fold_encoder.py
├── hashkey_generator.py
├── hashkey_verifier.py
├── q_memory_restorer.py
├── folded_input/
│ ├── folded_input.json
│ └── known_hash.txt
└── known_hash.txt
Create this file with your folded input data:
{
"r": 128,
"g": 64,
"b": 192,
"frequency": 50,
"hue": 0.75
}r,g,b: RGB color values (0-255)frequency: Your custom frequency valuehue: Hue value (0.0-1.0)
python3 hashkey_generator.py- Enter your unique User/Device UID
- Choose "G" for Generate new
- Enter your secret seed phrase
- System reads
folded_input/folded_input.json - Generates hash key and saves to
~/.ai_core/hashkeys/
- Copy the generated
known_hash.txtto target machine - Optionally copy the metadata JSON file for easier verification
python3 hashkey_verifier.py folded_input/folded_input.json known_hash.txt- Enter the same UID used during generation
- System verifies hash integrity
python3 q_memory_restorer.py- Enter UID and seed phrase
- System attempts to reconstruct original folded input data
- Supports both automatic and manual reconstruction modes
- SHA-256 Cryptographic Hashing: Military-grade hash function
- Timestamp Integration: Prevents replay attacks
- UID-based Authentication: User/device identification
- Seed Phrase Security: Additional entropy layer
- Networkless Operation: Air-gapped security
Update the following in your scripts:
- Change
"== AI-Core HashKey Desktop Prototype =="to your organization - Update directory paths from
".ai_core"to your preferred location
Currently uses SHA-256. To change:
# In hashkey_generator.py and related files
return hashlib.sha256(json_bytes).hexdigest() # Change to sha512, md5, etc.Modify these paths in the scripts:
# Default location
hashkeys_dir = Path.home() / ".ai_core" / "hashkeys"
# Customize to your needs
hashkeys_dir = Path.home() / ".your_app" / "keys"{
"uid": "user_device_identifier",
"seed": "secret_seed_phrase",
"input": {
"r": 128,
"g": 64,
"b": 192,
"frequency": 50,
"hue": 0.75
},
"timestamp": 1672531200.0,
"hash_key": "generated_sha256_hash"
}Simple text file containing the generated hash:
a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456
The system includes robust error handling for:
- Missing files and directories
- Invalid JSON format
- Network connectivity issues (by design - networkless)
- Hash verification failures
- Invalid user input
- Keep seed phrases secret - Never share or store in plain text
- Use unique UIDs - Different for each user/device combination
- Secure folded_input.json - This is your encryption key
- Verify hash integrity - Always run verification on target machine
- Clean up temporary files - Remove known_hash.txt after use
- "folded_input.json not found": Create the file with proper JSON structure
- "Hash mismatch": Verify UID, seed phrase, and input data match exactly
- "Metadata file not found": Run hash generation first, or use stateless recovery mode
- Permission errors: Ensure write access to home directory
MIT License - See LICENSE file for details
This project is designed for secure, networkless file transfer. When contributing:
- Maintain cryptographic integrity
- Preserve networkless operation
- Follow secure coding practices
- Test thoroughly before deployment