This subsection will demonstrate the use of the Atmel® CryptoAuthenticationTM ATECC508A device for security in conjunction with the Atmel SMART SAM D21 and ATWINC1500 Wi-Fi Network Controller to build secure and smart lock.
SMART SAM D21:
The Atmel SAM D21 Xplained Pro evaluation kit is a hardware platform to evaluate the Atmel SAMD21J18A microcontroller. Supported by the Atmel Studio integrated development platform, the kit provides easy access to the features of the Atmel SAMD21J18A and explains how to integrate the device in a custom design. Xplained Pro evaluation kits can expand their functionality by connecting Xplained Pro extension kits to them.
SMART SAM D21:
The Atmel SAM D21 Xplained Pro evaluation kit is a hardware platform to evaluate the Atmel SAMD21J18A microcontroller. Supported by the Atmel Studio integrated development platform, the kit provides easy access to the features of the Atmel SAMD21J18A and explains how to integrate the device in a custom design. Xplained Pro evaluation kits can expand their functionality by connecting Xplained Pro extension kits to them.
ATWINC1500:
Atmel® SmartConnect-WINC1500 is an IEEE 802.11 b/g/n IOT network controller SoC. It is the ideal add-On to existing MCU solutions bringing WiFi and Network capabilities through UART, I2C or SPI-to-Wi-Fi interface. The WINC1500 connects to any Atmel AVR or SMART MCU with minimal resource requirements. The WINC1500 most advanced mode is a single stream 1x1 802.11n mode providing up to 72 Mbps PHY throughput.
WINC1500 features fully integrated Power Amplifier, LNA, Switch and Power Management. The WINC1500 provides internal Flash memory as well as multiple peripheral interfaces including UART, SPI, and I2C. The only external clock source needed for the WINC1500 is a high-speed crystal or oscillator with a wide variety of reference clock frequencies supported (between 12 – 32 MHz).
The Atmel WINC1500 module runs a firmware which provides IEEE 802.11 a/b/g/n MAC functionality. It provides support for the following features:
In our project, we use Wi-Fi STA mode.
The WINC1500 firmware includes a Host Interface Layer, running on top of a set of components, including a real-time operating system (RTOS), a light-weight network stack, middleware services and a MAC control driver. The WINC1500 can interface a Host MCU using a serial interface allowing a Host MCU application with limited memory and CPU capabilities to access a wide range of connectivity features from peer-to-peer connections, LAN communication and communication with cloud servers.
- Wi-Fi STA (station) mode
- Wi-Fi AP (Access Point) mode
- Wi-Fi Direct (P2P) mode
- Wi-Fi Protected Setup
- uIP TCP/IP Stack
- Transport Layer Security TLS/SSL
- Network Protocols
- Power Saving Modes for Wi-Fi STA mode
In our project, we use Wi-Fi STA mode.
The WINC1500 firmware includes a Host Interface Layer, running on top of a set of components, including a real-time operating system (RTOS), a light-weight network stack, middleware services and a MAC control driver. The WINC1500 can interface a Host MCU using a serial interface allowing a Host MCU application with limited memory and CPU capabilities to access a wide range of connectivity features from peer-to-peer connections, LAN communication and communication with cloud servers.
The WINC1500 firmware exchanges binary messages with Host MCU application via I2C/SPI interface. The firmware encapsulates several types of Host Interface (HIF) messages such as device-specific initialization, WLAN configuration (scan, connection, disconnection) and network traffic using a BSD like socket interface (socket(), close(), bind(), listen(), accept(), send(), sendto(), recv(), recvfrom()). The WINC1500 HIF uses a “push” architecture, where data and events are pushed from WINC1500 firmware to the Host MCU in First-come, first-served manner (FCFS). The WINC1500 firmware will interrupt the Host MCU using a dedicated GPIO line whenever one or more events occur.
In our project, we used the WINC1500 to build a wireless TCP connection to Raspberry Pi.
CryptoAuthXplained:
The Atmel CryptoAuthXplained module has been designed as an Xplained series board extension. It can be used for either the Atmel Xplained or XplainedPro series of kits. The devices are soldered to the PCB. The user has to be careful with locking the devices as once the device is locked, it can no longer be configured.
The ATECC508A includes an EEPROM array which can be used for storage of up to 16 keys, certificates, miscellaneous read/write, read-only or secret data, consumption logging, and security configurations. Access to the various sections of memory can be restricted in a variety of ways and then the configuration can be locked to prevent changes.
The ATECC508A features a wide array of defense mechanisms specifically designed to prevent physical attacks on the device itself, or logical attacks on the data transmitted between the device and the system. Hardware restrictions on the ways in which keys are used or generated provide further defense against certain styles of attack.
Access to the device is made through a standard I2C Interface at speeds of up to 1Mb/s. The interface is compatible with standard Serial EEPROM I2C interface specifications. The device also supports a Single-Wire Interface (SWI), which can reduce the number of GPIOs required on the system processor, and/or reduce the number of pins on connectors. If the Single-Wire Interface is enabled, the remaining pin is available for use as a GPIO, an authenticated output or tamper input.
Using either the I2C or Single-Wire Interface, multiple ATECC508A devices can share the same bus, which saves processor GPIO usage in systems with multiple clients such as different color ink tanks or multiple spare parts, for example.
Each ATECC508A ships with a guaranteed unique 72-bit serial number. Using the cryptographic protocols supported by the device, a host system or remote server can verify a signature of the serial number to prove that the serial number is authentic and not a copy. Serial numbers are often stored in a standard Serial EEPROM; however, these can be easily copied with no way for the host to know if the serial number is authentic or if it is a clone.
In our project, we used the WINC1500 to build a wireless TCP connection to Raspberry Pi.
CryptoAuthXplained:
The Atmel CryptoAuthXplained module has been designed as an Xplained series board extension. It can be used for either the Atmel Xplained or XplainedPro series of kits. The devices are soldered to the PCB. The user has to be careful with locking the devices as once the device is locked, it can no longer be configured.
The ATECC508A includes an EEPROM array which can be used for storage of up to 16 keys, certificates, miscellaneous read/write, read-only or secret data, consumption logging, and security configurations. Access to the various sections of memory can be restricted in a variety of ways and then the configuration can be locked to prevent changes.
The ATECC508A features a wide array of defense mechanisms specifically designed to prevent physical attacks on the device itself, or logical attacks on the data transmitted between the device and the system. Hardware restrictions on the ways in which keys are used or generated provide further defense against certain styles of attack.
Access to the device is made through a standard I2C Interface at speeds of up to 1Mb/s. The interface is compatible with standard Serial EEPROM I2C interface specifications. The device also supports a Single-Wire Interface (SWI), which can reduce the number of GPIOs required on the system processor, and/or reduce the number of pins on connectors. If the Single-Wire Interface is enabled, the remaining pin is available for use as a GPIO, an authenticated output or tamper input.
Using either the I2C or Single-Wire Interface, multiple ATECC508A devices can share the same bus, which saves processor GPIO usage in systems with multiple clients such as different color ink tanks or multiple spare parts, for example.
Each ATECC508A ships with a guaranteed unique 72-bit serial number. Using the cryptographic protocols supported by the device, a host system or remote server can verify a signature of the serial number to prove that the serial number is authentic and not a copy. Serial numbers are often stored in a standard Serial EEPROM; however, these can be easily copied with no way for the host to know if the serial number is authentic or if it is a clone.
Cryptographic Operation:
The ATECC508A implements a complete asymmetric (public/private) key cryptographic signature solution based upon Elliptic Curve Cryptography and the ECDSA signature protocol. The device features hardware acceleration for the NIST standard P256 prime curve and supports the complete key life cycle from high quality private key generation, to ECDSA signature generation, ECDH key agreement, and ECDSA public key signature verification.
The hardware accelerator can implement such asymmetric cryptographic operations from ten to one-thousand times faster than software running on standard microprocessors, without the usual high risk of key exposure that is endemic to standard microprocessors.
The device is designed to securely store multiple private keys along with their associated public keys and certificates. The signature verification command can use any stored or an external ECC public key. Public keys stored within the device can be configured to require validation via a certificate chain to speed-up subsequent device authentications.
Random private key generation is supported internally within the device to ensure that the private key can never be known outside of the device. The public key corresponding to a stored private key is always returned when the key is generated and it may optionally be computed at a later time.
The ATECC508A also supports a standard hash-based challenge-response protocol in order to simplify programming. In its most basic instantiation, the system sends a challenge to the device, which combines that challenge with a secret key and then sends the response back to the system. The device uses a SHA-256 cryptographic hash algorithm to make that combination so that an observer on the bus cannot derive the value of the secret key, but preserving that ability of a recipient to verify that the response is correct by performing the same calculation with a stored copy of the secret on the recipient’s system.
Due to the flexible command set of the ATECC508A, these basic operation sets (i.e. ECDSA signatures, ECDH key agreement and SHA-256 challenge-response) can be expanded in many ways.
In our host-client configuration where the host (the lock) needs to verify a client (a user), there is a need to store the secret in the host in order to validate the response from the client. The CheckMac command allows the device to securely store the secret in the host system and hides the correct response value from the pins, returning only a yes or no answer to the system.
All hashing functions are implemented using the industry-standard SHA-256 secure hash algorithm, which is part of the latest set of high-security cryptographic algorithms recommended by various government agencies and cryptographic experts. The ATECC508A employs full-sized 256 bit secret keys to prevent any kind of exhaustive attack.