Questions tagged [key-generation]

Key generation is the process of generating keys for cryptography. A key is used to encrypt and decrypt whatever data is being encrypted/decrypted.

Filter by
Sorted by
Tagged with
0 votes
0 answers
50 views

Is pass -> [via pbkdf2] -> seed -> ECDSA key pair better than pass(word) hashing?

For a web service, I am considering generating random 25-49 recovery codes as a kind of pass that can be stored in a pass manager (no usernames). Instead of pass(word) hashing on the server, I ...
r j's user avatar
  • 1
0 votes
0 answers
45 views

How does user activity affect entropy generation process in GnuPG?

Earlier today, I was using gpg to generate keys for work. While doing so, I noticed: We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, ...
Rahul Dixit's user avatar
4 votes
3 answers
990 views

Derive a key (and not store it) from a passphrase, to be used with AES

This is more of a request of auditing my approach, thus asking here might not the best way, and I apologize for that, but I really don't know how to otherwise talk to cryptography experts. I have some ...
cYrus's user avatar
  • 141
1 vote
0 answers
68 views

How can I encrypt files in a file transfer website? [closed]

I am a complete beginner and have almost no knowledge of encryption. I have a file transfer website that encrypt the files before saving them in the server then it decrypts the files to be ready to ...
Bob The Builder's user avatar
0 votes
1 answer
171 views

How to decrypt ECDSA_secp256k1 private key from PEM format generated with OpenSSL

I'm trying to decrypt an encrypted ECDSA_secp256k1 private key generated using the OpenSSL CLI command openssl ecparam -genkey -name secp256k1 | openssl ec -aes-128-cbc -out ecdsa_priv.pem but I want ...
petreze's user avatar
0 votes
1 answer
67 views

Permanent Keys/Secrets in TLS 1.3

In TLS 1.3 (RFC8446), there are many secrets and keys. As far as I've understood, every certificate (usually only the server) has a long term key associated with it which is used with HKDF to generate ...
bacle173's user avatar
2 votes
2 answers
462 views

SSH XMSS keypair generation and best practices

In a recent ssh -vv output, I saw OpenSSH mentioning a private key file id_xmss. XMSS is defined in RFC 8391, "XMSS: eXtended Merkle Signature Scheme", May 2018. OpenSSH has experimental ...
Tom Hale's user avatar
  • 2,795
2 votes
1 answer
419 views

Key management: Can I delete private key in asymmetric encryption?

If using asymmetric encryption, such as ES256, is there a reason why a private key could not be discarded after signing some data? For example with a JWT, or a file hash use for audit at a later date, ...
vbuser2004's user avatar
0 votes
1 answer
80 views

Hashing a secret key with a random string to generate a new key

Lets say Alice and Bob have a secret key k1. This key is 50 chars long and is cryptographically random. Alice generates a cryptographically random string (e.g. 16 chars long) and hashes this string ...
LUMPAAK's user avatar
1 vote
2 answers
7k views

Generate AES-256-GCM key

I'm using aes-256-gcm encryption. I used a sample key provided in the docs and it works fine. I also tried a key generated from here and it works fine. There's no option to specify gcm here yet the ...
Wilfred Almeida's user avatar
0 votes
1 answer
107 views

Is there a viable zero-knowledge approach for using oAuth to generate and manage private keys?

I've been doing a deep dive into how products like Web3Auth work under the hood and wonder if this is a viable approach to building applications where a user can have the convenience of using oAuth to ...
user3458571's user avatar
0 votes
1 answer
263 views

Key derivation for HMAC, concatenate vs multiple HMAC passes

I'm trying to build a generic function to encrypt HMAC values with a single global secret key, but that can be "scoped" or salted by application/uses. For instance, an HMAC for a session ...
Cristiano Coelho's user avatar
0 votes
0 answers
70 views

Create "bare" pgp private key / Make private key without being able to generate the public key from it

How do you create a private-key/public-key pair without the public key's information in the private key? So you should basically not be able to extract the public key from the private key. The private ...
Myzel394's user avatar
  • 142
0 votes
1 answer
394 views

How to generate an expired key with gpg?

For testing purposes, I need a PGP key for a specific uid that has already expired. Using gpg --full-generate-key only gives me the following options: Please specify how long the key should be valid. ...
not2savvy's user avatar
  • 742
0 votes
1 answer
71 views

How can a client safely post/get a (symmetric) client key to/from a key distribution center?

If you look at the above Kerberos protocol's diagram, you can find that the protocol works on the basis that the (symmetric) client key initially exists on both the client node and the key ...
hurryman2212's user avatar
1 vote
1 answer
137 views

SCrypt's goal and the role its salt plays

Am I right in stating that SCrypt as an algorithm is useful where many passwords are stored in a database, but not against one specific encryption key derived from one password of one user? For ...
Neev Penkar's user avatar
0 votes
1 answer
612 views

Why can't you use True Random Number Generator (TRNG) to generate key stream in Stream Ciphers?

