Secure Hash Algorithm (SHA) was developed by NIST and NSA to hash messages into fixed-length message digests. SHA has multiple versions including SHA-1, SHA-2, and SHA-3. SHA-1 produces a 160-bit message digest and works by padding the input message, appending the length, dividing into blocks, initializing variables, and processing blocks through 80 rounds of operations to output the digest. SHA-512 is closely modeled after SHA-1 but produces a 512-bit digest and uses 1024-bit blocks.