UDP API Definition: Difference between revisions

Jump to navigation Jump to search
Line 933: Line 933:
* May be executed even if not yet logged in.
* May be executed even if not yet logged in.
* The option <tt>nat=1</tt> provides an easy way to determine if the router has changed the outgoing port. ([http://tracker.anidb.info/view.php?id=587 587])
* The option <tt>nat=1</tt> provides an easy way to determine if the router has changed the outgoing port. ([http://tracker.anidb.info/view.php?id=587 587])
----
=== ENCRYPT: Start Encrypted Session ===
Will cause all future messages from the server, except the first (the reply to the ENCRYPT command itself), to be encrypted (128 bit [http://en.wikipedia.org/wiki/Advanced_Encryption_Standard AES]). The client will also have to encrypt all future requests sent to the server. All non-encrypted messages will be discarded by the server. The encryption key is the [http://en.wikipedia.org/wiki/MD5 MD5] hash of a special ''API Password'' (defined in the users profile) concatenated with the salt string as given in the reply to the ENCRYPT message. A normal AUTH message is still necessary to authenticate and should follow the ENCRYPT command once the API has acknowledged the encryption.
'''Command String:'''
* ENCRYPT user={str name}&type={int2 type}
'''Possible Replies:'''
* 209 {str salt} ENCRYPTION ENABLED
* 309 API PASSWORD NOT DEFINED
* 509 NO SUCH ENCRYPTION TYPE
* 394 NO SUCH USER
'''Info:'''
* ''user'' is the user name.
* ''type'' is the type of encryption; 1 => 128 bit AES (only one defined).
* ''API Password'' is the one defined in the profile settings [http://anidb.info/perl-bin/animedb.pl?show=profile page].
* It is not possible to disable the encryption once enabled while staying logged in.
** A logout (the logout message needs to be correctly encrypted) or timeout will disable the encryption.
* In order to minimize server load, encryption should be disabled by default and should have to be enabled manually by the user in the configuration options.
* The encryption key is md5(api_password_of_user+''salt'').
* Padding of the message needs to be done according to the PKCS5Padding scheme.


----
----