Client-Side Security: Leveraging the Web Crypto API

How modern browsers achieve military-grade encryption offline. Learn how Karuvigal uses the Web Crypto API to hash passwords and generate UUIDs securely without sending data to a server.

For years, executing complex cryptographic operations—like generating secure passwords, creating AES encryption keys, or hashing data—was strictly the domain of backend servers. Browsers simply lacked the mathematical primitives and secure randomness required to do it safely.

Today, that paradigm has shifted. Thanks to the Web Crypto API, modern browsers possess native, highly optimized, hardware-backed cryptographic engines. At Karuvigal, we leverage this API extensively to ensure that your sensitive developer workflows happen entirely offline.

The Danger of Math.random()

To understand why the Web Crypto API is revolutionary, we must look at how browsers used to generate randomness. Traditionally, JavaScript developers relied on Math.random(). However, Math.random() is a Pseudo-Random Number Generator (PRNG).

It is not truly random; it uses a mathematical algorithm seeded by the computer's current state. If an attacker can determine the seed or the internal state of the algorithm (which is surprisingly easy to do in older browsers), they can perfectly predict all past and future numbers generated by Math.random().

If a password generator or UUID generator uses Math.random(), the resulting "secure" tokens are highly vulnerable to prediction attacks.

Enter the Web Crypto API

The Web Crypto API (available via the global window.crypto.subtle object) exposes a suite of low-level cryptographic primitives to JavaScript. Crucially, these operations are often delegated directly to the underlying operating system's cryptographic libraries, ensuring hardware-level entropy and protection against timing attacks.

Cryptographically Secure Randomness

To solve the Math.random() problem, the Web Crypto API provides crypto.getRandomValues(). This function reaches down into the operating system's entropy pool (which collects truly random data from hardware events like mouse movements, keyboard timing, and thermal noise) to generate numbers.

When you use the Karuvigal Password Generator or UUID Generator, every single character is derived using crypto.getRandomValues(). This mathematically guarantees that the generated tokens cannot be predicted by an attacker.

High-Performance Hashing

Beyond randomness, the Web Crypto API provides blazing-fast implementations of standard hash algorithms like SHA-256, SHA-384, and SHA-512 via the crypto.subtle.digest() method.

Before the Web Crypto API, hashing data in the browser required downloading large JavaScript libraries (like CryptoJS). Because these libraries executed in the main JavaScript thread, hashing a large file would completely freeze the browser UI.

By utilizing the native Web Crypto API, Karuvigal can hash massive files (like ISOs or large database dumps) directly in your browser. The operation runs asynchronously, at near-native speeds, without freezing your interface or transmitting a single byte to a remote server.

Why This Matters for Developer Tools

The integration of the Web Crypto API changes the fundamental trust model of developer utilities.

In the past, if you needed to calculate an HMAC hash for a webhook signature or generate a secure UUID, you had to either write a script locally or paste your secret keys into a random website, trusting that their backend wasn't logging your data.

Karuvigal eliminates that trust requirement. By executing all cryptographic operations client-side via the Web Crypto API, we provide the convenience of an online utility with the absolute security of a local, air-gapped machine.

Karuvigal Team
KT

Karuvigal Team

Building developer tools that save time and improve productivity.

Published on April 16, 2026 • 7 min

Last updated: June 26, 2026 Author Karuvigal Team