Skip to main content
46 votes
Accepted

What is the practical impact of using System.Random which is not cryptographically random?

You asked for the practical impact, so the answer is that for \$120 I could probably have your entire password database done by tomorrow. Here is your program, or something similar to it: ...
ymbirtt's user avatar
  • 678
44 votes
Accepted

Can a hard drive store clear text data that is physically impossible to retrieve?

The normal way is to keep secret data in volatile static RAM (i.e. 6 transistors per bit, like in current CPU caches, not with capacitors like in DRAM). When the power is cut, the data is gone in a ...
Thomas Pornin's user avatar
40 votes

Where and how to store private keys in web applications for private messaging with web browsers

You may want to consider using the Web Cryptography API for client-side cryptography in the web browser. Then, you can create a keypair using the webcrypto api, and store the CryptoKey object, ...
mti2935's user avatar
  • 959
37 votes
Accepted

Why is the Keyspace of a Substitution Cipher not 2^26 but 2^88

The key space of a cryptographic algorithm whose key length is $n$ is given by $2^n$ No. There is confusion between: keyspace (or key space) $\mathcal K$, which is the set of possible keys. keyspace ...
fgrieu's user avatar
  • 145k
36 votes
Accepted

Key derivation functions (KDF): What are they, what are their main purposes and how they can be used?

The HKDF paper provides as good a summary as any: A Key derivation function (KDF) is a basic and essential component of cryptographic systems: Its goal is to take a source of initial keying material, ...
Luis Casillas's user avatar
28 votes

If Kerckhoff's Principle holds, why do we need a cipher at all?

...why go through the trouble of creating a cipher in the first place? Why not simply use a ridiculously long key, if you're gonna create a cipher that only takes as long as an exhaustive key search ...
Ella Rose's user avatar
  • 19.9k
26 votes

What is the practical impact of using System.Random which is not cryptographically random?

From what you have described, it sounds like your system works as follows: Consult the system clock to find a 32-bit seed $s$. Use System.Random to generate a ...
Squeamish Ossifrage's user avatar
22 votes

Can a hard drive store clear text data that is physically impossible to retrieve?

It is not physically impossible to retrieve data, merely very difficult. Physical sensors such as light sensors and mesh layers on chips can be bypassed. Christopher Tarnovsky's work using a Focused ...
SAI Peregrinus's user avatar
22 votes

Is a PRG more costly than AES or any other encryption standard?

A one-time pad requires a true random sequence that is as long as the material you want to encrypt. If you have a pseudo-random sequence, then you don't have a one-time pad: you have a stream cipher. ...
Gilles 'SO- stop being evil''s user avatar
19 votes

If Kerckhoff's Principle holds, why do we need a cipher at all?

Edit: I wrote the below on autopilot with the definition in the question. I have since realised an additional mistaken detail: the rule about no attacks better than key exhaustion is not called ...
Josiah's user avatar
  • 1,042
18 votes
Accepted

What is a related key?

Related keys are keys with any mathematical relationship that leads to exploitability in the cipher. This can be a simple relationship, such as having many bits in common. This was the case with RC4 ...
forest's user avatar
  • 15.5k
18 votes

What is the practical impact of using System.Random which is not cryptographically random?

The official documentation for System.Random explicitly says it should not be used for generating passwords. It’s predictable, and seeded only from the system clock. This means System.Random has at ...
rmalayter's user avatar
  • 2,297
17 votes

Key derivation functions (KDF): What are they, what are their main purposes and how they can be used?

KDF's or Key Derivation Functions are functions or schemes to derive key or output keying material (OKM) from other secret information, the input keying material (IKM). That information may be another ...
Maarten Bodewes's user avatar
  • 94.5k
17 votes
Accepted

Relation between Key-exchange and Public-Key encryption schemes

First, some definitions. A public key encryption scheme (PKE) is a scheme with public and private keys, where we can encrypt a message using the public key and decrypt using the private key. A key ...
K.G.'s user avatar
  • 4,837
17 votes
Accepted

Encoding salt as hex before hashing bad practice?

This does not talk about salt at all but about actual symmetric keys. Quoting the full paragraph: Most programming environments provide some sort of "secure random" mechanism (a CSPRNG). ...
Marc's user avatar
  • 1,583
