encryption_algorithm_class Enum

namespace keychainenum class encryption_algorithm_class

Overview

The encryption_algorithm_class enumeration categorizes public key encryption algorithms by their mathematical foundations and cryptographic properties.

Syntax

namespace keychain {
    enum class encryption_algorithm_class {
        ECIES,      // Elliptic Curve Integrated Encryption Scheme
        RSA,        // RSA encryption
        DLIES,      // Discrete Logarithm Integrated Encryption Scheme
        ELGAMAL     // ElGamal encryption
    };
}

Members

ECIES

Value: encryption_algorithm_class::ECIES

Elliptic Curve Integrated Encryption Scheme family.

Characteristics: * Based on elliptic curve cryptography * Efficient key sizes (256-bit ≈ 3072-bit RSA) * Fast computation * Built-in key derivation and MAC

RSA

Value: encryption_algorithm_class::RSA

RSA encryption algorithm family.

Characteristics: * Based on integer factorization problem * Well-established and widely supported * Larger key sizes required for equivalent security * PKCS#1 padding schemes

DLIES

Value: encryption_algorithm_class::DLIES

Discrete Logarithm Integrated Encryption Scheme family.

Characteristics: * Based on discrete logarithm problem * Similar structure to ECIES * Uses finite field arithmetic * Integrated encryption with MAC

ELGAMAL

Value: encryption_algorithm_class::ELGAMAL

ElGamal encryption algorithm family.

Characteristics: * Based on discrete logarithm problem * Probabilistic encryption * Malleable ciphertexts * Larger ciphertext size

Usage

#include <keychain/keychain.h>

// Check algorithm class compatibility
keychain::encryption_scheme scheme = keychain::encryption_scheme::ECIES_P256_AES_128_GCM;
keychain::encryption_algorithm_class alg_class = scheme.get_algorithm_class();

if (alg_class == keychain::encryption_algorithm_class::ECIES) {
    // Handle ECIES-specific logic
    std::cout << "Using elliptic curve encryption" << std::endl;
}

// Algorithm class comparison
bool is_ecc_based(keychain::encryption_algorithm_class alg_class) {
    return alg_class == keychain::encryption_algorithm_class::ECIES;
}

bool requires_large_keys(keychain::encryption_algorithm_class alg_class) {
    return alg_class == keychain::encryption_algorithm_class::RSA ||
           alg_class == keychain::encryption_algorithm_class::DLIES ||
           alg_class == keychain::encryption_algorithm_class::ELGAMAL;
}

Algorithm Comparison

Algorithm Class Key Size (bits) Security Level Performance Standardization

ECIES

256-521

High

Excellent

IEEE 1363, SEC 1

RSA

2048-4096

High

Good

PKCS#1, RFC 8017

DLIES

2048-3072

High

Good

Limited

ElGamal

2048-3072

High

Moderate

IEEE 1363

Security Considerations

ECIES

  • Resistant to quantum attacks (with post-quantum curves)

  • Efficient implementation

  • Side-channel attack considerations

RSA

  • Vulnerable to quantum attacks (Shor’s algorithm)

  • Requires secure padding (OAEP)

  • Timing attack considerations

DLIES

  • Similar security properties to ECIES

  • Less common implementation

  • Parameter generation critical

ElGamal

  • Semantic security with proper randomization

  • Malleable encryption property

  • Chosen ciphertext attack considerations

See Also

  • gateway - Encryption operations

  • encrypted_data - Encrypted data containers

  • {ieee-1363}[IEEE 1363 Standard]

  • {rfc-8017}[RFC 8017 PKCS#1]