
ZRAP TECH
ZRAP OPEN_SOURCE DATA


ZRAP_TOKEN
{
"uid": "8208de7ce190aa8dca6e12ddd6b790024aa9f4fc5a902da46423a7c098d20ca0",
"id": "02908835",
"zrap_token": "fc9dc2e5c4c8f037498f1147247e37a17b8b99fbc83fa808fff37fe9a20fad3cfc9dc2e5c4de86dcb670eeb8db8a12da8474660437d97ac8fff37fe9a20477b503623d1a3b2e22f7498f11472478655c8474660437d62111000c80165dfddab2fc9dc2e5c4ce7737498f1147247e37a17b8b99fbc8392f08fff37fe9a20dbe3afc9dc2e5c4de86dcb670eeb8db8801d48474660437dfe89efff37fe9a20477b503623d1a3b28b0a9498f1147246ec64a8474660437d62111000c80165deb79acfc9dc2e5c4d8d421498f1147247e37a17b8b99fbc82f8c16fff37fe9a20b2c6cfc9dc2e5c4de86dcb670eeb8db8e938a8474660437ddfb98fff37fe9a20477b503623d1a3b2aa3a7498f11472468414a8474660437d62111000c80165dedfeac",
"internal_seal": "b615e9477deec6f678156c5067a56317885b93b0356161aea3b926efc7b20cea",
"issued_by": "Pooria Hassanpour | ZRAP Authority",
"unlock_key": "16b03b225eb338a1fc67676ccf91c6107957c343a175ec64c10a0231bbe42dc0",
"genesis_hash": "80040ee6cf9469b3699545342fa84709ec13273336a28c0bd05ca52a0d07b47a",
"effective_prime_count": 4,
"entangler_core": "core1",
"entangler_mode": 0,
"issued_at": "2026-01-30T08:34:55.229168",
"token_size_bytes": 1591,
"execution_time_ms": 25.0,
"memory_usage_mb": 40.22,
"encrypt_operations": 1,
"intermediate_data_size_kb": 0.28,
"prime_gen_rate_per_sec": 54295.2,
"io_operations": 79,
"zrap_approval_signature": "4840a34280d63bf00a276fbb505aae170ce3a940798eb7ce9213e184fb031a3d981b50b7cbf1cc5e414a179b0ee1cc05d9ef5b8d0f5a1970111fef08aeb1f0a4",
"token_salt": "fb72ac5f32a1fd028ff62c8a35e110a45be007317fef866bb0636480b5abd32f",
"identity_fingerprint": "f260290c527b4b69703ae50f3aef93729804c195b17d5c338399844707977102"
}
ZRAP AUTHENTICATION
S

