A security product is not necessarily a cryptographic product. However since security products often involve the protection and processing of sensitive data, they typically imply the use and management of cryptographic materials. Java Card offers cryptographic packages to handle keys as trusted objects, and to support state-of-the art algorithms and related operations.
The features described in this blog entry are new cryptographic extensions to the Java Card framework. In Java Card 3.1, they have been added to the following two packages:
The Java Card 3.1 release offers the following extensions to the javacard.security and javacardx.crypto packages:
Configurable Key Pair generation Support
The API Class javacard.security.KeyPair is extended to provide means for an application to control some parameters of the asymmetric key pair generation. This helps algorithms requiring prime numbers to set up the primality test, for example Fermat or Miller-Rabin. In particular, it permits the configuration of a random number generator algorithm including the seed to be used. This last point is critical to be able to generate a key pair in a deterministic way from a known secret.
Asymmetric cryptography is critical to mutual authentication. It generally implies a client and a server, equipped with key pairs and certificates. Because of the nature and scale of the IoT market, provisioning IoT devices with such cryptographic material takes time and implies costs at manufacture. It usually binds the device to a single IoT cloud service (to which the device will be attached).
To avoid such inconvenience, some solutions and protocols rely on the injection of a secret within the device at manufacture or later. This secret (or a secret derived from it) is shared with a cloud service. Once the device is deployed, a key pair can be generated in a deterministic way on both sides using the
shared secret as a common seed. This offers a more flexible way to equip a device with the key material needed to perform authentication once in the field.
In Java Card 3.1, a new method KeyPair.genKeyPair(AlgorithmParameterSpec) is provided generate such keys is added, supporting a configuration parameter object (implementing AlgorithmParameterSpec) provided by the application. In the case of the RSA algorithm for instance, it permits to configure:
Named Elliptic Curves Support
Asymmetric cryptography based on Elliptic Curves Cryptography (ECC) is widely used. One reason of this success is the reduced processing time and low power consumption to compute encryption or signature operations - compared to RSA or DSA algorithms for instance. These characteristics make Elliptic Curves a critical requirement for low-end IoT devices.
In most of current cryptographic APIs - including the Java Card API - an ECC key is associated with a curve and its domain parameters. It offers a flexible way to match any variant of domain parameters, but implies additional management (to pass domain parameters to a key object) and memory consumption mechanisms. Furthermore, for interoperability and security reasons, standard bodies like NIST generate and publish domain parameters for common field sizes. Such domain parameters are known as "named curves" and can be directly referenced by their name. This mechanism allows a more efficient memory management, critical for IoT needs.
In Java Card 3.1, the ECC API in the javacard.security package is extended to support a set of named parameters, allowing an application to refer to these pre-defined parameters both to create and use keys, without the need to configure corresponding key parameters:
Additional Elliptic Curves
Java Card 3.1 adds support to several named curves and related key agreement, signature and encryption operations:
Additional AES modes (CFB & XTS)
Java Card 3.1 API for ciphering (javacardx.crypto.Cipher class) includes additional support to the following AES encryption modes:
Chinese Algorithms (SM2 - SM3 - SM4)
In addition to the support of the Chinese SM2 named curve described above, Java Card 3.1 API includes also support to the following Chinese algorithms:
In Summary
Each release of the Java Card Platform brings updates to its cryptographic functionality. Inclusion of the latest algorithms and operations ensures that Java Card products and applications can offer interoperable state-of-the-art cryptography features. With the support of configurable Key Pair generation, Elliptic named curves keys and operations (e.g X25519, X448, ...), Chinese Algorithms (SM2, SM3, SM4) and two additional AES modes (CFB, XTS) the Java Card 3.1 release brings major enhancements to meet the security requirements of both existing secure chips and emerging IoT technologies.
About Java Card:
Previous Post
Next Post