ASP is a reliable, secure, comprehensive protocol that allows access to text representation of animal sounds over the internet.
Reliability: ASP runs over TCP to benefit from TCP's reliable, connection-oriented transmission capabilities.
Security: ASP provides secure animal sound transmission through state-of-the-art Caesar cipher encryption.
Comprehensiveness: ASP provides an extensive database of animal sounds based on this very comprehensive listing.
As of today, the ASP protocol is leading animal sound protocol in the market with support for 89 animals and their sounds.
A valid ASP packet looks as follows
> Version:4, Reserved:28, Key:8, Method: 32, Reserved: 24
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Key | Method |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Body ... (20 bytes) ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
These are the current fields supported by ASP. ASP is future-proof; our visionary engineers added features to ensure backward and forward compatibility with the forever changing scene of secure animal sound protocols.
You should be able to get the number of bits allocated to each field using the diagram above.
- Version: A 4-bit integer, tells the server what version of the ASP protocol the client is using.
- Reserved: There is currently two reserved slots; our veteran protocol designers decided it is for the best of the community to ensure the future-proofing of the ASP protocol while ensuring backwards-compatability. Reserved slots are ignored by the server.
- Key: Rotation offset for our battle-tested, in-house caesar cipher encryption. Number should be between 1 and 24 inclusive.
- Method: A 4-byte word instructing the server to do something (More on supported methods below as they differ from version to version)
- Body: A newline
\n
or null-terminated\x00
string used by some methods.
IMPORTANT: ASP servers return all messages encrypted with the same key provided by the client. If the client loses the key it will be unable to read server messages to it.
ASP Version 1 is severely limited. It only supports the CAPS
method.
ASP uses the battle-tested, secure Caesar Cipher algorithm for encryption using the client-provided key in some methods. These has "Encrypted." prepended to them.
In methods marked as Encrypted, clients must encrypt their Method using the key they provide in the same request.
The rest of the packet must remain unencrypted to ensure the server understands the request and how to decrypt it.
The server's response will also be fully encrypted using the same key to ensure confidentiality!
Plaintext. Returns versions supported by the server. Plaintext.
Encrypted. Returns methods supported by the server (Since a server might not be fully supporting all methods defined in its version, non-compliant).
Encrypted. Returns all stored animal names starting with the string in body. Case-sensitive.
Encrypted. Returns all stored animal sounds starting with the string in body. Case-sensitive.
Encrypted. Returns animal sound given a valid animal name as provided in body. Case-sensitive.
Exactly like version 2, just.... There is something special about this version.
Note, Cats are cute, but so are frogs ;)
-
ASP server received invalid packet size.
-
Returns plaintext:
ASPERR: Invalid packet size.
-
ASP server gets a version it doesn't support.
-
Returns plaintext:
ASPERR: Unsupported version 'x'.
-
ASP server gets a malformed packet.
-
Returns plaintext:
ASPERR: Malformed packet.
-
ASP server receives an invalid key.
-
Returns plaintext:
ASPERR: Invalid key 'x'
-
ASP server receives a malformed body.
-
Returns encrypted:
ASPERR: Invalid body.
-
ASP server receives an animal that is not available.
-
Returns encrypted:
ASPERR: Animal not found.