Goals

Current ideas

This is my current thinking on how this should all work.

All messages header

All messages begin with these two fields.

Start of an encrypted session

Continuation of a stored encrypted session

If the recipient is not the destination, or doesn't have the given session id associated with the source, it's expected to send back an indication of this fact either using a saved session it has associated with the source, or creating a new one if necessary, but this is not required. In fact the number of these sent back should be limited as the case should be rare, and this mechanism should not be able to easily be used for a DoS attack.

pre-session information exchange

This message is sent if a source has no idea about a destination, except a location. It is used to request that information from a destination.

Repeated messages (sub-message reused by several previous messages)

This is used in several places.

The starting byte of a message can always be computed by simply adding together all the message lengths of the previous messages, which includes all the encrypted bytes and only the encrypted bytes. This is so the starting byte can be easily used with a CTR mode symmetric block cipher.

Design Thoughts

Here is rough sketch of what a session will have to track:

http://yuml.me/diagram/scruffy/class/edit/%5BSession%7CKeyName%20local;KeyName%20remote;int%20sessid;bool%20local_to_remote%5D%3C*-*%3E%5BTransport%5D,%20%5BSession%5D++-1..5%3E%5BUnusedRange%7Cint%20start;int%20end%5D,%20%5BSession%5D++-*%3E%5BCapltyHandleAssoc%7Cint%20handle;Capability%20cap%5D


Previous information

This is no longer valid, and is simply saved for easy scavenging later.

Session IDs, sequence numbers and Message IDs

A session represents a particular block cipher key and MAC key.

It's suggested that sessions be remembered for at least 5 seconds, but it is not required.

All sessions start with sequence # 0. Messages with a sequence # of 0 MUST contain a block cipher key and a MAC key signed by the source encrypted to the destination that the destination can retrieve and verify with no further messages exchanged with the source (provided that it already knows the source's full public key).

Handling of message IDs

A message id is considered a globally unique identifier for a message from the source to the destination. As such, there is some processing that should occur to ensure this rule is properly maintained.

A message id taken as a whole is a monotonically increasing number. This means that you can base a sliding window on the message id and toss out messages that are too 'old' to fit in the window. This greatly simplifies protection against replay attacks as you only have to remember the specific message ids you've recieved within the window.

Use of protocol data in higher layer protocols

The service receiving the message knows the source, the destination, and the message id. It should not worry about the internal structure of the message id. It may use these fields in its messages and reference previously seen messages by their message id.

In particular, when acknowledging reciept of data, reference to the message id being acknowledged is encouraged.

CAKE: CakeProtocol2 (last edited 2011-04-02 09:36:47 by EricHopper)