Sunday, March 31, 2013

Understanding mega:// links


From version 0.6, MegaDownloader supports mega:// links.
When you click on a mega:// link, MegaDownloader automatically opens and captures the link, so you can download them easily.
In this article, mega:// links will be explained and classified.

Mega links types

There are three basic types of Mega links:

Plain links.

These links contains the ID and the Key, similar to a normal mega link. For example, consider this link:!OFEQ0Y4Z!0123456789wVrs6n7Jyx8-9876543210nkI8MA5Gf4g

The mega:// equivalent link would be:

You can generate your own plain mega:// links just replacing "" by "mega://".

Encoded links.

This links contain the ID and the Key encoded, and the URI has the form "mega://enc?xxx".
These links are generated by both MegaDownloader and MegaUploader, by going to "Options"/"Encode URLs", or by using the right click option "See links" and selecting the "Encode URLs" option.

You can share the encoded links, and MegaDownloader will grab them when you click on them or when you copy them (if you have activated the "Capture links from Clipboard" option).

What's the target of the encoded links? It was designed with the idea of offering a basic link protection, so the user can download the file but can't know the original link.

Please take into account that the level of security offered is not very high. Links are encoded using an AES password, but a high skilled user/hacker can retrieve it and get the original link. However most of the people will not be able to do it: At this moment it is even easier to decrypt a DLC than these encoded links ;)

ELC links.

ELC is the acronym of "Encoded Link Container".

This format, that will be released with MegaDownloader 0.8 and MegaUploader 0.7, is under development, but will offer two features:
  1. Link protection: Users won't be able to know the original link.
  2. Copy protection: Only authorized users will be able to access the file.

This is achieved by using a server to validate the user that tries to download the file. The idea is that each community (forum, etc) have a page to validate users.
When you create an ELC link, you have to select the community (previously configuerd) that will be have access to the links.
Once generated, only users with a valid account in that community will be able to download the files. In this way, even if someone pastes the Mega links outside the community, nobody without a valid account in that community will be able to download the files.

Interally files will be encoded using a random AES password, that will be recodified by the server. So without a valid account, nobody would be able to retrieve the original links, so security is guaranteed. The idea behind ELC is similar to the DLC, with the difference that DLC is public so anyone can download the links inside a DLC; ELC links will be private so only members of a community will be able to download the links.

ELC links can be found as a file (*.elc extension), or as a mega:// link, with the form "mega://elc?xxx".

For using the ELC, each community has to implement two webpages: (1) one for the user, so he can see the URL, user and API-Key he has to enter into MegaDownloader's configuration, and (2) another to validate the users and encode/decode the data.

Do you want to test ELC by yourself?
Well, first you have to download the test version of MegaDownloader 0.8. Then, you have to go to "Configuration", "ELC accounts", and create a new account with this data:
  1. Alias: Put anything you want, it's just an identificative name.
  2. URL: Put the community's URL for the ELC. For this test, use a demo URL "".
  3. User: Put "test".
  4. API-Key: Put "test".

Now you will have configured a "demo" ELC account, so you can download all ELC links generated for this community.

Do you want to try an example? Click on this link, and two files will be added - if you ELC account is correctly configured!

A detailed article will explain it in depth, but meanwhile you can take a look at the source code of the demo page, available here. The encode/decode process is fully implemented (just change the password) but you will have to implement the user's validation.
Two fields will be sent on each petition: user and API-Key. The API-Key should be a code that identifies the user and only he should know it. For security, it should not be the user's password, but something like the hash of the nick + the hashed password stored in your DB, and should be shown on the first page we have commented (where the user sees the URL, user and API-Key, so he can configure MegaDownloader).

MegaDownloader and MegaUploader supports 3 types of mega:// links, with different levels of security, in order to use comfortably MegaDownloader and protect your Mega links :)

Link typeLink protectionCopy protection
Plain linksNoneNone
Encoded linksMediumNone
ELC linksHighHigh


  1. Nice Work , it's OP, i like it . :D
    By the way, donate button comes error in chinese ver.0.7 .

    1. Thanks! Will take a look at the button, thanks for reporting!

  2. Hola, quise probar crear un ELC de 10 enlaces válidos MEGA pero me manda el siguiente error:

    Error generando ELC. No se puede cargar el archivo o ensamblado
    "System.Web, Version=, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a" ni una de sus dependencias
    Excepción de la aplicación (Excepción de HRESULT: 0x80131600

    Intente cambiando la cuenta ELC de varias maneras pero no hay caso.
    Por todo lo demás el programa me anda joya, me descarga bien.

    1. Hola, eso es que no tienes la version de .NET 4.0 FULL, sino la CLIENT (una versión "recortada").
      Baja este programa para comprobarlo:
      Si es así, necesitarás instalar la versión FULL de .NET 4.0

    2. Si tenias razon con lo del NET Framework tenia una client. Ahora me instale la version Full pero ahora al crear el ELC me salta otro error. Que dice: "Error generando ELC: URI no válido no se puede determinar el formato del URI"
      Te comento cree la cuenta ELC con
      Alias: Gustavo
      URL: (la URL de la web donde quiero compartir el ELC)
      Usuario: (lo deje vacio)
      API- Key: (tampoco puse nada pero por alguna razón luego se escribe algo solo)
      Talvez estoy creando mal el usuario no se si me podrias asesorar

    3. Hola, para crear el ELC hace falta que la web lo soporte! Te pongo un link donde se explica que necesita la web para que funcione:
      Si la web no tiene esto, no podrás usar los ELC. Puedes codificar los enlaces pero no es tan seguro como un ELC.

    4. Gracias por pasarme el dato ya me quedo mas claro lo que se necesita para crear un ELC. Supongo que habra que esperar que implementen el soporte a las Webs.

  3. Its nice, but it is possible to download by folder??
    cause i found a link in a folder they have about 30files,,
    i dont know how to copy that file url...
    so idk how can i download from there...
    can you help me with that??

    this is folder url..

    thanks :D

  4. how to decode from Encoded links to Plain links?

    (use streaming to download with IDM, but can't download link folder, this why i need decode link)
    link folder -> Encoded links file -> Plain links

  5. This comment has been removed by the author.

  6. One you continue to have to be compelled to access your knowledge from your broken automatic data processing system so as to transfer files, documents and different vital info that you just want. However does one do this once your system is down? You’ll be able to use associate degree raid data recovery answer to forestall knowledge loss.

  7. This comment has been removed by the author.

  8. This comment has been removed by the author.

  9. Hi,
    Is there any way to transfer our files from Mega to filehosters(uploaded, oboom, etc..? I am asking that because When I import file on uploaded, system can't consider the link as a download link.

  10. Hola, buena tarde. Recién he instalado el programa y trate de descargar una carpeta de mi cuenta MEGA, copie el link con la clave cifrada y no me sirvió, luego fui a la opción de codificar enlaces, y puse el link con la clave cifrada, copie el enlace codificado y trate de iniciar la descarga pero tampoco me funciono, en ambos caso me sale el mensaje de error: unexpected character encountered while parsing value: .Path",line 0, position 0. ¿alguien sabe a que se debe o que estoy haciendo mal?

    1. I have the same problem, but only on one link (I can access it on chrome normally, it's just too big to download via browser), could you take a look into that?