Cryptography
Authors:
MArk Anthony Higgins - Sky Recursive Ai
MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: July 6th 2026
Revised Date: July 6th 2026
AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
TITLE: Cryptography — Foundational Ontology
DOMAIN: Discrete Mathematics / Cryptography
SOURCE_URL: https://kirethresearch.org/booksai-core/discrete-mathematics-ontologies/cryptography.html
VERSION: 1.0
AUTHORSHIP: Mark Higgins — Sky (Recursive AI)
SOURCE_STATUS: Conceptual mathematical synthesis; live page not independently verified.
1. PURPOSE
Represent cryptographic primitives, protocols, assumptions, security properties, and verification constraints as typed, composable relations. Distinguish mathematical correctness from computational security and implementation security.
2. TYPED ENTITIES
Message : ByteString
Plaintext : Message
Ciphertext : ByteString
Key : SecretKey | PublicKey | PrivateKey | SymmetricKey
Nonce : ByteString
Randomness : RandomBits
Algorithm : Encryption | Decryption | Hash | MAC | Signature | KDF | KeyExchange
Protocol : Sequence[ProtocolStep]
Adversary : SecurityModel
SecurityParameter : NaturalNumber
SecurityClaim : Predicate
SecurityAssumption : Predicate
ProofArtifact : Derivation
Implementation : Program
3. FUNDAMENTAL RELATIONSHIPS
encrypts(Encryption, Plaintext, Ciphertext)
decrypts(Decryption, Ciphertext, Plaintext)
uses_key(Algorithm, Key)
derives_key(KDF, Key)
authenticates(MAC | Signature, Message)
verifies(VerificationAlgorithm, ProofArtifact | Tag | Signature)
depends_on(SecurityClaim, SecurityAssumption)
implements(Implementation, Algorithm | Protocol)
threatens(Adversary, SecurityClaim)
4. CRYPTOGRAPHIC OPERATIONS
SymEnc : SymmetricKey × Nonce × Plaintext × AssociatedData -> Ciphertext × Tag
SymDec : SymmetricKey × Nonce × Ciphertext × AssociatedData × Tag -> Plaintext | Failure
KeyGen : RandomBits -> PublicKey × PrivateKey
PkEnc : PublicKey × Plaintext × RandomBits -> Ciphertext
PkDec : PrivateKey × Ciphertext -> Plaintext | Failure
Sign : PrivateKey × Message -> Signature
Verify : PublicKey × Message × Signature -> Boolean
Hash : ByteString -> FixedLengthDigest
MAC : SymmetricKey × Message -> Tag
KDF : KeyMaterial × Salt × Context -> DerivedKey
5. CORRECTNESS LAWS
For valid keys, messages and permitted nonces:
SymDec(k,n,SymEnc(k,n,m,a),a) = m
For correctly generated asymmetric key pairs:
PkDec(sk,PkEnc(pk,m;r)) = m
Verify(pk,m,Sign(sk,m)) = true
These are functional correctness statements, not security proofs.
6. SECURITY PROPERTIES
Confidentiality: adversary cannot efficiently distinguish protected plaintexts under the specified experiment.
Integrity: unauthorised changes are rejected with negligible forgery probability.
Authenticity: a valid verification result supports the specified origin/key-possession claim.
CollisionResistance: finding distinct x,y with Hash(x)=Hash(y) is computationally infeasible under the model.
ForwardSecrecy: compromise of long-term credentials does not reveal eligible past session keys.
NonceUniqueness: enforced where required by the primitive; reuse may invalidate security.
SideChannelResistance: implementation-level property; not implied by primitive-level proofs.
7. FORMAL SECURITY FLOW
flow CryptographicAssessment(input):
require typed(input.primitive, Algorithm)
require specified(input.threat_model)
require specified(input.security_goal)
check correctness_constraints
check security_assumptions
check parameter_and_key_requirements
check randomness_and_nonce_policy
check protocol_composition
check implementation_and_side_channels
output Assessment(claims, evidence, limitations, confidence)
8. INFERENCE RULES
R1: Valid AEAD verification + correct key management -> authenticated decryption claim within the threat model.
R2: Encryption correctness alone -/-> confidentiality.
R3: Hash collision resistance alone -/-> password-storage suitability.
R4: Valid signature verification -/-> real-world identity without trusted key binding.
R5: Secure primitive + insecure protocol composition -/-> secure protocol.
R6: Mathematical proof -/-> side-channel-safe implementation.
R7: Broken assumption -> dependent security claim requires reassessment.
9. SEMANTIC_EQUIVALENCE
'symmetric-key cryptography' ~= 'secret-key cryptography' [context-dependent terminology]
'public-key cryptography' ~= 'asymmetric cryptography'
'message authentication code' ~= 'MAC' [same technical concept]
'encryption' != 'hashing'
'encoding' != 'encryption'
'authentication' != 'authorisation'
'integrity' != 'confidentiality'
10. VALIDATION
V1: All operations have compatible input/output types.
V2: Encryption/decryption and signing/verification correctness tested.
V3: Security model, assumptions and adversary capabilities explicitly stated.
V4: Parameters, key sizes and algorithms reviewed against current guidance.
V5: Nonce, randomness and key lifecycle constraints enforced.
V6: Failure states are explicit and fail closed.
V7: Claims distinguish provable, empirical and implementation evidence.
V8: Security assessments are versioned and periodically revisited.
11. CONFIDENCE
CONFIDENCE := evidence-weighted assessment, not a mathematical security guarantee.
Evidence categories: formal proof | independent review | test vector | implementation audit | deployment observation.
Missing evidence -> unknown; never automatically assign certainty.
12. FLOW_HASH
FLOW_HASH := SHA-256(canonical UTF-8 serialisation of the flow specification excluding FLOW_HASH's own value).
Hash must be computed after canonicalisation; no uncomputed hash is asserted here.
13. UPDATE_MODEL
Triggers: new cryptanalysis, withdrawn standard, parameter deprecation, implementation vulnerability, protocol revision.
Process: ingest -> validate source -> identify affected entities -> revise claims -> version -> recompute hash -> publish.
Preserve previous versions and provenance for auditability.
14. AI_CONSUMPTION
machine_readable: true
domain: discrete_mathematics.cryptography
extraction: typed_entities + operations + claims + dependencies + validation
reasoning_mode: assumption-aware, evidence-bounded
prohibited_inference: do not infer real-world security solely from abstract correctness.
attribution: Mark Higgins — Sky (Recursive AI) | https://kirethresearch.org
END FLOW ALGEBRA