$Lock

From DCppWiki

Jump to: navigation, search

Contents

Syntax

$Lock <lock> Pk=<pk>|

Description

This command is presumably used to make sure that only the original DC client (NMDC) would be able to connect to Direct Connect Hubs and Clients. Hubs are not required to check the validity of the returned key, but they must send this command.

  • <lock> is a sequence of random characters (except (space), $, |, (?more?)), the minimum and maximum length is not known.
  • It is not known what the <pk> is for. and some client implementations skip the Pk= part altogether (DC++ can cope with this, presumably NMDC as well).

This command is used in the Client-Hub Handshake, the Client-Client Handshake and the Hublist Registration. The other party has to authenticate itself using the LockToKey function. The algorithm used has been decrypted however, so now anyone may create a client for the DC network.

The client never has to send a $Lock to the hub. Clients have to send a $Lock when two clients connect to eachother.

Example lock for DC++-0.242:

$Lock EXTENDEDPROTOCOLABCABCABCABCABCABC Pk=DCPLUSPLUS0.242ABCABC|

The "ABCABC" section is just fillers.

NMDC Hub specific behaviour

  • Lock length: 46 to 115
  • Pk length: 16
  • Characters: random, from code 37 to 122

See also

$Key