719.260.1625  
The cart is empty
Log in Register

Tutorials

Frequently Asked Questions (FAQ)

Q: How can I get started with the eGuard Development Kit?

A: A Getting Started Guide is located here: www.AstekCorp.com/security

Q: Will this kit work with my Arduino?

A: Absolutely. At present, this kit works with any Arduino Single Board Computer (SBC) because the Hardware Abstraction Layer (HAL) has been written specifically for the Atmel microcontroller used on Arduino. However, the security IC is microprocessor-agnostic, and future HAL versions will be written for other microprocessors and microcontrollers for other popular SBCs. These future HAL versions will also be available at GitHub.com and will operate with the present v1.0 hardware.

Q: Where do I get the code for my SBC to operate this kit?

A: The code as well as additional documentation is available at www.GitHub.com/AstekCorp/. You simply download the source code and then compile it for your Arduino.

Q: What is the supply voltage range that can be used for this kit?

A: It is designed to operate at any voltage between 3.0V to 5.5V. This typically means that either 3.3V or 5.0V will be used.

Q: What security functions will this kit perform?

A: Initially this kit will perform an authentication command. Authentication is the fundamental building block for many security operations including electronic counterfeit protection, Secure Boot, Secure Firmware update and others. In the future, additional source code and documentation will be added to GitHub that will offer additional capabilities including OpenSSL as well as other functions.

Q: What is an I2C bus?

A: I²C(Inter-Integrated Circuit), pronouncedI-squared-C, is a popular serial computer bus that is typically used for attaching lower-speed peripheral ICs to processors and microcontrollers over short-distance, intra-board communication.

Q: The Power LED is not on.

A: Check that both the VCC and GND wires are properly connected.

Q: I cannot get the bore-clean function to operate properly.

A: Verify that the I2C bus is connected properly. You can buy a Saleae probe to verify I2C is functioning. If multiple pull-ups exist on the system, try removing the jumpers, J3 and J4.

Q: When I compiled my code, I received an error about anonymous structures and anonymous unions and/or an anonymous union can only have non-static data members.

A: Add “-fpermissive” to your compiler option.

Using eGuard with Arduino

Getting Started

Unpack your eGuard IoT Security Development Kit and verify contents.

Download the library from GitHub.

Install eGuard with Arduino UNO Processor

The following pictures shows the Astek eGuard Security device connected to an Arduino UNO processor.

On Arduino UNO, the following pins are used to connect to the eGuard Security device.

eGuard Signal UNO Signal
SDA A4
SCL A5
VCC 5.0V
GND GND

 

arduino eguard1

Connecting eGuard to Arduino UNO.

arduino eguard2

Close-up view of connections to Arduino UNO.

arduino eguard3

Close-up view of connections to Astek eGuard.

For other Arduino devices, please check with your processor documentation to locate the correct pins to connect to the Astek eGuard.

Using eGuard Library and Example code with Arduino IDE

This section is specific for use of the eGuard Security devices with Arduino processors using the Arduino Sketch IDE tool.

For Arduino processors using the Ardunio Sketch IDE environment, download the library using the link:

http://github.com/AstekCorp/eGuardArduino

Download the software to a known location (e.g. c:\users\<username>\Downloads)

Library Example

Adafruit has a great tutorial for using libraries on Arduino IDE environment. It is highly recommended to use this process for the eGuardArduino library.

https://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use/arduino-libraries

A shortened summary of the steps is shown below:

  • Download eGuardArduino.zip from Github.
  • Copy contents of eGuardArduino.zip to Arduino Library directory.
  • Open Arduino Application.
  • Select File -> Examples -> eGuard. This will open the eGuardExample.ino file.
  • Select Sketch -> Verify/Compile or click CTRL-R.
  • Select Sketch -> Upload or click CTRL-U.
  • After programming the Arduino, the amber LED labelled "L" should light on if the Astek eGuard is attached to the processor.

Getting Started

The eGuard Development Kit is a general purpose development kit for adding and enhancing security features of your IoT or embedded system.

Unbox the Astek eGuard Development Kit. You should find the following items in your kit.

 unpack

  1. A0-SKT-01 Circuit Board
  2. Header wires
  3. Headers

 

Connecting to System

The Astek eGuard Development Kit is connected to the system using J2. Four (4) signals must be connected to the processor/system.

  • Serial Clock
  • Serial Data
  • Power (3.3V or 5.0V)
  • Ground

J2 

Female to female cables are included with the Development Kit for connecting the Astek eGuard Device to processor units with male headers on them. Additional headers are included with the kit to connect to processor modules containing female headers. If needed, the header can be broken apart by hand or using pliers.

