StackPractices

Tag: encryption

Browse 16 practical software engineering resources tagged with "encryption". Discover code recipes, design patterns, documentation templates, and in-depth guides to help you build, deploy, and maintain production-ready solutions involving encryption. Each resource is written for engineers who ship real systems, with copy-paste examples and practical trade-offs.

Encryption and Cryptography

Encryption protects data at rest and in transit. Applying it correctly means choosing the right algorithms, managing keys, avoiding deprecated ciphers, and understanding when encryption does not provide authentication.

The recipes below cover TLS, AES, RSA, hashing, HMAC, secrets management, and secure defaults. Each guide explains how to use cryptography as a defensive layer without introducing subtle vulnerabilities.

Every resource includes clear explanations, copy-paste code, and practical warnings. Use them to make informed decisions, avoid production pitfalls, and speed up your delivery. If you are just getting started, read the beginner-friendly articles first; if you are experienced, jump straight to the advanced patterns and architecture guides. New resources are added regularly, so bookmark this page and check back for the latest patterns.

Secure APIs with HTTP Security Headers

How to configure essential security headers like HSTS, CSP, and X-Frame-Options to protect APIs and...

Protect Web Forms Against CSRF Attacks

How to prevent Cross-Site Request Forgery attacks using synchronizer tokens, SameSite cookies, and...

Schema-Based Data Validation with Zod in TypeScript

Validate and sanitize incoming data using Zod schemas with TypeScript inference, custom...

Implement Encryption at Rest for Databases and File Storage

How to encrypt sensitive data before storing it in databases, object storage, and backups using...

Encrypt and Decrypt Data with AES-GCM in Python

Encrypt sensitive data using AES-GCM with the cryptography library. Covers key derivation, nonce...

HMAC Request Signing for API Authentication (AWS Sig v4)

Secure API requests with HMAC signatures and AWS Signature v4 authentication for tamper-proof...

Security Headers

Harden web applications with HTTP security headers: CSP, HSTS, X-Frame-Options, and a thorough...

Prevent Cross-Site Scripting (XSS)

How to sanitize user input, escape output, and use Content Security Policy to prevent XSS attacks...

Encryption Key Lifecycle Template

A template for managing the creation, distribution, rotation, and destruction of encryption keys...

Encryption Key Rotation: Runbook

Use this encryption key rotation runbook to rotate keys with zero downtime. Covers schedules,...

Penetration Test Report Template with Remediation

Document security assessment findings with this penetration test plan template, including risk...

API Security Checklist — Authentication to Encryption

A thorough security checklist for APIs: authentication, authorization, input validation, rate...

Encryption at Rest: AES-256, KMS, Envelope Encryption

Encrypt stored data correctly: AES-256-GCM, KMS-managed keys, envelope encryption, key rotation,...

Cryptography Basics — Encryption, Hashing, and Signing

A developer's guide to cryptography: symmetric and asymmetric encryption, hashing, digital...

Security Best Practices Guide

A thorough guide to application security: authentication, authorization, input validation, secrets...

Webhook Security — Delivery, Verification, and Protection

A practical guide to securing webhooks: HMAC signature verification, replay attack prevention,...