webdevpuneet.com

Encrypt Reveal Card — Free HTML CSS JS Cipher Hover Snippet

Encrypt Reveal Card · Cards · Plain HTML, CSS & JS · Live preview

CategoryCards

Copy & paste

Source Code

<div class="ev-stage">
  <article class="ev-card" id="evCard">
    <div class="ev-stream" id="evStream" aria-hidden="true"></div>
    <div class="ev-mask" id="evMask" aria-hidden="true"></div>
    <div class="ev-center">
      <div class="ev-icon">🔒</div>
      <span class="ev-label">Encrypted</span>
    </div>
  </article>
  <p class="ev-hint">Move your cursor over the card</p>
</div>

Extend with AI

Take This Snippet Further With AI

The AI prompt for this one is for Patreon supporters ($3 a month), along with a site with no ads. Supporters enter the passcode once and it is remembered in this browser.

· Become a supporter

What's included

Features

Cursor-following mask
A radial mask reveals only under the pointer.
CSS-variable reveal
--mx/--my move the porthole cheaply.
Churning ciphertext
Random hex-symbol string regenerates on move.
Throttled regeneration
Only ~25% of moves rescramble the text.
Scanner glow
A soft radial light lifts the revealed area.
Secured-to-decrypting
Lock dims as the stream fades in on hover.
Feathered edge
Mask gradient softens the porthole.
Monospace authenticity
Mono font sells the encrypted look.

About this UI Snippet

Encrypt Reveal Card — Cipher Characters Unmasked by the Cursor

Screenshot of the Encrypt Reveal Card snippet rendered live

The encrypt-reveal card is the security-themed effect popularized by Evervault's site: a card shows a locked icon at rest, but as you move your cursor over it, a field of constantly-churning encrypted characters becomes visible only inside a circular window that follows the pointer — as if you're decrypting the surface in real time. This snippet recreates it with plain HTML, CSS masks, and a small vanilla JavaScript generator.

A masked window that follows the cursor

The character stream fills the whole card but is revealed through a mask-image radial gradient centered on two CSS custom properties, --mx and --my. A pointermove handler writes the cursor's position into those variables, so the opaque part of the mask — a 140px circle — tracks under the pointer while everything outside it is masked to transparent. The effect is a moving porthole that exposes the "ciphertext" only where you point, which is the core illusion. Updating the reveal through CSS variables keeps the handler extremely cheap.

Churning ciphertext

The text is a random 900-character string drawn from a hex-and-symbol alphabet (ABCDEF0123456789...!@#$%) that looks like encrypted data. To make it feel alive rather than static, the handler regenerates the string on roughly a quarter of pointer moves (Math.random() < 0.25). That throttle is deliberate: regenerating on every move would be wasteful and visually too frantic, while occasional regeneration reads as data actively scrambling under your cursor. Because only the masked region is visible, you mostly perceive the churn happening right where you look.

A glow that reinforces the reveal

A second layer, .ev-mask, is a soft radial purple glow also centered on --mx/--my. It fades in on hover and sits over the card to make the revealed region feel lit, like a scanner passing over the surface. Pairing a glow with the character mask gives the reveal depth instead of looking like a flat cut-out.

The resting state

At rest the card shows a centered lock icon and an "Encrypted" label, and the character stream is at opacity: 0. On hover the stream fades to full opacity (within its mask) while the lock label dims to opacity: .15, so the card transitions from "secured" to "decrypting" as you interact. This clear before/after state communicates the metaphor without any copy.

Why masks instead of clip

Using mask-image rather than clip-path lets the reveal have a soft, feathered edge — the radial gradient fades from opaque to transparent over its radius, so the porthole blends smoothly into the hidden area rather than showing a hard circular cut. That softness is what makes it feel like a scanning beam.

Customizing it

Change the mask circle radius to widen or tighten the reveal, edit the CHARS alphabet (Katakana for a Matrix look, or 0/1 for binary), recolor the stream and glow, or adjust the 0.25 regeneration probability for calmer or busier churn. Swap the lock icon for your brand. Pair it with a glow input on a security product page or a background boxes hero.

Step by step

How to Use

  1. 1
    Paste HTML, CSS, and JSA card shows a lock icon labeled Encrypted at rest.
  2. 2
    Move the cursor over itA circular window reveals churning encrypted characters.
  3. 3
    Move aroundThe reveal window follows the pointer like a scanner.
  4. 4
    Watch it churnThe ciphertext scrambles as you move.
  5. 5
    Change the alphabetEdit CHARS for binary, hex, or Katakana.
  6. 6
    Resize the windowAdjust the mask circle radius and glow.

Real-world uses

Common Use Cases

Security product pages
Pair with a glow input sign-in on a security product page, revealing churning ciphertext only under the cursor.
Privacy and encryption features
Headline an encryption feature beside a feature tabs showcase, with a locked icon at rest and a decrypting porthole on hover.
Developer tool moods
Set a technical mood near a terminal window, with only about a quarter of mouse moves regenerating the random text.
Crypto and fintech backdrops
Combine with an animated grid background on a crypto or fintech page, with --mx and --my moving the mask cheaply.
Hacker-themed alternatives
Offer a subtler take than full matrix rain, and study cursor-driven masks as a reference for reveal effects.
Related: Nutrition Label
See the Nutrition Label for a related cards pattern worth pairing with this one.

Got questions?

Frequently Asked Questions

The character stream fills the card but is shown through a mask-image radial gradient centered on the --mx and --my CSS variables. A pointermove handler writes the cursor position into those variables, so the opaque 140px circle of the mask tracks under the pointer while everything outside is masked to transparent — a moving porthole over the ciphertext.

The 900-character random string is regenerated on roughly a quarter of pointer moves (Math.random() < 0.25). Throttling it that way keeps the work cheap and the churn from looking too frantic, while still reading as data actively scrambling. Since only the masked region is visible, you perceive the churn right where you point.

mask-image with a radial gradient gives a soft, feathered edge — it fades from opaque to transparent across its radius, so the revealed area blends smoothly into the hidden surface. clip-path would produce a hard circular cut. The feathering is what makes the porthole feel like a scanning beam rather than a stencil.

No. The reveal moves purely by updating two CSS variables, which is very cheap, and the text only regenerates on about 25% of moves. There's no per-frame loop and no layout thrashing — the mask and glow are GPU-composited, so it stays smooth even on modest devices.

Keep the ciphertext in a ref and a pointermove handler that updates the --mx/--my inline style and occasionally regenerates the string. Avoid putting the churning text in state, since that would re-render constantly — write it directly to a ref'd element. The mask CSS ports as-is; in Tailwind use arbitrary mask-image values with the inline variables.