sgcCrypto Feature Matrix — AES, SHA-3, Ed25519, X.509, ML-KEM | eSeGeCe

sgcCrypto Feature Matrix

Everything sgcCrypto does, mapped across the 43 units on disk. There are no components and no design-time properties here: every row below is a function or procedure you call directly. Full source code ships in every license. Anchors below take you to the six capability families the units fall into.

sgcCrypto has no components. The 43 units below export plain functions, there is no Tsgc* class and no sgcCrypto_Reg.pas. Add a unit to your uses clause and call the function.

Already included. sgcCrypto ships free inside sgcWebSockets Standard, Professional and Enterprise, and inside All-Access. It is also sold standalone (bundling the sgcWebSockets Core runtime) for customers who only own Core. See Pricing.

Symmetric

AES, ChaCha20, Poly1305, 5 units

Hashing & KDF

SHA-2/3, BLAKE2, Argon2, 11 units

Signatures & key exchange

Ed25519, X25519, RSA, 10 units

PKI

X.509, ASN.1, CSR, 5 units

Post-quantum

ML-KEM, ML-DSA, SLH-DSA, 6 units

OTP & misc

HOTP/TOTP, encoding, ZIP AES, 6 units

43 Source Units

Every sgcCrypto_*.pas unit under sgcWebSockets/delphi/Source/, grouped by family.

UnitFamilyWhat it does
sgcCrypto_AESSymmetricAES-CBC, AES-GCM (AEAD), AES-CTR.
sgcCrypto_ModesSymmetricAES-ECB, OFB, CFB, CTS, and Key Wrap / Key Wrap with Padding.
sgcCrypto_CMACSymmetricAES-CMAC message authentication.
sgcCrypto_ChaChaSymmetricChaCha20, XChaCha20, Salsa20, XSalsa20.
sgcCrypto_Poly1305SymmetricPoly1305 MAC, ChaCha20-Poly1305 and XChaCha20-Poly1305 AEAD.
sgcCrypto_SHA2Hashing & KDFSHA-1, SHA-224, SHA-256, SHA-384, SHA-512.
sgcCrypto_KeccakHashing & KDFSHA-3, SHAKE128/256, cSHAKE, KMAC.
sgcCrypto_Blake2bHashing & KDFBLAKE2b, keyed or unkeyed.
sgcCrypto_Blake2sHashing & KDFBLAKE2s, keyed or unkeyed.
sgcCrypto_HMACHashing & KDFHMAC-SHA1/256/384/512.
sgcCrypto_KDFHashing & KDFPBKDF2, selectable hash.
sgcCrypto_HKDFHashing & KDFHKDF extract-and-expand.
sgcCrypto_ScryptHashing & KDFscrypt memory-hard KDF.
sgcCrypto_Argon2Hashing & KDFArgon2d, Argon2i, Argon2id.
sgcCrypto_SipHashHashing & KDFSipHash-2-4 keyed hash.
sgcCrypto_TLSHHashing & KDFTLSH fuzzy hash and similarity diff.
sgcCrypto_Ed25519Signatures & key exchangeEd25519 sign / verify.
sgcCrypto_X25519Signatures & key exchangeX25519 Diffie-Hellman.
sgcCrypto_Ed448Signatures & key exchangeEd448 sign / verify.
sgcCrypto_X448Signatures & key exchangeX448 Diffie-Hellman.
sgcCrypto_GF448Signatures & key exchangeInternal GF(2^448-2^224-1) field arithmetic for Ed448/X448.
sgcCrypto_ECCurvesSignatures & key exchangeECDSA / ECDH over secp256k1 and Brainpool P256r1/P384r1/P512r1.
sgcCrypto_ECSignatures & key exchangeGeneral EC sign/verify as JWS (ES256/384/512), ECDH.
sgcCrypto_RSASignatures & key exchangeRSA PKCS#1 v1.5 sign, PKCS#1 v1.5 / PSS verify, from PEM or raw.
sgcCrypto_RSA_KeysSignatures & key exchangeRSA keygen, OAEP, PSS, PKCS#1 sign/verify, DER/PEM export.
sgcCrypto_ECIESSignatures & key exchangeECIES seal / open hybrid encryption over X25519.
sgcCrypto_ASN1PKIDER reader, PEM codec, PKCS#1/SEC 1 key parsing.
sgcCrypto_DERPKIDER writer primitives.
sgcCrypto_BigIntegerPKIInternal arbitrary-precision integer arithmetic.
sgcCrypto_X509PKIX.509 parse, verify, chain, CRL, revocation.
sgcCrypto_X509_GenPKISelf-signed certificate and PKCS#10 CSR generation.
sgcCrypto_MLKEMPost-quantumML-KEM key encapsulation (FIPS 203), 3 parameter sets.
sgcCrypto_MLKEM_PolyPost-quantumInternal polynomial ring arithmetic behind ML-KEM.
sgcCrypto_MLKEM_HybridPost-quantumHybrid X25519 + ML-KEM key encapsulation.
sgcCrypto_MLDSAPost-quantumML-DSA digital signatures (FIPS 204), 3 parameter sets.
sgcCrypto_MLDSA_PolyPost-quantumInternal polynomial ring arithmetic behind ML-DSA.
sgcCrypto_SLHDSAPost-quantumSLH-DSA signatures (FIPS 205), 6 SHAKE parameter sets.
sgcCrypto_OTPOTP & miscHOTP, TOTP, constant-time verify window.
sgcCrypto_EncodingOTP & miscConstant-time compare, secure zero, hex/Base64url/Base32.
sgcCrypto_Zip_AE2OTP & miscWinZip AES encryption for ZIP entries, AE-1 / AE-2.
sgcCrypto_LegacyOTP & miscMD4, MD5, HMAC-MD5, DES-ECB, for interoperability only.
sgcCrypto_RandomOTP & miscCross-platform CSPRNG.
sgcCrypto_Int64OTP & miscInternal 64-bit integer emulation for Delphi 7.

