Torrent Signing
When users open torrents, they normally receive a warning to alert them of the fact that the contents may be dangerous. If we can be confident that the torrent came from a trusted source, we can forego this unnecessary hassle and users can feel safer about downloading these files. To identify the source of a torrent, RSA signatures can be embedded into the .torrent file. These signatures can veri
No reviewsSpecification
:Post-History:
Abstract
When users open torrents, they normally receive a warning to alert them of the fact that the contents may be dangerous. If we can be confident that the torrent came from a trusted source, we can forego this unnecessary hassle and users can feel safer about downloading these files.
To identify the source of a torrent, RSA signatures can be embedded into the .torrent file. These signatures can verify that the contents of the torrent have been unaltered, and by maintaining a database of trusted sources within the client, we can in turn trust the contents of the torrent.
Furthermore, an entity that signs a torrent doesn't necessarily have to represent the source of the torrent. It can represent anyone who endorses the torrent and vouches for it's safety and authenticity. Thus, a torrent may have multiple signatures.
Torrent Format
If the .torrent file is signed, it contains a signatures key whose value is a dictionary. This dictionary's keys are unique identifiers of the signing entity in reverse-dns notation (e.g. com.bittorrent). To avoid conflicts, it's highly recommended that each identifier be based on a registered domain name that is owned by the signing entity. The corresponding value for each key is another dictionary whose keys are as follows:
Signature Keys
A certificate will be trusted if it is signed by a trusted entity. However, certificate chains of arbitrary length are not yet allowed.
Format Overview
.. parsed-literal
{
"announce": ...,
"info": { ... },
"signatures": {
"com.bittorrent": {
"certificate": *optional, DER encoded x.509 certificate*,
"info": { ... } *optional*,
"signature": *signed data = info + sig info if present*,
},
...
}
}
Signing a Torrent
These steps provide OpenSSL commands as examples, but can also be done with other tools.
1. Generate a public / private key pair.
openssl genrsa -des3 -out privkey.pem 2048
2. Create a certificate request. The common name should be a unique identifier for the entity in reverse-dns notation as explained above (e.g. com.bittorrent).
openssl req -new -key privkey.pem -out cert.csr
3. Send your certificate request to a certificate authority or sign / generate your own certificate. See Generating a Certificate from a Certificate Request below.
4. Use a tool such as ut-signing-tool to sign your torrent.
Generating a Certificate from a Certificate Request
OpenSSL is provided as an example, but this can also be done with other tools.
Configure OpenSSL to not add any extensions to the certificate. This should make the certificate V1 which greatly reduces its size. To do this, comment out the following line in your openssl.cnf file:
x509_extensions = usr_cert # The extensions to add to the cert
Common locations of openssl.cnf:
OSX: /System/Library/OpenSSL/openssl.cnf
Ubuntu: /etc/ssl/openssl.cnf
RedHat: /etc/pki/tls/openssl.cnf
Other: /usr/lib/ssl/openssl.cnf
/usr/local/ssl/openssl.cnf
/usr/local/openssl/openssl.cnf
Run the following command in OpenSSL. The serial number (after -set_serial) MUST be unique for ALL certificates you issue!
openssl x509 -req -days 365 -in cert.csr -CA cert.pem -CAkey privkey.pem -set_serial 01 -out newcert.pem
References
Copyright
This document has been placed in the public domain.
..
Local Variables:
mode: indented-text
indent-tabs-mode: nil
sentence-end-double-space: t
fill-column: 70
coding: utf-8
End:
Discussion (0 threads)
Loading discussions...