{"id":26207163,"url":"https://github.com/tonikelope/megacrypter","last_synced_at":"2025-04-15T09:47:26.979Z","repository":{"id":23330471,"uuid":"26690731","full_name":"tonikelope/megacrypter","owner":"tonikelope","description":"Anonymous crypted url forwarding web application for MEGA links.","archived":false,"fork":false,"pushed_at":"2022-10-10T16:11:55.000Z","size":2337,"stargazers_count":60,"open_issues_count":2,"forks_count":26,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T18:54:42.757Z","etag":null,"topics":["encryption","links","mega","protection"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tonikelope.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-15T19:17:27.000Z","updated_at":"2025-02-25T20:23:22.000Z","dependencies_parsed_at":"2023-01-13T23:08:32.302Z","dependency_job_id":null,"html_url":"https://github.com/tonikelope/megacrypter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonikelope%2Fmegacrypter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonikelope%2Fmegacrypter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonikelope%2Fmegacrypter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonikelope%2Fmegacrypter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tonikelope","download_url":"https://codeload.github.com/tonikelope/megacrypter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249048376,"owners_count":21204304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["encryption","links","mega","protection"],"created_at":"2025-03-12T05:30:59.805Z","updated_at":"2025-04-15T09:47:26.955Z","avatar_url":"https://github.com/tonikelope.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Alt text](/public/images/lock.png?raw=true \"MC logo\")![Alt text](/public/images/logo.png?raw=true \"MC logo\")\n\n\u003ch1 align=\"center\"\u003e\u003ca href=\"https://youtu.be/YvyG3KyOJb0\"\u003eDEMO\u003c/a\u003e\u003c/h2\u003e\n\n\u003ch1 align=\"center\"\u003e\u003ca href=\"https://youtu.be/z9B82X_HBg4\"\u003eDEMO 2 (video streaming)\u003c/a\u003e\u003c/h2\u003e\n\n![Diagrama](https://tonikelope.github.io/megacrypter/images/diagrama.png?raw=true\u0026t=1 \"Diagrama\")\n\n## What do you need to deploy your own Megacrypter?\n\n1. Apache (mod_rewrite ON) (Or another web server that supports URL rewrite)\n\n2. PHP \u003e= 5.5 (cURL + memcache + mbstring)\n\n3. MySQL (optional for blacklist).\n\n### 5 steps installation instructions:\n\nStep 1: download tarball (or clone repo) and upload to your server.\n\nStep 2: install composer dependencies -\u003e \u003ccode\u003e$ php composer.phar install\u003c/code\u003e\n\nStep 3: rename ALL /config .sample extension and edit miscellaneous.php and any other file you need.\n\nStep 4: prepare Apache virtual host:\n\n```\n\u003cVirtualHost *:80\u003e\n  Servername megacrypter.mydomain\n  DocumentRoot /var/www/megacrypter/public\n  RewriteEngine On\n  \u003cdirectory /var/www/megacrypter/public\u003e\n    AllowOverride None\n    Include /var/www/megacrypter/public/.htaccess\n  \u003c/directory\u003e \n\u003c/VirtualHost\u003e\n```\n\nStep 5: ask developers of your favourite download manager to recognize your new megacrypter links (or give it a try to [Megabasterd](https://github.com/tonikelope/megabasterd) that supports any MC clon)\n\nYou're alone from here. Good luck!\n\n## API DOC\n\n```\nAPI URL -\u003e http(s)://[BASE_URL]/api\n(Content-Type: application/json)\n```\n\n### Protecting MEGA links\n#### Request:\n```\n{\"m\": \"crypt\", \n\"links\": [\"MEGA_LINK_1\", \"MEGA_LINK_2\" ... \"MEGA_LINK_N\"],\n*\"expire\": 0-6,\n*\"no_expire_token\": true OR false,\n*\"tiny_url\": true OR false,\n*\"app_finfo\": true OR false,\n*\"hide_name\": true OR false,\n*\"pass\": \"PASS\",\n*\"referer\": \"DOMAIN_NAME\",\n*\"extra_info\": \"EXTRA_INFO\",\n*\"email\": \"EMAIL\",\n*\"folder_node_list\": [\"NODE_ID_1\", \"NODE_ID_2\" ... \"NODE_ID_N\"]}\n```\n##### *Optional params:\n1. Expiration values: 0 -\u003e never (default), 1 -\u003e 10 minutes, 2 -\u003e 1 hour...\n2. True by default.\n3. Tiny url option is false by default.\n4. Append file info option is false by default.\n5. Hide name option is false by default.\n6. Passwords are case-sensitive.\n7. Referer is not required to include 'http://'. It's limited to 256 chars\n8. Extra-info is limited to 256 chars.\n9. Email is limited to 256 chars.\n10. Only encrypt and return the indicated folder child nodes.\nNote: link list is limited to 500\n\n#### Response:\n```\n{\"links\": [\"MC_LINK_1\", \"MC_LINK_2\" ... \"MC_LINK_N\"]}\n```\n\n### Retrieving link information\n#### Request:\n```\n{\"m\": \"info\", \n\"link\": \"MC_LINK\",\n*\"reverse\": \"port:b64_proxy_auth[:host]\"}\n```\n##### *Optional params:\n1. Reverse query: Megacrypter will connect to MEGA API using HTTPS proxy running on the client. Client must send port and 'user:password' (base64 encoded) for proxy auth (host is optional).\n\n#### Response:\n```\n{\"name\": \"FILE_NAME\" OR \"CRYPTED_FILE_NAME\", \n\"path\": false OR \"PATH\" OR \"CRYPTED_FILE_PATH\",\n\"size\": FILE_SIZE, \n\"key\": \"FILE_KEY\" OR \"CRYPTED_FILE_KEY\",\n\"extra\": false OR \"EXTRA_INFO\" OR \"CRYPTED_EXTRA_INFO\",\n\"expire\": false OR \"EXPIRE_TIMESTAMP#NOEXPIRE_TOKEN\",\n\"pass\": false OR \"ITER_LOG2#KCV#SALT#IV\"}\n```\n##### About password protected files: \n\nFile name, file key, and extra-info will be returned crypted using AES CBC (PKCS7) with 256 bits key derivated from pass (PBKDF2 SHA256).\n\nFollow this algorithm to decrypt crypted fields:\n\n```\nREPEAT\n        \n    password := read_password()\n    \n    info_key := hmac := hmac_sha256(password, base64_dec(SALT) + hex2bin('00000001'))\n    \n    FOR i=2 : 1 : pow(2, ITER_LOG2)\n        \n        hmac := hmac_sha256(password, hmac)\n    \n        info_key := info_key XOR hmac\n    \n    END\n\nUNTIL aes_cbc_dec(base64_dec(KCV), info_key, base64_dec(IV)) = info_key\n\ncrypted_field := aes_cbc_dec(base64_dec(CRYPTED_FIELD), info_key, base64_dec(IV))\n```\n\n### Getting a temporary download url to the (crypted) file\n#### Request:\n```\n{\"m\": \"dl\", \n\"link\": \"MC_LINK\",\n*\"ssl\": true OR false,\n*\"noexpire\": \"NOEXPIRE_TOKEN\",\n*\"sid\" : \"MEGA_SID\",\n*\"reverse\": \"port:b64_proxy_auth[:host]\"}\n```\n##### *Optional params:\n1. Default is false (better performance in slow machines)\n2. If link has expiration time you can use NOEXPIRE_TOKEN (cached from a previous \"info-request\") to bypass it and get the download url.\n3. MEGA SESSION ID (for download MegaCrypter link using your MEGA PRO ACCOUNT)\n4. Reverse query: Megacrypter will connect to MEGA API using HTTPS proxy running on the client. Client must send port and 'user:password' (base64 encoded) for proxy auth (host is optional).\n\n#### Response:\n```\n{\"url\": \"MEGA_TEMP_URL\" OR \"CRYPTED_MEGA_TEMP_URL\",\n\"pass\": false OR \"IV\"}\n```\n\nNote: use the same algorithm described above to decrypt temp url (if password protected)\n\n\n### Error responses (because shit happens...)\n```\n{\"error\": ERROR_CODE}\n```\n\n#### Error codes:\n```\nMC_EMETHOD(1)\nMC_EREQ(2)\nMC_ETOOMUCHLINKS(3)\nMC_ENOLINKS(4)\nMC_INTERNAL_ERROR(21)\nMC_LINK_ERROR(22)\nMC_BLACKLISTED_LINK(23)\nMC_EXPIRED_LINK(24)\nMEGA_EINTERNAL(-1)\nMEGA_EARGS(-2)\nMEGA_EAGAIN(-3)\nMEGA_ERATELIMIT(-4)\nMEGA_EFAILED(-5)\nMEGA_ETOOMANY(-6)\nMEGA_ERANGE(-7)\nMEGA_EEXPIRED(-8)\nMEGA_ENOENT(-9)\nMEGA_ECIRCULAR(-10)\nMEGA_EACCESS(-11)\nMEGA_EEXIST(-12)\nMEGA_EINCOMPLETE(-13)\nMEGA_EKEY(-14)\nMEGA_ESID(-15)\nMEGA_EBLOCKED(-16)\nMEGA_EOVERQUOTA(-17)\nMEGA_ETEMPUNAVAIL(-18)\nMEGA_ETOOMANYCONNECTIONS(-19)\nMEGA_EWRITE(-20)\nMEGA_EREAD(-21)\nMEGA_EAPPKEY(-22)\nMEGA_EDLURL(-101)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonikelope%2Fmegacrypter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftonikelope%2Fmegacrypter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonikelope%2Fmegacrypter/lists"}