Encryption & MACs

AES in the modes production code actually uses, plus the ChaCha20/Poly1305 AEAD family.

CapabilityFunctionNotes
AES-CBCsgcAES_CBC_Encrypt / sgcAES_CBC_DecryptPKCS#7 padding, 16-byte IV. Key length selects the cipher: 16/24/32 bytes = AES-128/192/256.
AES-GCM (AEAD)sgcAES_GCM_Encrypt / sgcAES_GCM_Decrypt12-byte IV recommended. 16-byte tag, compared in constant time; decrypt returns False and empty plaintext on a failed tag.
AES-CTRsgcAES_CTRSRTP-style AES-CM (RFC 3711). Symmetric call, no padding, 128-bit big-endian counter.
AES-ECBsgcAES_ECB_Encrypt / sgcAES_ECB_DecryptNo IV, no chaining. Included for interoperability with formats that specify it.
AES-OFB / AES-CFBsgcAES_OFB, sgcAES_CFB_Encrypt / sgcAES_CFB_DecryptStream-cipher-style feedback modes.
AES-CTSsgcAES_CTS_Encrypt / sgcAES_CTS_DecryptCiphertext stealing: encrypts data not a multiple of the block size with no padding overhead.
AES Key WrapsgcAES_KeyWrap / sgcAES_KeyUnwrapRFC 3394, for wrapping one key under another.
AES Key Wrap with PaddingsgcAES_KeyWrapPad / sgcAES_KeyUnwrapPadRFC 5649, for key material not a multiple of 8 bytes.
AES-CMACsgcAES_CMAC / sgcAES_CMAC_VerifyRFC 4493 message authentication code.
Low-level block primitivessgcAES_ExpandKey, sgcAES_EncryptBlock, sgcAES_DecryptBlockExposed for the mode and MAC units above; call these directly only to build a mode not already provided.
ChaCha20sgcChaCha20RFC 8439, 96-bit nonce, 32-bit counter.
XChaCha20sgcXChaCha20192-bit extended nonce, safe for random nonce generation at scale.
Salsa20 / XSalsa20sgcSalsa20 / sgcXSalsa20The predecessor stream cipher family, both nonce sizes.
Subkey derivationsgcHChaCha20 / sgcHSalsa20What the X-variants use internally to derive a subkey from the first 16 nonce bytes.
Poly1305 MACsgcPoly1305 / sgcPoly1305_VerifyOne-time authenticator, RFC 8439. Never reuse a Poly1305 key.
ChaCha20-Poly1305 AEADsgcChaCha20Poly1305_Encrypt / _DecryptThe AEAD cipher behind TLS 1.3's second cipher suite and SSH.
XChaCha20-Poly1305 AEADsgcXChaCha20Poly1305_Encrypt / _DecryptSame AEAD, 192-bit nonce, the construction libsodium calls crypto_aead_xchacha20poly1305_ietf.