16 votes
Accepted

Why do crypto tools display key components in such an unusual format?

As for the leading zero, I believe the tools are just displaying what's in the ASN.1 as is; the BER/DER encoding rules will insist on a leading 00 byte in some cases. Specifically, if you encode a ...
poncho's user avatar
  • 151k
14 votes
Accepted

RSA private key integrity check

Mathematical checks of the consistency of an RSA key can include: $$\begin{align*} e&\text{ odd}\\ n&\text{ odd, and of prescribed bit size (if any)}\\ p&\text{ odd, and of prescribed bit ...
fgrieu's user avatar
  • 145k
14 votes

Brute-forcing Symmetric Keys

No, it doesn't help. It doesn't hurt either; as long as you don't repeat keys, the probability of success is always the same. That is, if there are $2^n$ possible keys, and you test $\lambda$ of ...
poncho's user avatar
  • 151k
14 votes

For a typical n-bit symmetric key, how many keys would be considered too weak to use?

I understand that all zeros or all ones would be weak for any cipher. This isn't actually true. For good cipher there are no weak keys. And certain ciphers, e.g. DES, have a list of weak keys. But ...
axapaxa's user avatar
  • 2,980
14 votes
Accepted

WhatsApp end-to-end encryption

If by "using them on a second device such as a PC running Windows" you mean that you open Whatsapp web there, then no you cannot decrypt your messages there. Whatsapp web is a client that connects to ...
Josef's user avatar
  • 362
13 votes
Accepted

Why do Feistel ciphers need round keys?

Iterated ciphers need variability between rounds to resist so callad Slide attacks. One common way to thwart this attack is with a key schedule generating different round keys for each round. Slide ...
user49042's user avatar
  • 146
13 votes

Which hash is used when providing signature algorithm ED25519 or ED448?

Hash algorithms: Ed25519 uses SHA-512 (As referenced on wikipedia or on bearssl.org) Ed448 uses SHAKE-256$^1$ (As referenced on bearssl.org) $^1$ SHAKE-256 is a SHA-3 algorithm, a subgroup of the "...
AleksanderCH's user avatar
  • 6,511
13 votes

How strong are Bitlocker recovery keys?

Based on official doc here, unofficial doc there, and confirmed by some experiments: A valid Bitlocker recovery key consists of eight exactly 6-digit decimal numbers separated by seven hyphens (...
fgrieu's user avatar
  • 145k
12 votes

Why do Feistel ciphers need round keys?

This is due to Luby and Rackoff's proof about Feistel networks. The proof assumes the PRFs are independent. See sections 4.5 and 5 of How to Construct Pseudorandom Permutations from Pseudorandom ...
otus's user avatar
  • 32.4k
12 votes
Accepted

Why in cryptographic schemes we always assume that the key and plaintext are independent?

What if the plaintext depends on the key? How it can endanger security? Well, one trivial example where it can is if you are using RSA (without padding), and encrypt one of the prime factors. ...
poncho's user avatar
  • 151k
12 votes
Accepted

Why does OpenSSL differentiate between PSS and non-PSS for private key generation?

If you reuse the same key material for different algorithms, you rely not on the security of any one algorithm individually, but on the security of the composition of the two algorithms simultaneously....
Squeamish Ossifrage's user avatar
12 votes
Accepted

Always set the IV to 0 randomized CBC

This will be dangerous if there is a high probability of repeated initial blocks across plaintext. Cryptographers like to make as few assumptions as possible about the structure of plaintext and so ...
Daniel S's user avatar
  • 26.4k
11 votes
Accepted

Which hash is used when providing signature algorithm ED25519 or ED448?

If you follow the references in RFC 8446, you'll see that it cites RFC 8032 for the definition of the EdDSA-based algorithms. RFC 8032 in turn tells you all the details about the hash functions and ...
Squeamish Ossifrage's user avatar
11 votes
Accepted

Encryption and decryption with Diffie-Hellman

The purpose of Diffie-Hellman is solely to establish a shared key, $K$. Taken from Wikipedia: Traditionally, secure encrypted communication between two parties required that they first exchange ...
thesquaregroot's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible