Sealbox

SHA-256: what it is, where it is used, what it is not

Published

SHA-256 is a hash algorithm of the SHA-2 family, which NIST specifies in FIPS 180-4, the Secure Hash Standard. It takes a message of any length below 2^64 bits and returns a digest of 256 bits, written as 64 hexadecimal characters. NIST’s abstract says what digests are for: "The digests are used to detect whether messages have been changed since the digests were generated."

This guide reads FIPS 180-4, FIPS 202, NIST’s pages on hash functions and on SHA-1, NIST’s guidance on passwords and Apple’s CryptoKit documentation for what SHA-256 is, where it is used, what it is not, and how it relates to SHA-1, the rest of SHA-2 and SHA-3. Sealbox is not a hash tool: it does not give you the SHA-256 of your files or text, and this guide has no online tool and simulates none. A hash is not encryption; what keeps a text private on a channel is encryption, which Sealbox, an iPhone app that seals messages before any channel, does.

What SHA-256 is, in the standard

NIST’s page on hash functions describes the job: "A hash algorithm is used to map a message of arbitrary length to a fixed-length message digest." It says FIPS 180-4 specifies seven hash algorithms, SHA-1 and the "SHA-2 family of hash algorithms: SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, and SHA-512/256". The standard itself says: "Any change to a message will, with a very high probability, result in a different message digest."

The SHA-256 digest has 256 bits: 32 bytes, or 64 characters when written in hexadecimal. It has that size for a message of one letter and for a long one. Three examples, each produced by running the command shown, on a Linux computer:

The digests for abc and for the empty message are the ones in NIST’s own material: the SHA-256 example for the message abc, and the SHA-256 test vectors of NIST’s validation program for the empty message. In this guide’s reading, the abd example shows the point of the standard’s sentence about change: one letter differs, and the digest looks unrelated to the one for abc.

Where SHA-256 is used

FIPS 180-4 says secure hash algorithms "are typically used with other cryptographic algorithms, such as digital signature algorithms and keyed-hash message authentication codes, or in the generation of random numbers (bits)". FIPS 202 says something similar about hash functions in general: they are components for "1) the generation and verification of digital signatures, 2) key derivation, and 3) pseudorandom bit generation". In this guide’s reading, the sources place a hash inside other mechanisms; it is rarely something a person uses on its own.

For developers on Apple platforms, Apple’s CryptoKit has a SHA256 type, described as "An implementation of Secure Hashing Algorithm 2 (SHA-2) hashing with a 256-bit digest." Apple lists it from iOS 13. An app computes the digest of data it already holds, in one call or step by step for data that does not fit in memory.

SHA-256 is not encryption

A digest has a fixed size, 256 bits, while the messages it comes from have any length; in this guide’s reading, that alone means a digest cannot hold the message and nothing can decrypt it back. NIST also lists one of the properties it expects of an approved hash function: "Preimage resistance: Given a randomly chosen hash value, it is computationally infeasible to find an input message that hashes to this hash value."

What a hash does not do is hide a message that can be guessed. In this guide’s reading, the same message always gives the same digest, so anyone who has a digest can compute the digest of a guess and compare. Keeping a text private is the job of encryption, which uses a key; our guide on symmetric encryption reads one key, and how it gets to the reader.

Why SHA-256 alone is not how passwords are stored

NIST’s SP 800-63B, on authentication, says what a service that checks passwords must do: "Verifiers SHALL store passwords in a form that is resistant to offline attacks. Passwords SHALL be salted and hashed using a suitable password hashing scheme." It gives the purpose of such a scheme: "to make each password guess more expensive for an attacker who has obtained a hashed password file".

In this guide’s reading, SHA-256 on its own has neither of the two things that passage of SP 800-63B names, a salt and a cost factor: FIPS 180-4 describes it as a computation over the message alone, processed in fixed-size pieces, and the standard does not mention a salt. A hash of a password with plain SHA-256 is therefore the same for everyone who has that password, and costs an attacker one computation per guess.

SHA-256, SHA-1, the rest of SHA-2 and SHA-3

FIPS 180-4 puts SHA-1 and SHA-2 in one standard, and FIPS 202 adds SHA-3. The sizes below are from the standards’ own tables, and the strengths from the table on NIST’s page on hash functions:

SHA3-256 also has a 256-bit digest, but it is another function, so it gives another digest for the same message. For the empty message, printf '%s' '' | openssl dgst -sha3-256 gives a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a, the value in NIST’s SHA3-256 test vectors, while SHA-256 gives e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.

