{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [] }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "code", "execution_count": 5, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 715 }, "id": "lsD4rHr7aveK", "outputId": "5b08ce64-8f69-47fb-cfe7-f726134864b4" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "============================================================\n", " LEVIATHAN 3.1 - SUBIR ARCHIVO PARA HASHEAR\n", "============================================================\n", "\n", "Selecciona cualquier archivo...\n", "\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "\n", " \n", " \n", " Upload widget is only available when the cell has been executed in the\n", " current browser session. Please rerun this cell to enable.\n", " \n", " " ] }, "metadata": {} }, { "output_type": "stream", "name": "stdout", "text": [ "Saving P_=_NP_3_SAT_→_Degree_3_Polynomial_System_over_F₂_→_CAS_Solver.ipynb to P_=_NP_3_SAT_→_Degree_3_Polynomial_System_over_F₂_→_CAS_Solver (1).ipynb\n", "\n", "Archivo: P_=_NP_3_SAT_→_Degree_3_Polynomial_System_over_F₂_→_CAS_Solver (1).ipynb\n", "Tamano: 55,153 bytes (53.86 KB)\n", "Generando Leviathan Hash...\n", "\n", "============================================================\n", " FUENTE: P_=_NP_3_SAT_→_Degree_3_Polynomial_System_over_F₂_→_CAS_Solver (1).ipynb\n", " TAMANO: 55,153 bytes\n", " LARGO HASH: 1024 caracteres\n", "============================================================\n", "\n", "LEVIATHAN HASH:\n", "\n", " v2Ob2@ubrfuZgH,_[Wrl+$lo}TcC-e|OiYmF!l:K]^5=;gHHA+0YU8eYeF@H:4pJ\n", " yNN^5fD)tBb*^DN[XF8r6Y.Jtu(5Bb!9-SOqxUGG|l9yG;reZ3@)kx27gj0U!Z&N>54#K=SX-\n", " W*gezMLa%7Z_@WE[BqGiX;Fv[bKi*S4_7nP-tjo()oMT5DkF8,S|6|hAsvrYHP%$\n", " E,s6b]wqMGg|h^xH,b_Him76D=o),u{}(PMUrp%GY[_%ERex$j:^Te^b}Ff9A^%p\n", " 6}Ri^a}Q.z@55d@&6F9m3AN$kvi0w6COSI08;qC.&ttxb_+>{+[_2KHD&wByd3R?\n", " |2;y9zi|O61FC-YC*;={|Hex-;67J!]sISaqrZFP6)|%#]3AU,>O&[_rM{)1%(NF\n", " g:SMun1JZa=z=t3?^0t3<{ffc;v-C2x@[[y(=b^4SX!r]qQfx:SYu*>jtD=Mtn{B\n", " _P2OZ&kodjr44yf$gYUgSh{U0}Xgdy1*=$+Y%(WxZD4r%6Wxy.\n", " ](_.4W>sddfB:,];jwZ8MT|1GIuvpx:e8GE=wA(yZ:pMZ8[zOH#]wpV_pzfM6-qr\n", " oVe@po]}4CLX}4N$wY}RmWfMfmUR\n", "\n", "============================================================\n" ] } ], "source": [ "import sys\n", "import hashlib\n", "import os\n", "from google.colab import files\n", "\n", "sys.set_int_max_str_digits(0)\n", "\n", "PART_1 = \"1\" + \"3\" * 5000\n", "PART_2 = \"7\" + \"9\" * 5000 + \"1\"\n", "LEVIATHAN_PRIME_CONST = int(PART_1 + PART_2)\n", "\n", "def leviathan_hash_v3_turbo_deterministic(data_bytes):\n", " if not data_bytes:\n", " return \"ERROR: The Fractal Void is empty.\"\n", "\n", " data = list(data_bytes)\n", " n_input = len(data)\n", " buffer_size = max(n_input * 4, 256)\n", " fractal_carry = 0x9e3779b97f4a7c15\n", " displaced_buffer = [None] * buffer_size\n", "\n", " for i, byte_val in enumerate(data):\n", " fractal_carry = ((fractal_carry << 5) ^ (fractal_carry >> 3)) ^ (byte_val * (i + 1999))\n", " target_index = (i + byte_val + fractal_carry) % buffer_size\n", " attempts = 0\n", " while displaced_buffer[target_index] is not None:\n", " attempts += 1\n", " jump_step = (attempts * attempts) + (fractal_carry % 13)\n", " target_index = (target_index + jump_step) % buffer_size\n", " displaced_buffer[target_index] = byte_val ^ (fractal_carry & 0xFFFFFF)\n", "\n", " buffer_sum = sum(x for x in displaced_buffer if x is not None)\n", " final_seed_val = LEVIATHAN_PRIME_CONST + buffer_sum + fractal_carry\n", " final_seed_bytes = str(final_seed_val).encode()\n", " crypto_seed = hashlib.sha512(final_seed_bytes).digest()\n", "\n", " valid_buffer = [x for x in displaced_buffer if x is not None]\n", " shuffle_entropy = hashlib.shake_256(crypto_seed).digest(len(valid_buffer) * 4)\n", " for i in range(len(valid_buffer) - 1, 0, -1):\n", " j = int.from_bytes(shuffle_entropy[i*4:(i+1)*4], \"big\") % (i + 1)\n", " valid_buffer[i], valid_buffer[j] = valid_buffer[j], valid_buffer[i]\n", "\n", " charset = (\n", " \"abcdefghijklmnopqrstuvwxyz\"\n", " \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n", " \"0123456789!@#$%^&*()_+-=[]{}|;:,.<>?\"\n", " )\n", " charset_len = len(charset)\n", " buffer_len = len(valid_buffer)\n", " entropy_stream = hashlib.shake_256(crypto_seed).digest(1024 * 4)\n", "\n", " output_chars = []\n", " for i in range(1024):\n", " val = valid_buffer[i % buffer_len]\n", " offset = i * 4\n", " jump = int.from_bytes(entropy_stream[offset:offset+4], \"big\")\n", " char_idx = (val + jump + (i * val)) % charset_len\n", " output_chars.append(charset[char_idx])\n", "\n", " return \"\".join(output_chars)\n", "\n", "# === SUBIR ARCHIVO DESDE TU PC ===\n", "print(\"=\" * 60)\n", "print(\" LEVIATHAN 3.1 - SUBIR ARCHIVO PARA HASHEAR\")\n", "print(\"=\" * 60)\n", "print()\n", "print(\"Selecciona cualquier archivo...\")\n", "print()\n", "\n", "uploaded = files.upload()\n", "\n", "for filename, content in uploaded.items():\n", " file_size = len(content)\n", "\n", " print()\n", " print(f\"Archivo: {filename}\")\n", " print(f\"Tamano: {file_size:,} bytes\", end=\"\")\n", " if file_size >= 1024 * 1024 * 1024:\n", " print(f\" ({file_size / (1024**3):.2f} GB)\")\n", " elif file_size >= 1024 * 1024:\n", " print(f\" ({file_size / (1024**2):.2f} MB)\")\n", " elif file_size >= 1024:\n", " print(f\" ({file_size / 1024:.2f} KB)\")\n", " else:\n", " print()\n", "\n", " print(\"Generando Leviathan Hash...\")\n", " print()\n", "\n", " result = leviathan_hash_v3_turbo_deterministic(content)\n", "\n", " print(\"=\" * 60)\n", " print(f\" FUENTE: {filename}\")\n", " print(f\" TAMANO: {file_size:,} bytes\")\n", " print(f\" LARGO HASH: {len(result)} caracteres\")\n", " print(\"=\" * 60)\n", " print()\n", " print(\"LEVIATHAN HASH:\")\n", " print()\n", " for i in range(0, len(result), 64):\n", " print(f\" {result[i:i+64]}\")\n", " print()\n", " print(\"=\" * 60)" ] } ] }