🍋
Menu
Generator

Passphrase

A sequence of random words used as a password, offering high entropy while remaining memorizable (e.g. Diceware method).

التفاصيل التقنية

Passphrase relies on pseudo-random number generators (PRNGs). JavaScript's Math.random() uses an implementation-specific PRNG (typically xoshiro256**) that is fast but not cryptographically secure. For security-sensitive generation (tokens, passwords, keys), the Web Crypto API's crypto.getRandomValues() draws from the OS entropy pool (/dev/urandom on Linux, CryptGenRandom on Windows). True randomness requires hardware sources (thermal noise, radioactive decay) and is unnecessary for most generation tasks.

مثال

```javascript
// Cryptographically secure password generator
function generatePassword(length = 16) {
  const charset = 'abcdefghijklmnopqrstuvwxyz'
    + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*';
  const values = crypto.getRandomValues(new Uint32Array(length));
  return Array.from(values, v => charset[v % charset.length]).join('');
}
// → 'kX9#mQ2$pL7&nR4!'
```

أدوات ذات صلة

مصطلحات ذات صلة