Connect the signals to the processor unit as listed below.

  • SDA -> Serial Data of processor. Usually called SDA.
  • SCL -> Serial Clock of processor. Usually called SCL.
  • GND -> Ground of processor.
  • PWR -> 3.3V or 5.0V power on processor.

 

 

 

eGuard Library Commands

egAuthenticate ()

perform an authentication operation using the eGuard device. There are multiple types of authentication operations that can be performed.

Syntax

egDetectDevice (authentication_type, params)

Parameters

authentication_type – determines the type of authentication to be performed.  - AuthenticationType

          SYMMETRIC      - authenticate using a symmetric key.

PKI_DEVICE     - authenticate using device private/public key pair.

PKI_CHAIN      - authenticate using device private/public key pair and verify chain of trust to root authority.

params – a set of parameters dependent on the type of authentication being performed. - uint8_t *

          SYMMETRIC      - NULL

          PKI_DEVICE      - public key of device

          PKI_CHAIN       - NULL

Returns

ATCA_Status

Example

ATCA_STATUS status;

status = egAuthenticate(SYMMETRICc, NULL);

if (status == ATCA_SUCCESS)

          // eGuard properly accessed and authentication was successful.

else

          // eGuard could not be accessed or authentication failed.

egDetectDevice ()

verifies an eGuard device can be accessed on the I2C bus.

Syntax

egDetectDevice ()

Parameters

none

Returns

ATCA_Status

Example

ATCA_STATUS status;

status = egDetectDevice ();

if (status == ATCA_SUCCESS)

          // eGuard properly accessed.

else

          // eGuard could not be accessed.

egDevicePubKey()

Return the public key associated with the device’s private key.

Syntax

egDevicePubKey(pubkey)

Parameters

pubkey –– uint8_t[ATCA_PUB_KEY_SIZE]

Returns

Always returns ATCA_SUCCESS.

Example

ATCA_STATUS status;

uint8_t pubkey[ATCA_PUB_KEY_SIZE];

status = egDevicePubKey (pubkey);

if (status == ATCA_SUCCESS)

          // PublicKey is valid.

else

          // eGuard device not selected or PublicKey is invalid.

egGenRandom()

Returns a 32-byte random number from the eGuard device.

Syntax

egGenRandom (random_number)

Parameters

random_number – pointer to 32-byte array to hold the random_number data. – uint8_t *

Returns

ATCA_Status

Example

ATCA_STATUS status;

uint8_t random_number[32];

status = egGenRandom (random_number);

if (status == ATCA_SUCCESS)

          // eGuard properly accessed and random_number is valid.

else

          // eGuard could not be accessed and random_number is invalid.

egGetConfig()

Return the revision and information about hardware.

Syntax

egGetConfig (configuration)

Parameters

FIXME configuration – structure containing revision and hardware information. - CfgStructure

Returns

ATCA_Status

Example

ATCA_STATUS status;

FIXME: CfgStructure config;

status = egGetConfig (config);

if (status == ATCA_SUCCESS)

          // eGuard properly accessed and configuration information is valid.

else

          // eGuard could not be accessed and configuration information is invalid.

egGetRev()

Return the revision of software.

Syntax

egGetRev (software_revision)

Parameters

software_revision – character 12-byte array holding the software revision – uint8_t[SW_REVISION_SIZE]

Returns

Always returns ATCA_SUCCESS.

Example

char sw_rev[12];

egGetRev(sw_rev);

egSelectDevice()

Select an eGuard device to be used for subsequent operations.

Syntax

egSelectDevice (device_configuration)

Parameters

device_configuration – structure holding the device configuration information. The structure is built into the library and does not need to be initialized prior to use.

          The default structure to use is A0-SKT-01.

Returns

ATCA_Status

Example

ATCA_STATUS status;

status = egSelectDevice (&A0-SKT-01);

if (status == ATCA_SUCCESS)

          // eGuard device properly selected.

else

          // eGuard device not selected.

egSernum()

Reads the serial number from the eGuard device. Each eGuard device has a unique nine (9) byte serial number.

Syntax

egSernum (serial number)

Parameters

sernum – nine (9) byte serial number – uint8_t

ATCA_SERIAL_NUM_SIZE – 9 – define

Returns

ATCA_Status

Example

ATCA_STATUS status;

uint8_t sernum[ATCA_SERIAL_NUM_SIZE];

status = egSernum (sernum);

if (status == ATCA_SUCCESS)

          // eGuard device properly accessed and sernum is valid.

else

          // eGuard device could not be accessed and sernum is invalid.