3.1 Encryption

In the Linux® secure boot environment, two programs are encrypted: the at91bootstrap program and U-Boot. The at91bootstrap program is encrypted to prevent access to the keys that are used to authenticate U-Boot. If at91bootstrap were not encrypted, it would be fairly easy to forge the next stage of software in the boot process because at91bootstrap uses a symmetric key for authentication.

The encryption algorithm used for both at91bootstrap and U-Boot is AES. AES is a symmetric encryption algorithm, meaning that the same key is used for both encryption and decryption. AES keys can be 128, 192 or 256 bits long. The key must be shared between the system that encrypts the data and the system that decrypts it.

AES is a block cipher, which means it operates on a block of data rather than a data stream. The block size is 128 bits, regardless of the key size being used. Stream ciphering can be achieved by combining AES block-level encryption with another mechanism, such as chaining.

Cipher Block Chaining (CBC) mode is used by both the secure boot ROM code and at91bootstrap to encrypt and decrypt the firmware running on the system.

The image is encrypted using AES-CBC mode.

Figure 3-1. Cipher Block Chaining Mode Encryption

The boot ROM and the bootloader use AES-CBC decryption, as described below.

Figure 3-2. Cipher Block Chaining Mode Decryption