onecryptoDocs
onecrypto docs
Everything about OneCrypto: getting started, loading keys and certificates, CMS, X.509 and issuing, the primitives .NET lacks, and how each is checked. OneCrypto is a preview, 0.1.0-preview.1, and has not been independently audited.
Start
Getting startedInstall OneCrypto 0.1.0-preview.1 for .NET 10, load a key and certificate file with one call, and sign and verify with the key. OneCrypto is cryptography for .NET (not cryptocurrency), written from the specifications on the base class library alone.OverviewCryptography (not cryptocurrency) for .NET: message formats, certificates and the primitives the platform lacks, written from the specifications on the base class library alone. OneCrypto is unaffiliated with other products named OneCrypto.Docs mapNormative, language-neutral notes on behaviour: verification semantics, policy presets, resource limits and the methods behind the tests and benchmarks.Platform availabilityWhat each algorithm resolves to on each platform. The library asks the platform's cryptography first. Where the platform lacks an algorithm and the library has a narrow managed fallback, the call succeeds through the fallback. Otherwise it throws…
Keys and files
Loading key and certificate filesBehaviour of RecursiveAI.OneCrypto.Crypto.Load, LoadAsync and TryLoad. The loader only decides which parser to call and gathers what the parsers return; every format is read by the type that owns it (Certificate, PrivateKeyInfo, Pkcs12File, SshPrivateKey and so on), so a rule…Keys and two-phase signingBehaviour of the key interfaces (RecursiveAI.OneCrypto.Keys). A key is something that does an operation; the library never asks for key bytes.PKCS#8, PKCS#12 and OpenSSH keysNormative behaviour of RecursiveAI.OneCrypto.Pkcs and RecursiveAI.OneCrypto.Wire.Ssh. Clause numbers are those of the RFC or document named.ASN.1 and PEMNormative behaviour of RecursiveAI.OneCrypto.Asn1 and RecursiveAI.OneCrypto.Pem. Clause numbers are ITU-T X.690 (02/2021) unless another document is named.
Messages and certificates
CMS (signed and encrypted data)Normative behaviour of the CMS models in RecursiveAI.OneCrypto (SignedData, EnvelopedData, AuthEnvelopedData, AuthenticatedData, EncryptedData, DigestedData, CompressedData, ContentInfo) and the wire constants in RecursiveAI.OneCrypto.Wire.Cms. Clause numbers are RFC 5652…X.509, CSR, CRL and OCSPNormative behaviour of the PKI models in RecursiveAI.OneCrypto (the Certificate, CertificateSigningRequest, CertificateRevocationList, OcspRequest, OcspResponse, OcspBasicResponse and AttributeCertificate types and the names, general names, extensions and public keys they…RFC 3161 time-stampsRFC 3161 time-stamps: building requests, reading responses and TSTInfo, the verifier and its rules, and the time-stamp authority handler. No network and no clock: bytes in, bytes out.CryptoPolicyCryptoPolicy (RecursiveAI.OneCrypto.Policy) decides which algorithms, key sizes and options the library accepts. It is an immutable record: derive a variant with with.
Issuing
Certificate authorityA certificate authority as a library object, with no I/O and no clock: profiles, issuing from a CSR or a key, serial numbers, CRLs and delta CRLs, and two-phase signing with keys held anywhere.OCSP responderRecursiveAI.OneCrypto.Issuance.OcspResponder: a message handler. Request octets in, a signed OcspResponse out; no network, no clock, no database. The host owns the transport (HTTP POST, or GET with the base64 path of RFC 6960 Appendix A, and the caching headers) and the…
Path validation (preview)
Path validation (preview)Normative behaviour of PathValidator in RecursiveAI.OneCrypto.Validation (core package). Clause numbers are RFC 5280 unless another document is named. The validator builds on the models of docs/x509.md and the signature dispatch of docs/fallbacks.md.Validator reviewAn independent read of the path validator's verdict logic (src/OneCrypto/Validation/*, behaviour in docs/validation.md) against RFC 5280 §6, RFC 6960 and the Baseline Requirements, written by someone who did not write it. Method: the code was read rule by rule; adversarial…
Primitives
Ed25519, Ed448, X25519 and X448Normative notes for the curve primitives in RecursiveAI.OneCrypto.Primitives. The .NET base class library has none of these curves, so they are implemented here from RFC 8032 and RFC 7748. Everything else in this repository defers to the platform.Argon2, scrypt and bcrypt-pbkdfArgon2 (Argon2), scrypt (Scrypt) and bcrypt-pbkdf (BcryptPbkdf) in RecursiveAI.OneCrypto.Primitives. The platform has none of them. PBKDF2, HMAC and SHA-2 come from the platform; BLAKE2b (needed inside Argon2) and Blowfish's key schedule (needed inside bcrypt-pbkdf) are ours…OCB, EAX and AES key wrapRecursiveAI.OneCrypto.Primitives has AesOcb, AesEax and AesKeyWrap: modes over the platform's AES, for the places the platform has no mode of its own. The AES block function always comes from the platform (Aes ECB and CBC one-shots on spans); OneCrypto writes only the mode.…Camellia and legacy ciphersRecursiveAI.OneCrypto.Primitives has Camellia (RFC 3713, 128-, 192- and 256-bit keys) and four ciphers that OneCrypto reads but never writes: Cast5 (RFC 2144), Idea, Blowfish and Twofish. The platform has none of them.Platform-gap fallbacksHow the library chooses between the platform's cryptography, a narrow managed fallback and an error. The per-platform results are in availability.md.
How it is checked
ConformanceWhat is checked, against what, and where the library deviates. Gaps are listed, not hidden. The numbers come from runs of the test suite and its opt-in vector and oracle tests (see each area's document). This table is updated at each release.BenchmarksProject: bench/OneCrypto.Benchmarks (BenchmarkDotNet, in-process, MemoryDiagnoser on). Runner: tools/bench.sh.Timing testsConstant-time evidence for secret-handling code, in the style of Reparaz, Balasch and Verbauwhede, "Dude, is my code constant time?" (DATE 2017). Project: tests/Timing. Runner: tools/timing.sh.