AUTOSAR CryptoStack general description
- CSM (crypto service manager) and CAL (crypto abstraction layer) define the same cryptographic functionality
- Support for hardware security modules
- Secure on-board communication by using APIs provided by CSM or CAL
AUTOSAR with Cryptostack layers, bird eye view
AUTOSAR complete layer architecure
AUTOSAR complete layer architecure released for ASR4.3, which contain also Cryptostack:
Crypto service manager (CSM)
Supported cryptographic services:
- Hash calculation
- Random number generation (RNG)
- Generation and verification of message authentication codes
- Encryption and decryption using symmetrical algorithms
- Generation and verification of digital signature
- Key management operations
Crypto service manager component data flow:
Crypto service manager includes structure:
Secure On-board Communication (SecOC)
SecOC was standardized to assure a secure communication inside and outside of ECU. SecOC provides PDU (message) integrity and autentification, and also ensures the “freshness” of the PDU (protecting against replay attacks). SecOC features will safeguard against injection, altering, and replay of secure I-PDUs.
Basically at the end the SecOC will secure the information (PDU) which is received or transmitted by ECU (all the signals will be protected).
Secure on board communication integration in ComStack:
CAL = Crypto Abstraction Library
SecOC = Secure On-board Communication
Security data will be added to the payload:
- Authentication code to protect the payload - can be truncated
- Freshness value – truncated, transmission is optional
Authentication code is created by using payload freshness value and secret key, and can be generated by symmetric or asymmetric cryptographic algorithms
Freshness value is part of the authentication code calculation and prevents replay attacks, can either be a simple counter or a time value.
- Freshness value must be synchronized between sender and receiver in a secure way (not part of the standard)
- Freshness value must never overflow except after the secret keys have been replaced
A message authentication code (MAC) is a short piece of information used to authenticate a message. A MAC algorithm accepts as input a secret key and an arbitrary-length message to be authenticated, and outputs a MAC. The MAC value protects both a message's data integrity as well as its authenticity, by allowing verifiers (who also possess the secret key) to detect any changes to the message content.
SecOC includes structure:
Documentation:
- https://www.autosar.org/cryptostack
- Is car hacking over? AUTOSAR SECURE ONBOARD COMMUNICATION
- Autosar Compendium - Part 1: Application & Rte, Oliver Scheid (Author)
AUTOSAR articles (for articles written in Romanian please select your language from right part of webpage)
- https://automatic-house.blogspot.com/search/label/AUTOSAR
- https://automatic-house.blogspot.com/2014/08/calcularea-crc-ului-pentru-standardul.html
- https://automatic-house.blogspot.com/2019/03/autosar1-prezentare-generala.html
- https://automatic-house.blogspot.com/2019/03/autosar2-arhitectura.html
- https://automatic-house.blogspot.com/2019/04/autosar3-comstack-can.html
- https://automatic-house.blogspot.com/2019/05/autosar5-comstack-cantp.html
- https://automatic-house.blogspot.com/2019/07/autosar6-communication-services-in.html
- https://automatic-house.blogspot.com/2021/11/autosar-7-cryptostack-basics.html
- https://automatic-house.blogspot.com/2022/11/autosar-8-communication-over-ethernet.html
- https://automatic-house.blogspot.com/2022/11/autosar-9-error-handling-and-diagnostic.html
- https://automatic-house.blogspot.com/2022/11/autosar-10-memory-stack.html
Thank you for attention !
For questions please contact me on email: simedruflorin@automatic-house.ro.
Have a nice day !