Hot answers tagged

52 votes

How to find modulus from a RSA public key?

I wanted to help break down exactly what you're seeing. If you take your base64 string: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/...
Ian Boyd's user avatar
  • 1,001
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
  • 668
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
39 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
  • 909
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
  • 138k
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.5k
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

What is the difference between key size and block size (for AES)?

The key size is simply the amount of bits in the key. With AES, like most modern block ciphers, the key size directly relates to the strength of the key / algorithm. The higher the stronger. Since all ...
Maarten Bodewes's user avatar
  • 91.9k
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,032
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.1k
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,287
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
  • 91.9k
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,607
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
  • 145k
14 votes
Accepted

Are all possible EC private keys valid?

I'll consider that you are using a 256-bit curve per ANS X9.62:2005. Not all 256-bit bitstrings are a formally valid private key; when using big-endian conventions, these must represent a strictly ...
fgrieu's user avatar
  • 138k
14 votes
Accepted

Two different keys decrypting same content

Most public key encryption schemes, such as PGP, support this. When you are encrypting a message to Bob, in fact you are encrypting the message with a random key using a symmetric cipher, then ...
Ángel's user avatar
  • 486
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
  • 138k
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
  • 145k
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,930
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

Are there attacks on AES with 16-bit keys?

There is no such thing as a 16 bit AES key. AES is a block cipher with a block size of 128 bits and a key size of 128, 192 or 256 bits. As a block cipher, AES can only encrypt 16 bytes (128) bits at a ...
Maarten Bodewes's user avatar
  • 91.9k
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
12 votes
Accepted

AES key reuse and guessing the key

You're missing a piece in your understanding of modern encryption. AES is a symmetrical block encryption cipher. It describes how to use a key (which can be 128, 192 or 256 bits long) to encrypt and ...
Stephane's user avatar
  • 276
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
  • 32k
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
  • 145k
12 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,405

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