TrustAuth Protocol - romaimperator/trustauth-firefox GitHub Wiki
Welcome to the specification page for the TrustAuth Protocol!
Version 1.0.0
This version defines the initial version of the specification. All messages are transmitted encoded in hex. The is is the format of ProtocolVersion which defines what version of the protocol this message is.
struct {
uint8 major;
uint8 minor;
uint8 patch;
};
There are two message types formatted as follows. The first message type is "challenge" which is the format used by the server to provide the client with a challenge.
struct {
ProtocolVersion version;
uint8 type;
uint32 time;
uint16 challenge_length;
uint16 hostname_length;
uint16 challenge[challenge_length];
uint16 hostname[hostname_length];
sha256 message_digest;
};
type is the message type given by the following enum:
MESSAGE_TYPE {
'challenge' => 0,
'response' => 1,
};
version is the version of the spec this message is.
time is the current unix time in seconds.
challenge_length is the length of the challenge in bytes.
hostname_length is the length of the hostname in bytes.
challenge is the random data used as the challenge encoded in UTF-8.
hostname is the website's full hostname encoded in UTF-8.
message_digest is the sha256 hash of all of the above data in hex.
The second message type is "response" which is created by the client and sent to the server.
struct {
ProtocolVersion version;
uint8 type;
uint32 time;
uint16 response_length;
uint16 hostname_length;
uint16 response[response_length];
uint16 hostname[hostname_length];
sha256 server_message_digest;
uint16 digest_length;
sha256 encrypted_digest;
};
version is the version of the spec this message is.
response_length and response are the same data as was provided to the client as the challenge_length and challenge.
server_message_digest is the hash given to the client in the challenge message.
digest_length is the length of the encrypted_digest.
encrypted_digest for the client is the encrypted sha256 hash of all of the above data in hex.