mooncrypt
Showcase

Three instruments

Each one runs this library compiled to JavaScript. Nothing on this page is drawn from a stored answer: move a control and the numbers are computed again.

Avalanche

Change one bit of the message and about half the digest flips. Not the corresponding bit — half of all 256 of them, with no pattern to where. This is the property that makes a digest useless to predict and useful to compare.

Fig. 2 · avalanche SHA-256 · 256 bits
one changed bit of input — of 256 bits
digest of the message—
digest of the same message, one bit later—

A tag that refuses

AES-GCM seals a message and appends a tag. Flip one bit anywhere in the ciphertext and the tag no longer matches; open returns nothing at all rather than a damaged message.

Fig. 3 · tag AES-256-GCM · fixed key and nonce
opened

Thirty seconds

A one-time password is a MAC of the current time. The code changes every thirty seconds because the time it was computed from does; no state is kept between them.

Fig. 4 · totp RFC 6238 · SHA-1 · 6 digits
———
next code in30s

The key, the nonce and the password above are fixed so the page shows the same thing to everyone. Nothing is sent anywhere: the arithmetic happens in this tab.