# Cryptographic mechanisms

Here you will find a brief definition of the cryptographic mechanisms used by Seald.

Their implementation used in Seald is SSCrypto (opens new window).

# Randomness generation

Depending on the target environment, different random generators are used:

# Asymmetric key pair generator

The keys used are of type RSA (see RFC 8017 (opens new window)).

Depending on the target environment, different asymmetric key pair generators are used:

# Symmetric encryption

To encrypt symmetrically, two algorithms are used to ensure both confidentiality and integrity: an encryption scheme that provides confidentiality only, and a MAC to ensure integrity.

# Sizing

Two symmetric keys are used

  • a 256-bit encryption key noted encryptionKey;
  • a 256-bit key for the MAC, noted authenticationKey.

Their concatenation in this order is noted messageKey.

# Lifetime

Keys are used for an indefinite period of time for the data they protect.

# Encryption

Symmetric encryption of clearText with a messageKey (concatenation of encryptionKey and authenticationKey) to obtain cipheredMessage is done as follows

# Decryption

Symmetric decryption of cipheredMessage (concatenation of iv, cipherText, and hmac) with a messageKey (concatenation of encryptionKey and authenticationKey) to obtain clearText is done as follows:

# Envelope

When using the SDK, cipheredMessage is put in an envelope format:

# Implementation

The implementation used depends on the target environment;

# Asymmetric cryptography

The keys used are of type RSA (see RFC 8017 (opens new window)).

One pair of keys is reserved for encryption operations, another for signature operations.

# Sizing

The keys are generated with a modulus n of 4096 bits and a public exponent e of 65537.

# Lifetime

These keys are generated for a duration not exceeding 157680000 seconds (5 years), with a default lifetime of 94608000 seconds (3 years).

# Asymmetric encryption

The asymmetric encryption of a clearText with a public key (n,e) given to obtain cipheredMessage is performed as follows

TIP

The use of SHA-1 as a hash function in RSAES-OAEP is robust and compliant with RGS v2.0 (see §B1.2.2.2) (opens new window), even considering that collisions are possible. For more information, see What Hashes Make RSA-OAEP Secure? (opens new window).

# Asymmetric decryption

Asymmetric decryption of a cipheredMessage with a private key denoted K given to obtain clearText is performed as follows:

# Signature

The production of a signature signature of a textToSign using a private key denoted K is performed as follows:

# Signature verification

Verification of a signature signature of a textToSign using a public key denoted (n,e) associated with the private key K used to sign is performed as follows:

# Implementation

The implementation used depends on the target environment;

# Key derivation

Deriving a key from a passphrase and a salt to obtain key is done as follows

  • derivation:
    • algorithm: SCrypt (opens new window), with the following parameters:
      • N: 16384;
      • r: 8;
      • p: 1;
      • output size: 64 bytes;
    • arguments: passphrase and salt given;
    • result: key;
  • return: key.

# Implementation

The implementation used depends on the target environment;