ZRAP AUTHENTICATION SCRIPT
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import hashlib
import json
import os
from pathlib import Path
def generate_internal_seal(data: bytes, salt: bytes, genesis_hash: str) -> str:
layer_1 = hashlib.sha3_512(data + salt + genesis_hash.encode('utf-8')).digest()
layer_2 = hashlib.blake2b(layer_1 + genesis_hash.encode('utf-8'), digest_size=64).digest()
layer_3 = hashlib.sha256(layer_2 + salt).hexdigest()
final_seal = hashlib.sha3_256((layer_3 + genesis_hash).encode('utf-8')).hexdigest()
return final_seal
def generate_zrap_signature(json_data: str, salt: bytes, genesis_hash: str) -> str:
data_bytes = json_data.encode('utf-8')
hash_1 = hashlib.sha512(data_bytes).digest()
hash_2 = hashlib.sha3_512(hash_1 + genesis_hash.encode('utf-8')).digest()
hash_3 = hashlib.blake2b(hash_2 + salt, digest_size=64).digest()
final_signature = hashlib.sha3_512(hash_3 + genesis_hash.encode('utf-8')).hexdigest()
return final_signature
def generate_identity_fingerprint(token_id: str, salt: bytes, genesis_hash: str) -> str:
combined_data = token_id.encode('utf-8') + salt + genesis_hash.encode('utf-8')
fingerprint = hashlib.sha256(combined_data).hexdigest()
return fingerprint
def derive_third_key(zrap_token_hex: str, unlock_key: str) -> bytes:
combined = zrap_token_hex.encode('utf-8') + unlock_key.encode('utf-8')
layer_1 = hashlib.sha512(combined).digest()
layer_2 = hashlib.sha3_512(layer_1).digest()
third_key_raw = hashlib.blake2b(layer_2, digest_size=32).digest()
return third_key_raw
def verify_single_token(token_file_path):
print("\n" + "=" * 80)
print("ZRAP Token Verification System")
print("=" * 80)
print()
if not os.path.exists(token_file_path):
print(f"[ERROR] Token file not found: {token_file_path}")
return False
try:
with open(token_file_path, 'r') as f:
token = json.load(f)
except json.JSONDecodeError:
print(f"[ERROR] Invalid JSON format in token file: {token_file_path}")
return False
except Exception as e:
print(f"[ERROR] Could not read token file: {e}")
return False
print(f"Token File: {token_file_path}")
print(f"Token ID: {token.get('id', 'N/A')}")
print(f"Token UID: {token.get('uid', 'N/A')}")
print(f"Issued By: {token.get('issued_by', 'N/A')}")
print(f"Issued At: {token.get('issued_at', 'N/A')}")
print()
print("-" * 80)
print("Starting Verification Process...")
print("-" * 80)
print()
required_fields = [
'id', 'uid', 'zrap_token', 'internal_seal', 'unlock_key',
'genesis_hash', 'token_salt', 'identity_fingerprint', 'zrap_approval_signature'
]
for field in required_fields:
if field not in token:
print(f"[FAIL] Missing required field: {field}")
return False
print("[PASS] All required fields present")
print()
GENESIS_HASH = token['genesis_hash']
print(f"[INFO] Genesis Hash from token: {GENESIS_HASH[:32]}...")
print()
try:
zrap_bytes = bytes.fromhex(token['zrap_token'])
token_salt = bytes.fromhex(token['token_salt'])
except ValueError:
print("[FAIL] Invalid hex format in token or salt")
return False
calculated_seal = generate_internal_seal(zrap_bytes, token_salt, GENESIS_HASH)
if calculated_seal != token['internal_seal']:
print(f"[FAIL] Internal Seal Verification")
print(f" Expected: {token['internal_seal']}")
print(f" Calculated: {calculated_seal}")
return False
print("[PASS] Internal Seal verified")
print()
stored_fingerprint = token['identity_fingerprint']
calculated_fingerprint = generate_identity_fingerprint(
token['id'], token_salt, GENESIS_HASH
)
if calculated_fingerprint != stored_fingerprint:
print(f"[FAIL] Identity Fingerprint Verification")
print(f" Expected: {stored_fingerprint}")
print(f" Calculated: {calculated_fingerprint}")
return False
print("[PASS] Identity Fingerprint verified")
print()
token_copy = token.copy()
stored_approval = token_copy.pop('zrap_approval_signature')
data_to_verify = json.dumps(token_copy, sort_keys=True)
calculated_approval = generate_zrap_signature(data_to_verify, token_salt, GENESIS_HASH)
if calculated_approval != stored_approval:
print(f"[FAIL] ZRAP Approval Signature Verification")
print(f" Expected: {stored_approval[:64]}...")
print(f" Calculated: {calculated_approval[:64]}...")
return False
print("[PASS] ZRAP Approval Signature verified")
print()
third_key = derive_third_key(token['zrap_token'], token['unlock_key'])
print("=" * 80)
print("VERIFICATION RESULT: SUCCESS")
print("=" * 80)
print()
print("This token is authentic and has not been tampered with.")
print()
print("Token Details:")
print(f" - Token ID: {token['id']}")
print(f" - Effective Prime Count: {token.get('effective_prime_count', 'N/A')}")
print(f" - Entangler Core: {token.get('entangler_core', 'N/A')}")
print(f" - Entangler Mode: {token.get('entangler_mode', 'N/A')}")
print(f" - Token Size: {token.get('token_size_bytes', 'N/A')} bytes")
print()
print("Third Key (Customer Sovereign Key):")
print(f" - Raw (hex): {third_key.hex()}")
print(f" - Length: {len(third_key)} bytes (256 bits)")
print()
print("This key can be used to seal/unseal your customer data.")
print()
return True
def find_and_verify_all_tokens():
print("\n" + "=" * 80)
print("ZRAP Automatic Token Verification")
print("=" * 80)
print()
current_dir = os.getcwd()
print(f"Scanning directory: {current_dir}")
print()
token_files = list(Path(current_dir).glob("*.zrap"))
if not token_files:
print(f"[INFO] No .zrap token files found in current directory")
print()
print("Please ensure:")
print(" 1. You are in the correct directory")
print(" 2. Token files have .zrap extension")
print(" 3. Token files are in JSON format")
return
print(f"Found {len(token_files)} token file(s)")
print()
results = []
for token_file in token_files:
print(f"\n{'─' * 80}")
print(f"Verifying: {token_file.name}")
print(f"{'─' * 80}")
result = verify_single_token(str(token_file))
results.append((token_file.name, result))
print("\n" + "=" * 80)
print("VERIFICATION SUMMARY")
print("=" * 80)
print()
passed = sum(1 for _, result in results if result)
failed = len(results) - passed
for filename, result in results:
status = "[✓ VALID]" if result else "[✗ INVALID]"
print(f"{status} {filename}")
print()
print(f"Total: {len(results)} | Valid: {passed} | Invalid: {failed}")
print()
if __name__ == '__main__':
print("\n" + "╔" + "═" * 78 + "╗")
print("║" + " " * 20 + "ZRAP TOKEN VERIFICATION SYSTEM" + " " * 28 + "║")
print("║" + " " * 25 + "Automatic Mode" + " " * 39 + "║")
print("╚" + "═" * 78 + "╝")
find_and_verify_all_tokens()
print("\n" + "─" * 80)
print("Verification complete. Press Enter to exit...")
print("─" * 80)
input()