Mert Özen Further With Every Line

Blog

Mert Özen's blog posts on software development, backend, frontend, and DevOps.

Series
9 posts found
A Cryptography Map for Developers: Confidentiality, Integrity, Authentication and .NET's Provider Model
Security PART 01

A Cryptography Map for Developers: Confidentiality, Integrity, Authentication and .NET's Provider Model

In crypto code the starting point is the goal, not the algorithm: confidentiality needs encryption, integrity a MAC, non-repudiation a digital signature, and .NET takes these primitives from the operating system's library (CNG, OpenSSL, Apple). We map goals to primitives and .NET types, check platform support at startup with IsSupported, and show the one-shot APIs, FixedTimeEquals and ZeroMemory with real outputs.

14 Nov 2026 15 min 1
Hashes, HMAC and Key Derivation: SHA-2, SHA-3, HMAC, HKDF and When to Use Which
Security PART 02

Hashes, HMAC and Key Derivation: SHA-2, SHA-3, HMAC, HKDF and When to Use Which

To prove a message came from someone holding the key you use HMAC, not SHA256(secret + message), because SHA-2 is open to length extension; keys are derived per purpose from a single master key with HKDF. We cover a hash's three guarantees, choosing SHA-2 or SHA-3, verifying Bookstore's payment webhook with HMAC, a timestamp window, FixedTimeEquals and secret rotation, HKDF, Argon2id options and encoding pitfalls, with real outputs.

14 Nov 2026 14 min 1
Symmetric Encryption and AEAD: AES-GCM, ChaCha20-Poly1305, Nonce Management and Envelope Encryption
Security PART 03

Symmetric Encryption and AEAD: AES-GCM, ChaCha20-Poly1305, Nonce Management and Envelope Encryption

Encrypting a field correctly today takes an AEAD mode such as AES-GCM, a fresh nonce for every encryption and associated data that binds the ciphertext to its context; key rotation adds a versioned format and envelope encryption. With real outputs we cover the problems of ECB and CBC, the nonce limit, wrapping DEKs with AES-KWP, encrypting Bookstore's Customer.Phone with an EF Core value converter and a blind index, and how Always Encrypted compares.

14 Nov 2026 16 min 1
Asymmetric Cryptography: RSA-OAEP, Elliptic Curves, ECDH Key Agreement and Hybrid Encryption
Security PART 04

Asymmetric Cryptography: RSA-OAEP, Elliptic Curves, ECDH Key Agreement and Hybrid Encryption

To encrypt data for a party you've never shared a key with, you use hybrid encryption: the recipient's public key carries only a symmetric key and AES-GCM encrypts the data. With real outputs we cover why OAEP is mandatory for RSA, the 190-byte limit, the small keys of elliptic curves, why an ECDH shared secret must go through HKDF, PEM and encrypted PKCS#8, and Bookstore's purchase order file sent to a supplier.

14 Nov 2026 13 min 1
Digital Signatures: RSA-PSS, ECDSA, Verification and a Signed License File
Security PART 05

Digital Signatures: RSA-PSS, ECDSA, Verification and a Signed License File

When the verifying side must not be able to sign, as with a license check running on a customer's server, you use a digital signature rather than a MAC: the private key signs and the public key shipped with the application only verifies. With real outputs we cover RSA-PSS versus PKCS#1 v1.5, why the ECDSA nonce matters, P1363 and DER formats, canonicalization, Bookstore's signed license file with keyId rotation, and the status of Ed25519 in .NET.

14 Nov 2026 12 min 1
X.509 and PKI for Developers: Loading Certificates, Chain Validation and mTLS in ASP.NET Core
Security PART 06

X.509 and PKI for Developers: Loading Certificates, Chain Validation and mTLS in ASP.NET Core

Trusting a certificate means validating the chain up to your own trust anchor and checking the EKU and host name separately; even with a valid chain, a name mismatch is caught by MatchesHostname, not X509Chain. With real outputs and tests we cover X509CertificateLoader, .NET 10's SHA-256 thumbprint search and PKCS#12 algorithm choice, CustomRootTrust validation and SAN-based mTLS between Bookstore's services.

14 Nov 2026 13 min 1
Inside TLS: The Record Layer, Key Schedule, Forward Secrecy and SslStream Settings in .NET
Security PART 07

Inside TLS: The Record Layer, Key Schedule, Forward Secrecy and SslStream Settings in .NET

Recorded TLS 1.3 traffic can't be decrypted with the server's private key, because the traffic keys are derived with HKDF from a new X25519 key exchange on every connection. With real outputs we verify the key schedule against RFC 8448 test vectors and show AES-GCM in the record layer, decrypting our own traffic with .NET's SSLKEYLOGFILE support, the resumption and 0-RTT risk, and the EnabledSslProtocols and CipherSuitesPolicy settings.

14 Nov 2026 12 min 1
Post-Quantum Cryptography: ML-KEM, ML-DSA, SLH-DSA, the Hybrid Approach and Crypto Agility
Security PART 08

Post-Quantum Cryptography: ML-KEM, ML-DSA, SLH-DSA, the Hybrid Approach and Crypto Agility

Because data that must stay confidential can be recorded today and decrypted later with a quantum computer, key exchange based on RSA and ECC should move to hybrid ML-KEM now; AES and SHA-2 are outside the migration. With real outputs we show NIST IR 8547's 2030/2035 timeline, .NET 10's MLKem, MLDsa, SlhDsa and CompositeMLDsa APIs, the X25519MLKEM768 TLS group that comes with OpenSSL 3.5, and Bookstore's hybrid purchase order envelope.

14 Nov 2026 12 min 1
Cryptography APIs from .NET Framework to .NET 11: Obsolete Types, New One-shot APIs and Reading Old Code
Security PART 09

Cryptography APIs from .NET Framework to .NET 11: Obsolete Types, New One-shot APIs and Reading Old Code

When moving old crypto code to the new APIs, fixing the warnings isn't enough; unless you spell out the old constructors' hidden defaults (SHA-1, 1000 iterations, CBC), archived data won't open. With real outputs we cover the warnings from SYSLIB0021 to SYSLIB0060, behaviour-preserving migration, the APIs that arrived from .NET 5 to 10, and .NET 11's X25519, RFC 3394 AES Key Wrap, HMACSHA256.Verify, HPKE and composite ML-KEM additions.

14 Nov 2026 11 min 1
Blog Map