Digests, MACs & Password Hashing

Every mainstream hash family, plus PBKDF2, HKDF, scrypt and all three Argon2 variants.

CapabilityFunctionNotes
SHA-1 / SHA-2sgcSHA1, sgcSHA224, sgcSHA256, sgcSHA384, sgcSHA512FIPS 180-4. SHA-1 is kept for interoperability, not recommended for new signatures.
SHA-3sgcSHA3_224 / _256 / _384 / _512FIPS 202, the Keccak sponge, structurally independent from SHA-2.
SHAKE128 / SHAKE256sgcSHAKE128 / sgcSHAKE256Extendable-output functions: request any digest length.
cSHAKE128 / cSHAKE256sgcCSHAKE128 / sgcCSHAKE256Domain-separated SHAKE, NIST SP 800-185, the basis for KMAC.
KMAC128 / KMAC256sgcKMAC128 / sgcKMAC256Keccak-based MAC with a variable output length.
BLAKE2bsgcBlake2b / sgcBlake2b_KeyedRFC 7693, digests up to 64 bytes, built-in keying (no separate HMAC needed).
BLAKE2ssgcBlake2s / sgcBlake2s_KeyedRFC 7693, digests up to 32 bytes, tuned for 32-bit platforms.
Streaming digestssgcBlake2b_Init/_Update/_Final, matching calls on Keccak/Blake2sFor hashing data too large to hold in memory at once.
HMACsgcHMAC_SHA1 / _SHA256 / _SHA384 / _SHA512RFC 2104 keyed hashing over the SHA-1/2 family.
PBKDF2sgcPBKDF2, sgcPBKDF2_SHA1 / _SHA256 / _SHA512RFC 8018. Only mildly memory-hard; prefer Argon2id or scrypt when you can choose.
HKDFsgcHKDF_Extract_SHA256 / _SHA384, sgcHKDF_Expand_SHA256 / _SHA384, sgcHKDF_SHA256 / _SHA384RFC 5869, extract-then-expand key derivation, the standard way to turn a shared secret into several keys.
scryptsgcScryptRFC 7914, memory-hard, resists GPU/ASIC attack far better than PBKDF2.
Argon2sgcArgon2 (d / i / id), sgcArgon2id convenience wrapperRFC 9106, the Password Hashing Competition winner. Full interface with optional secret (pepper) and associated data.
SipHash-2-4sgcSipHash24 / sgcSipHash24_ValueFast keyed PRF for hash-table keys, resists hash-flooding denial of service.
TLSH fuzzy hashsgcTLSH, sgcTLSH_Init/_Update/_FinalLocality-sensitive hash for near-duplicate detection, not a cryptographic digest.
TLSH similarity scoresgcTLSH_DiffDistance between two TLSH digests; lower means more similar.

Ed25519/Ed448, X25519/X448, secp256k1, Brainpool & RSA

Sign, verify and derive shared secrets across five distinct curve families plus RSA.