Online SHA-256 tools

Part of the search for SHA-256 is for a page where you type a text and get a digest. This guide does not offer such a tool, does not simulate one and does not recommend any: the examples above come from a command, and the same command gives the same digests for the same text.

Beside SHA-256: what Sealbox does with hashes, and where it stops

Sealbox is an iPhone app (iOS 26+ at launch) that seals messages before any channel. The site says "Coming to the App Store", so this section reports what the site, the project’s documents and the code say, not what a store listing shows.

Where Sealbox uses SHA-3. The project’s reference page lists four uses of SHA-3, the family of FIPS 202: deriving the session and vault keys, the identity fingerprint, the remote-pairing commitment and the check digit of the recovery phrase. In the source, each of the four uses SHA3-256 from CryptoKit.

The limits. Sealbox is not a hash tool: it does not give you the SHA-256 of a file or a text, and it has no screen for that. The identity fingerprint that the app shows is a SHA3-256 digest of the identity’s public data. A hash does not seal a message, and putting a message through a hash would not hide it.

Where SHA-2 appears. Two of the places the reference page names for SHA-2 are inside HPKE, where "HPKE’s internal KDF is still HKDF-SHA-256", and the pre-hash of the composite signature, which uses SHA-512. In the source, the three HPKE suites that Sealbox uses name SHA-256 and the composite signature hashes the message with SHA-512.

The limits. This guide lists these uses one by one, each one checked in the reference page and in the source; the list is not complete, and the guide does not say that one family is better than the other.

What a sealed message adds. A digest tells you whether a message changed; it does not keep the text from whoever sits on the channel. The site says Sealbox works over "Any channel — messenger, email, a post, SMS — or none", and "The channel carries ciphertext, never your text." In this guide’s reading, hash and encryption answer different questions, and the sealed message is the one that answers who can read.

The limits. The site lists what Sealbox does not protect: "A compromised, unlocked device in active use. Malware that reads your screen as you read is beyond any encryption app — for everyone." The other person needs Sealbox too, and the plain text still exists on the phone where you write it and on the phone where it is read.

Sources

Frequently asked questions

What is SHA-256?

SHA-256 is one of the hash algorithms of the SHA-2 family, specified by NIST in FIPS 180-4. It takes a message and returns a digest of 256 bits, written as 64 hexadecimal characters. The standard says the digests are used to detect whether messages have been changed since the digests were generated.

How long is a SHA-256 hash?

256 bits, which is 32 bytes, or 64 hexadecimal characters. The size is the same for every message, from the empty message to a long one: the examples in this guide, abc, abd and the empty message, all give 64 characters, and a change of one letter gives a different digest.

Is SHA-256 encryption? Can it be decrypted?

No. SHA-256 takes no key, and its digest has a fixed size while the message can have any length, so, in this guide’s reading, the digest cannot hold the message. NIST expects an approved hash function to make finding an input for a given digest computationally infeasible. Encryption is the tool that keeps a text private and can be reversed with a key.

Can I store passwords with SHA-256?

Not with plain SHA-256, in this guide’s reading. NIST’s SP 800-63B says passwords must be salted and hashed with a suitable password hashing scheme, to make each guess more expensive for an attacker who has the hashed file. FIPS 180-4 describes SHA-256 as a computation over the message alone and does not mention a salt.

What is the difference between SHA-256, SHA-1 and SHA-3?

SHA-1 and SHA-256 are in FIPS 180-4; SHA-1 has a 160-bit digest, and NIST plans to complete its transition away from SHA-1 by December 31, 2030. SHA-3 is a separate family in FIPS 202, based on KECCAK. SHA3-256 also has 256 bits but gives another digest for the same message.

Does Sealbox use SHA-256, and can it hash my files?

Sealbox uses SHA-3 in the session and vault key derivations, the identity fingerprint, the pairing commitment and the check digit of the recovery phrase, and SHA-256 inside HPKE; this is a list of uses, and it is not complete. It does not hash your files or your text for you: Sealbox is not a hash tool. What it does is seal a message before any channel, so that the channel carries ciphertext.

Get notified at launch

No form, no list, no tracker — it's just email. If the button doesn't open your mail app, write to support@sealbox.io with the subject "Notify me".

Full reference

Coming to the App Store · iOS 26+