Questions tagged [keys]

Private and secret keys consists of secret information used as input to various kinds of cryptographic algorithms such as encryption, signature and MAC to select the concrete transformation done by the algorithm.

Asymmetric cryptography commonly uses pairs of one private and public keys. Symmetric cryptosystems use the same secret key for all participants.

Algorithms and protocols should be designed not to leak information about the secret/private key even if the attacker can control all other input and see all output.

Suitable questions for this tag could be about key generation, key size considerations, key agreement (DH) or key derivation. Key derivation can be split into derivation from other keys (KBKDF) or from passwords (PBKDF).


Sometimes - notably in books / lectures of Dr Katz - secret keys are used in asymmetric cryptosystems while private keys are used for symmetric cryptosystems. This is however usually not the case.

904 questions
177
votes
2 answers

What is the main difference between a key, an IV and a nonce?

What are the main differences between a nonce, a key and an IV? Without any doubt the key should be kept secret. But what about the nonce and the IV? What's the main difference between them and their purposes? Is it only that, in literature and in…
curious
  • 6,280
  • 6
  • 34
  • 48
52
votes
5 answers

How to find modulus from a RSA public key?

I am studying the RSA cryptosystem. The public key consists of $(n, e)$, the modulus (product of two large primes), and the encryption exponent. I want to separate the modulus $n$ and exponent $e$. A typical public key is expressed in base64, and is…
user3001408
  • 623
  • 1
  • 6
  • 5
51
votes
2 answers

Differences between the terms "pre-master secret", "master secret", "private key", and "shared secret"?

Both crypto.SE and security.SE have excellent Q&As about how TLS generates session keys (I have linked some at the bottom). In reading these threads I'm having troubles with terminology since the following terms seem to be used with overlapping…
Mike Ounsworth
  • 3,717
  • 1
  • 20
  • 29
49
votes
1 answer

Why do all SSH-RSA Keys begin with "AAAAB3NzaC1yc"?

My friend and I have been generating a few SSH2 RSA keys and noticed all the public keys begin with AAAAB3NzaC1yc, with the similarity extending to AAAAB3NzaC1yc2EAAAABIwAAAQEA between two keys generated on the same machine in two successive…
Lord Loh.
  • 705
  • 1
  • 8
  • 12
48
votes
3 answers

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

I am working on a web application enabling users to communicate over private messages which is just one part of the whole system. The main focus during my development process is to protect the privacy of my users, I think this should be one of the…
user34484
44
votes
1 answer

Can I remove newlines in a public key?

Can I remove new lines from the RSA public key file to get a one line string? So the question is if the key looks like this AAA BBB CCC or AAA\n\rBBB\n\rCCC\n\r is this the same as AAABBBCCC
xpepermint
  • 543
  • 1
  • 4
  • 5
32
votes
6 answers

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

I recently noticed a .NET software using PBKDF to derive an encryption key from a password string. This password string was dynamically generated using System.Random. Now, I know that System.Random is not really cryptographically random and should…
32
votes
2 answers

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

What are KDFs? What are their main purposes? How they can be used, in other words, what's their drill in a cryptography scheme?
Samuel Paz
  • 485
  • 1
  • 4
  • 6
32
votes
2 answers

Using the same RSA keypair to sign and encrypt

The RSA signature operation is basically the same as encrypting with the private key. In particular, both operations use the same kind of keys. Is it safe to use the same RSA keypair both for encryption / decryption and for signing / verification?
Lay András
  • 421
  • 1
  • 4
  • 3
31
votes
7 answers

How can SSL secure a two-way communication with only one key-pair?

As I understand it, SSL involved the use of a public-private key pair. How does this enable two-way communication? Suppose I have some server with which I wish to communicate securely. I connect to it, and it supplies me a certificate, which…
GWLlosa
  • 659
  • 1
  • 6
  • 8
31
votes
2 answers

When using Curve25519, why does the private key always have a fixed bit at 2^254?

When using Curve25519, the private key always seems to have a fixed bit set at position $2^{254}$. Why is that? Is there any good reason to use a fixed positioned most-significant-bit in the private key?
Trina
  • 694
  • 7
  • 21
25
votes
5 answers

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

I'm trying to study how HSM and TPM works when storing secret data in clear text. How can they achieve physical impossibility in retrieving secret data? I get the point in software, if you just have input and no outputs then it should be impossible…
einstein
  • 431
  • 5
  • 8
25
votes
4 answers

How many RSA keys before a collision?

I was wondering how many possible private/public keys exist? If a million people – for whatever reason – would try to generate 5 keys each in the same minute (on the same date and time) is there a high chance of collision? I believe GUID would…
Nick wheatley
  • 363
  • 1
  • 3
  • 5
22
votes
1 answer

Related-key attacks on AES

According to Wikipedia: Related-key attacks can break AES-192 and AES-256 with complexities $2^{176}$ and $2^{99.5}$, respectively. What are the requirements for these attacks (i.e how many related keys, what should the relationship between the…
Chris Smith
  • 1,202
  • 1
  • 11
  • 18
21
votes
6 answers

Why does PBKDF2 xor the iterations of the hash function together?

The definition of PBKDF2 states that I obtain a derived key (1) by calling a pseudorandom function a bunch of times recursively: $U_1 = PRF(password, salt)$ $U_2 = PRF(password, U_1)$ … $U_n = PRF(password, U_n-1)$ The standard then defines the…
Cameron Skinner
  • 313
  • 2
  • 7
1
2 3
60 61