VatiCAN Library Documentation


VatiCAN is written in C++ and uses cryptographic functions for the following parts:

  • Message Authentication
    Messages are authenticated by applying a 64-bit KECCAK Message Authentication Code (MAC)
    KECCACK is provided by
  • Global Nonce Generation
    The necessary global nonce to achieve freshness is calculated by the GLobal Nonce Generator (GNG) using a streamcipher from the ECRYPT project:
    The SALSA20 streamcipher can produce a maximum of 270 bits. VatiCAN uses 64-bit nonces and can thus generate 270-6 = 264 nonces. Nonces are generated in regular intervals. In the example code, nonce generation is triggered every second. This leads to a total possible life time of 584 billion years of driving with VatiCAN.
  • CAN Bus Communication
    VatiCAN for Arduino builds upon the MCP_CAN library for the SeeedStudio CAN Bus shields:

Serial Monitor / Example Usage

It’s best to open two serial monitors at the same time to investigate both ends of the communication. Unfortunately, the Arduino IDE does only support one serial monitor at the same time.

  1. Open the serial monitor at 115200 baud (8N1) and wait for the menu to come up.
    VatiCAN Menu
  2. On one side only, press N to start the nonce generator (this could also be done by a third Arduino)
  3. You can watch the currently active nonce by pressing S to show the statistics.
  4. Press L a few times to send legacy CAN bus messages that are not authenticated. The round-trip-time (RTT) for the entire ping-poing forth and back between the two Arduinos is displayed.
  5. Press V a few times to send an authenticated VatiCAN message. The RTT for the entire ping-pong, including the two additional authentication messages is then displayed in ┬Ás.
  6. Press S again to show the statistics. These now include the single trip time for VatiCAN messages.
    Statistics for VatiCAN

C++ Files