encryption_algorithm_class Enum
namespace keychain
→ enum 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
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
Related Types
-
encryption_scheme - Specific encryption algorithms
-
signature_algorithm_class - Signature algorithm families
See Also
-
gateway - Encryption operations
-
encrypted_data - Encrypted data containers
-
{ieee-1363}[IEEE 1363 Standard]
-
{rfc-8017}[RFC 8017 PKCS#1]