I read in the book that you cannot use True Random Number Generator (TRNG) to generate key stream in Stream Ciphers: We need some type of random number generator to derive the key stream. First, we ...
Rodion Iskhakov's user avatar
1 vote
1 answer
185 views

Uses for TR-31 Key Version Number?

The standard for TR-31 (and Thales) Key blocks (ref) have a field for "Key Version Number", which is only defined in the spec as Two-digit ASCII character version number, optionally used to ...
Bobson's user avatar
  • 1,447
1 vote
2 answers
440 views

which principles for ssh key algo selection I should use for git-mainly operations?

which rules I should choose for ssh algo selection, provided it will be used near 100% for git operations? I'm going to use it with git on linux laptops, often used on public wifi. currently I have: ...
aytvill's user avatar
  • 13
2 votes
0 answers
219 views

Is it possible to regenerate the stub private key from just the physical key in OpenSSH?

Let's say I make an id of type ed25519-sk and have it reside on my yubikey. OpenSSH makes two files, id_ed25519_sk, a stub private key, and id_ed25519_sk.pub the corresponding public key. If I lose ...
nimish's user avatar
  • 121
10 votes
2 answers
5k views

Is "Math.random" the same as "crypto.getRandomValues" (JavaScript security)

This question may be a little off-topic, but is Math.random the same as crypto.getRandomValues? (JavaScript) Here's an example: Math.random(); // 0.11918419514323941 self.crypto.getRandomValues(new ...
Parking Master's user avatar
12 votes
2 answers
5k views

Why does an encryption key derived from your lock screen password give you stronger protection (in Android 11)?

Why does an encryption key derived from your lock screen password give you "stronger protection" than a key chosen by the machine (or at any rate not derived from your lock screen password)? ...
Catomic's user avatar
  • 227
2 votes
2 answers
445 views

How to detect weak SSH keys affected by CVE-2021-41117

Recently, GitLab[1] and GitKraken[2] notified users about a vulnerability in GitKraken version v in range 7.6.0<=v<=8.0.0. Those versions are affected by CVE-2021-41117[3] and therefore, ...
Danny Lo's user avatar
  • 121
1 vote
1 answer
207 views

Generate key pair and entropy

I would like to use the method described in https://connect2id.com/products/nimbus-jose-jwt/examples/jwk-generation to generate a key pair in a java application: import java.util.*; import com....
Marco Altieri's user avatar
3 votes
1 answer
2k views

GnuPG now uses ECC 25519 as default on new key generation - any compatibility issues to worry about?

TL;DR: I'm assuming that if GnuPG made it a default then it should be what we use, but it used "bad" defaults in the past so I'm wondering if there are any tradeoffs to this? More ...
namcios's user avatar
  • 33
0 votes
1 answer
137 views

How to securely encrypt shared data for a dynamic amount of users?

Example: Bob uploads a file to my custom file server locked with a password, which then the file server generates a link for him to share Bob wants to be able to share this data to anyone that has ...
Joshua Benfield's user avatar
1 vote
2 answers
191 views

Deriving digital signature key pair deterministically from an arbitrary secret

Is there a scheme that let people derive public/private key pair from arbitrary secrets? As you may know, digital signature schemes have versatile use cases. The problem is, the key pair handling is ...
Curious Sam's user avatar
0 votes
0 answers
88 views

The hidden perils of trying to handle bad rare outcomes

I vaguely remember some story about some cipher (I think it was 3DES) having some "issue" where if the key happened to be especially bad (like 0x00000...) then the resulting encryption ...
Phil Frost's user avatar
0 votes
1 answer
242 views

Generating a DER-encoded DSA public key of a particular file size

I am reverse engineering a binary that contains a raw, DER-encoded X.509 certificate containing a DSA public key. I want to replace this certificate with one that I have generated so that I have ...
senz's user avatar
  • 1
1 vote
1 answer
131 views

How is the initial request made to the Access Server in Kerberos?

I'm trying to understand how Kerberos works, in particular how the initial client sends a request to the Access Server. Some YouTube videos I've seen say the initial request is partially encrypted ...
northerner's user avatar
0 votes
2 answers
833 views

Storing a key in a symmetric encryption for password manager using cryptography module

I am making a password manager and generator. The user creates the login information, and then I hash their password. After that, I generate the password and encrypt the password with a key stored ...
Mr_Westhead's user avatar
1 vote
1 answer
570 views

Key pairs extension / version

I read in some docs, there are several version of GPG key extension available. For ex: gpg, ascii, p12 I know .gpg extension is in binary, and Ascii is in text. But I want to know their differences ...
tadata's user avatar
  • 13
1 vote
1 answer
455 views

How can we use a symmetric key for signing data on TPM2.0?

I am trying to sign some data with a symmetric key AES128 on the TPM2. However, I get this error during the signing ERROR: Unknown key type, got: 0x25 ERROR: bad signature scheme for key type! ERROR: ...
CyberHunter's user avatar
8 votes
2 answers
3k views

TPM or OpenSSL for key generation?

