Sunday, October 28, 2012

Simple lossy license protocol

This package implements data binding and operating for a server access protocol. This protocol is a range of intended applications.

        license.Key key = new license.Key().create(1024);
        license.Nonce nonce = new license.Nonce().create(1024);

        license.Function function = new license.Function();

        if (function.xor(key,nonce)){

          license.Hash hash = function.digest(license.Hash.class);
Communicating the hash of a shared secret key and the server's nonce, a client and server validate an identified client as knowing the shared secret.

See also test/src/


A shared secret is hashed with a nonce to express knowledge of the shared secret.

License Client

Knows the public identifier, and the shared secret key. Needs license access rights with the Server.

License Server

Creates and stores the public identifier and the shared secret key, offers license access rights to anyone with the identifier and key.

License Identifier

A long random number. Length determined as a probabilistic (collision) multiple of the planned number of clients, for example 64 bits.

License Key

A long random number. Same length as Nonce, greater than or equal to 1024.

License Nonce

A long random number for one use only offered to any requestor with a valid identifier. Same length as Key, greater than or equal to 1024.

License Hash

A long random number -- the hash of the Key and Nonce using SHA-1 or SHA-2. Length determined by the hash function.


A license protocol client executable is distributed to licensed users by a license protocol server.

A public identifier and secret key is created by the Server and shared with (copied to) a Client.

The Client begins a stateful conversation with a Server by requesting a Nonce for its Identifier.

The Nonce and Key are combined and hashed by the Client, and copied to the Server (with its Identifier).

The Server accepts or rejects the Hash string as establishing license access rights.

Key sharing

Copy methods are designed according to application privacy requirements and delivery processes.

A key distributed with software supports only (very) low risk applications.

A key distributed out of band, for example by postal mail, supports (only) slightly more risk.

Nonce Key Hashing

XOR the Key and Nonce into an intermediate bit string.

Apply a known hash function to the intermediate bit string.

Copy the hash output bit string.


This simple lossy license protocol may be applicable to a small class of open services.

It has numerous defeats (successful attack vectors), sufficient to (very) light protection of license access rights.

Some applications exist that need to avoid general access, only.

Applications intended for unique licensing may decide that sharing is a manageable risk, while others may enjoy sharing.

A lossy management of sharing may be possible using statistical methods. For example, summarizing or visualizing client IP and access logs for a sales staff. Given a known relationship, usage patterns may be self evident. For example, clients having one static IP address.

No comments: