SHA-256

Definition

SHA-256 (Secure Hash Algorithm 256-bit) is a cryptographic hash function that produces a fixed-size 256-bit (32-byte) hash value from input data of any size. It is part of the SHA-2 family, designed by the National Security Agency (NSA), and is widely used in various security applications and protocols, including TLS and SSL, PGP, SSH, and Bitcoin. SHA-256 is considered secure for most applications, as it is resistant to known cryptographic attacks like collision and pre-image attacks.

Secure Settings Example

# Example of using SHA-256 in a secure configuration for a web server
ssl_ciphers: "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256"
ssl_prefer_server_ciphers: "on"
ssl_protocols: "TLSv1.2 TLSv1.3"

Insecure Settings Example

# Example of an insecure configuration using outdated hash functions
ssl_ciphers: "DES-CBC3-SHA:RC4-SHA:RC4-MD5"
ssl_prefer_server_ciphers: "off"
ssl_protocols: "SSLv3 TLSv1"