this is an interesting exercise in PHP
Publish hashit creates Rodi Configuration script and HTML page with Java Applet.
Content provider is expected to post Rodi Hash file (see button Save on the panel Publish), fill in IP Port and advertise the link to the Applet
User/downloader just clicks Java Applet link.
this is how simple "upload torrent" form looks like in Rodi. For the leacher this is one click process - run Java Applet. For the publisher this is slighlty longer
- publish file
- save file hash
- fill the form
- click submit
- advertise link to the Applet (e-mail, forum)
PHP source code can be found
here among interesting details.
PHP has a native support for XML. After clicking Submit PHP engine makes sure that posted file is well-formed XML. WEB designer can also, for example, add schema to the XML to make sure that it is not only well formed XML, but that it also contains mandatory fiedls, like Description or File Hash.
Name of the file, where stored starting page for the Java Applet (and all other filenames) is a random set of letters and digits - product of the PHP function tempnam(). It means that downloader has to know exact filename to gain access to the hash.
RodiHash is an XML file and WEB designer can attempt to download part of the file and add to the XML, for example, screen shot of the file or the file type enhancing this way experience of the web site visitors. In case of the text files like HTML, PDF, PS, etc. server side script can attempt to pull a couple of quotes, for example file title.
Instead or regular registration and login server can challenge the user to encrypt some arbitrary word with user's private key. Server side script attempts to decrypt the word using the public key and specified by the user nickname. No need for IP addresses, cookies, etc.
Pairs Nickname/Public key can be stored anywhere in the public domain.