CapabilityFunctionNotes
Ed25519 sign / verifysgcEd25519_Sign / sgcEd25519_VerifyRFC 8032. 32-byte public key, 64-byte signature. Verify rejects non-canonical points and S >= L per section 5.1.7.
X25519 key exchangesgcX25519, sgcX25519_PublicKey, sgcX25519_SharedSecretRFC 7748 Diffie-Hellman over Curve25519.
Ed448 sign / verifysgcEd448_GenerateKeyPair, sgcEd448_Sign, sgcEd448_VerifyRFC 8032, the 448-bit (Goldilocks) EdDSA curve.
X448 key exchangesgcX448, sgcX448_PublicKey, sgcX448_SharedSecretRFC 7748 Diffie-Hellman over Curve448.
secp256k1sgcECDSA_SignHash / VerifyHash with eccSecp256k1The Bitcoin/Ethereum curve, SEC 2, in sgcCrypto_ECCurves.
Brainpool P256r1 / P384r1 / P512r1same functions with eccBrainpoolP256r1 / P384r1 / P512r1RFC 5639, common in EU eIDAS and government profiles.
Deterministic ECDSA noncebuilt into sgcECDSA_SignHashRFC 6979: the nonce is derived from the private key and message, no RNG failure mode.
ECDH (secp256k1 / Brainpool)sgcECDH_SharedSecretShared secret over the same four curves.
Point compressionsgcEC_Compress / sgcEC_DecompressStore or transmit the shorter compressed public-key form.
EC as JWS (ES256/384/512)sgcECDSA_SignJWS / sgcECDSA_VerifyJWSCurve selected automatically from the requested bit length, sign/verify directly from a PEM key, JOSE-oriented sibling of ECCurves.
Generic ECDHsgcECDHShared secret from a raw private key and peer public point.
Raw / DER ECDSA verifysgcECDSA_VerifyRaw / sgcECDSA_VerifyDERVerify against a raw (Qx, Qy, r, s) tuple or a DER-encoded signature.
RSA sign (PKCS#1 v1.5)sgcRSA_SignPKCS1From a PEM private key, SHA-1/256/384/512 digest.
RSA verify (PKCS#1 v1.5 / PSS)sgcRSA_VerifyPKCS1, sgcRSA_VerifyPSS, and _Raw variants over a modulus/exponentRFC 8017. Verify works from a PEM key or raw modulus and exponent, no key-object construction required.
RSA key generationsgcRSA_GenerateKeyAny requested bit length, Miller-Rabin primality testing.
RSA-OAEP encryptionsgcRSA_OAEP_Encrypt / sgcRSA_OAEP_DecryptRFC 8017 optimal asymmetric encryption padding.
RSA-PSS / PKCS#1 signingsgcRSA_PSS_Sign / Verify, sgcRSA_PKCS1_Sign / VerifySign directly from a generated TsgcRSAPrivateKey.
RSA key exportsgcRSA_ExportPrivateKeyPEM, sgcRSA_ExportPublicKeyPEM, matching DER callsPKCS#1 and SubjectPublicKeyInfo encodings.
ECIES seal / opensgcECIES_GenerateKeyPair, sgcECIES_Seal, sgcECIES_OpenHybrid encryption to an X25519 public key: ephemeral ECDH plus an AEAD, one call each way.

X.509 Certificates & ASN.1

Read a certificate someone else issued, or generate one yourself, with a DER encoder and decoder underneath both.

CapabilityFunctionNotes
DER readersgcASN1_Read, sgcASN1_Next, sgcASN1_ContentWalks a DER structure node by node.
PEM codecsgcPEM_Decode / sgcPEM_EncodeRFC 7468, the -----BEGIN ... -----END wrapper around DER.
RSA key parsingsgcASN1_ParseRSAPrivateKey / PublicKeyPKCS#1 (RFC 8017) key structures.
EC key parsingsgcASN1_ParseECPrivateKey / PublicKeySEC 1 key structures.
DER writer, structuralsgcDER_Sequence, sgcDER_Set, sgcDER_Tagged, sgcDER_ContextExplicit / ImplicitThe building blocks every certificate field is assembled from.
DER writer, valuessgcDER_Integer, sgcDER_OctetString, sgcDER_BitString, sgcDER_Boolean, sgcDER_NullPrimitive value encoders.
DER writer, strings & identifierssgcDER_OID, sgcDER_UTF8String, sgcDER_PrintableString, sgcDER_IA5String, sgcDER_TimeObject identifiers, the three string types X.509 uses, and UTCTime/GeneralizedTime.
Certificate parsingsgcX509_ParseFull certificate structure: subject, issuer, validity, public key, extensions.
Signature / chain verificationsgcX509_VerifySignedBy, sgcX509_VerifyChainVerify one certificate against an issuer, or walk and verify an array of DER certificates.
CRL parsing & revocationsgcX509_CRL_Parse, sgcX509_IsRevoked, sgcX509_CRL_VerifySignedByParse a Certificate Revocation List and check a serial number against it.
Name formattingsgcX509_SubjectRFC2253, sgcX509_IssuerRFC2253, sgcX509_SubjectOneLineRFC 2253 distinguished-name strings, for logging and display.
Extensions & SANssgcX509_GetExtension, sgcX509_GetCRLDistributionURIsRead arbitrary extension OIDs and CRL distribution point URIs.
Self-signed certificate generationsgcX509_CreateSelfSignedFull TsgcX509Options: subject DN, validity window, serial number, CA flag with path-length constraint, key usage, extended key usage, subject alternative names (including IPv4 SANs).
PKCS#10 CSR generationsgcX509_CreateCSRRFC 2986 certificate signing request from the same options record.
PEM outputsgcX509_ToPEMWraps the generated DER as a ready-to-save PEM file.

ML-KEM, ML-DSA & SLH-DSA

The three algorithms NIST finalized in August 2024 as FIPS 203, 204 and 205, plus a hybrid combiner for the migration period.

CapabilityFunctionNotes
ML-KEM key generationsgcMLKEM_GenerateKeyPair, sgcMLKEM_GenerateKeyPairFromSeedFIPS 203, formerly Kyber. Three parameter sets: mlkem512, mlkem768, mlkem1024.
ML-KEM encapsulatesgcMLKEM_Encapsulate, sgcMLKEM_EncapsulateWithSeedProduces a fresh 32-byte shared secret and the ciphertext that carries it.
ML-KEM decapsulatesgcMLKEM_DecapsulateNever fails: a malformed ciphertext yields a pseudorandom secret (implicit rejection) instead of an error, so timing and error behavior reveal nothing.
ML-KEM sizessgcMLKEM_PublicKeySize, PrivateKeySize, CiphertextSize, SharedSecretSizeByte lengths per parameter set, for buffer sizing.
Hybrid X25519 + ML-KEMsgcHybrid_GenerateKeyPair, sgcHybrid_Encapsulate, sgcHybrid_DecapsulateCombines a classical and a post-quantum shared secret through a KDF, so the result is never weaker than X25519 alone. The recommended way to deploy ML-KEM today.
ML-DSA key generationsgcMLDSA_GenerateKeyPair, sgcMLDSA_GenerateKeyPairFromSeedFIPS 204, formerly Dilithium. Three parameter sets: mldsa44, mldsa65, mldsa87.
ML-DSA sign / verifysgcMLDSA_Sign / sgcMLDSA_VerifyDeterministic or randomized signing per the FIPS 204 interface, plus a context string.
ML-DSA sizessgcMLDSA_PublicKeySize, PrivateKeySize, SignatureSizeByte lengths per parameter set.
SLH-DSA key generationsgcSLHDSA_GenerateKeyPair, sgcSLHDSA_GenerateKeyPairFromSeedFIPS 205, formerly SPHINCS+. Stateless hash-based signatures: security rests on the hash function alone, not on a lattice or curve assumption.
SLH-DSA sign / verifysgcSLHDSA_Sign / sgcSLHDSA_VerifySix SHAKE parameter sets: slhShake128s, slhShake128f, slhShake192s, slhShake192f, slhShake256s, slhShake256f. The s sets favor small signatures, the f sets favor fast signing.
SLH-DSA sizes & namingsgcSLHDSA_PublicKeySize, PrivateKeySize, SignatureSize, sgcSLHDSA_ParamsNameSLH-DSA signatures are large (7.8 KB to 49 KB depending on the set); size the buffer before you sign.

sgcCrypto does not claim ed25519187 or SPECK. ed25519187 has no published specification, and SPECK was withdrawn from ISO standardization in 2018; neither is implemented here.

One-Time Passwords, Codecs & Encrypted ZIP

The utility layer: one-time codes, the encodings every other family leans on, and WinZip AES encryption.

CapabilityFunctionNotes
HOTPsgcHOTPRFC 4226, counter-based one-time password.
TOTPsgcTOTP, sgcTOTP_FromBase32RFC 6238, time-based one-time password; the Base32 variant accepts the secret exactly as an authenticator app displays it.
TOTP verificationsgcTOTP_VerifyChecks a submitted code across a window of steps in constant time, so neither the result nor its position leaks through timing. Does not itself stop replay; the caller tracks used codes.
Constant-time comparesgcConstantTimeEqualsUsed throughout the library for tag and MAC comparisons.
Secure zerosgcSecureZeroOverwrites a byte buffer so key material does not linger in memory.
HexsgcHexEncode / sgcHexDecodeLower-case hex, case-insensitive decode.
Base64urlsgcBase64UrlEncode / sgcBase64UrlDecodeRFC 4648 section 5, unpadded, the encoding JWT and JOSE use.
Base32sgcBase32Encode / sgcBase32DecodeRFC 4648 section 6, the encoding TOTP secrets and authenticator apps use.
WinZip AES key derivationsgcZipAE2_DeriveKeysPBKDF2-based key, authentication key and password verifier from a password and salt.
WinZip AES encrypt / decryptsgcZipAE2_Encrypt / sgcZipAE2_DecryptAE-1 and AE-2, AES-128/192/256, per-entry salt sizing via TsgcZipAESStrength.
WinZip entry packingsgcZipAE2_PackEntry / sgcZipAE2_UnpackEntryCombines salt, verifier, ciphertext and authentication code into the on-disk layout.
WinZip extra fieldsgcZipAE2_BuildExtraField / sgcZipAE2_ParseExtraFieldThe 0x9901 extra field that marks a ZIP entry as AES-encrypted.
Legacy hashes (interop only)sgcMD4, sgcMD5, sgcHMAC_MD5Kept for reading older formats and protocols; do not use in a new design.
Legacy cipher (interop only)sgcDES_EncryptECB / sgcDES_DecryptECB, sgcDES_NTLM7to8DES-ECB and the DES-based NTLM key-expansion step, both withdrawn (FIPS 46-3), kept for legacy interoperability.
Secure random bytessgcRandomBytes / sgcRandomFillWindows CryptoAPI under MSWINDOWS, /dev/urandom elsewhere, one call either way.

Where sgcCrypto Runs

What is supported, stated precisely.

AreaDetail
Operating systemNo MSWINDOWS guard, or any other platform guard, wraps SGC_CRYPTO in sgcVer.inc. All 43 units compile for Win32, Win64, Linux64, macOS, iOS and Android.
Random number sourceThe one platform-aware unit, sgcCrypto_Random, selects a CSPRNG per target: the Windows CryptoAPI under MSWINDOWS, /dev/urandom on POSIX targets, behind the same sgcRandomBytes call.
DelphiDelphi 7 through RAD Studio 13 Florence. No native 64-bit integer type is assumed anywhere: sgcCrypto_Int64 and the TsgcBigInt type in sgcCrypto_BigInteger emulate the arithmetic the hashes, curves and post-quantum units need.
C++ BuilderC++ Builder through the generated headers, same source tree.
Design-time footprintNone. There is no sgcCrypto_Reg.pas, nothing is RegisterComponents'd, and no unit appears on a component palette page.
DependenciesNo OpenSSL binding, no external DLL. Every primitive is implemented directly in Object Pascal inside the unit you reference.
Source codeFull Object Pascal source in every paid tier, and in the edition packages that already include sgcCrypto.
RedistributionBinaries you build are royalty free, with no per-seat or per-server runtime fee.
Best value: All-AccessEvery eSeGeCe product, Premium Support included, from €1,059/year.
See All-Access pricing

Build with sgcCrypto

Download the free trial and call a function, no component required.