I would like to know which method is more secured. I know that they can be combined, but I would like to understand why TPM or OpenSSL might be a more secure technique to generate (encryption, ...
CyberHunter's user avatar
1 vote
1 answer
966 views

How to convert 64byte openssh-key-v1 to the resulting 32byte ed25519 private key

I wrote an openssh-key-v1 Protocol reader and extracted all fields according to the format definition: "openssh-key-v1"0x00 # NULL-terminated "Auth Magic" string 32-bit length,...
Richard Burkhardt's user avatar
0 votes
0 answers
47 views

How does collecting mouse movements increase cryptographic strength? [duplicate]

Excuse me if this is obvious, but while encrypting one of my disks, I got bored and read the text on the window. And the question came to me, how the heck can I move a mouse in a way that a computer ...
tuskiomi's user avatar
  • 192
1 vote
1 answer
176 views

Private keys with or without password for webservices?

What is the industry standard on this matter? How do you handle the keys for your websites, apis, micro-services, etc. If I create private keys without password they will be 100% compromised if one ...
JoeSlav's user avatar
  • 61
0 votes
0 answers
324 views

symmetric key generation in TLS 1.3

Am trying to understand the phase where the symmetric key is getting generating. From what I am understanding Diffie-Hellman is used to derive the symmetric key in TLS1.3 I am reading this tls ...
loutsi1's user avatar
  • 51
0 votes
1 answer
545 views

Difference between these two extracted public keys?

I generated an RSA Private Key using openssl genrsa -out mykey.pem 2048 To extract the public key I have found 2 commands, one using openssl : openssl rsa -in mykey.pem -pubout > mykey.pub And the ...
Mit94's user avatar
  • 103
1 vote
3 answers
2k views

Does a X.509 Certificate contain an ID of the Private Key?

Does a X.509 Certificate contain some kind of ID that is associated with the Private Key that was used to create the Certificate? So if i had a database of all my Private Key IDs, i could then look at ...
PixelPaul's user avatar
  • 185
7 votes
1 answer
759 views

Why we are still required to move the mouse when generating the keys in VeraCrypt?

During the setup of a new encrypted volume, the VeraCrypt requires a random mouse movement within the window. If someone looking from the outside can see that a monkey sitting in front of a computer ...
kelalaka's user avatar
  • 5,504
1 vote
0 answers
106 views

Reusing content-encryption key in cms enveloped data

OpenSSL keeps the structure CMS_ContentInfo opaque and in the case of enveloped data generates and manages the content-encryption key completely by itself. It is not possible to provide a content-...
phlipsy's user avatar
  • 111
0 votes
0 answers
252 views

Client-side encryption of data, but the server can also add data without reading stored data

For a new application I'd like to store messages for each user's account on a centralized server. The user accesses the application through a SPA javascript web app through their browser. These ...
fli's user avatar
  • 1
0 votes
0 answers
112 views

Does hashing client-side increase attack surface (assuming TLS and serverside salt+hash)? [duplicate]

This question asks whether one should hash on the client or the server. I want to know if there is any reason, aside from having to maybe handle one extra hashing library (if it's not already in your ...
DeusXMachina's user avatar
4 votes
1 answer
3k views

gpg --quick-generate-key user-id [algo [usage [expire]]] - Any way to include a comment?

I am doing some unattended key generation using --quick-gen-key and --quick-add-key. I am not clear if the user-id mentioned in the man page offers a way to include a comment: --quick-generate-key ...
Diagon's user avatar
  • 303
0 votes
1 answer
1k views

gpg: How do we Cross-Sign Keys? (--default-key vs. --local-user)

I'm trying to figure out how to cross-sign two keys. One reference says we should use: gpg --local-user 0xfedcba98 --edit 0x76543210 sign gpg --local-user 0x76543210 --edit 0xfedcba98 sign That's an ...
Diagon's user avatar
  • 303
0 votes
1 answer
392 views

What's a secure way to generate a keypair from a secret password?

I like to generate a public-private key pair that is seeded from a string. So having the string and the generation algorithm is enough to recreate the keys. I want to do this because I can then ...
HappyFace's user avatar
  • 121
0 votes
1 answer
259 views

Is there any added benefit to using a random keyfile of more than 512 bits?

Most of the online guides I found about using dm-crypt with a random keyfile use files bigger than 512 bits (64 bytes). For example: dd bs=512 count=4 if=/dev/urandom of=keyfile iflags=fullblock As ...
Hauyz's user avatar
  • 11
2 votes
2 answers
207 views

Password relevance in key derivation function

I'm questioning the password used in a key derivation function, whether It makes sense to make it unique for every generated symmetric key and why
NowsyMe's user avatar
  • 167
5 votes
1 answer
2k views

OpenVPN Key Size 1024 vs 2048 and Eavesdrop vs Access?

OpenVPN recommends using a 2048 RSA key size for greater security, however, the hardware I'm using is somewhat weak and defaults to using a 1024 RSA key size. I'm trying to determine if it's worth ...
Harry Muscle's user avatar

1
2 3 4 5
7