Questions tagged [pkcs8]

Public-Key Cryptography Standard, number 8, describes the Private-Key Information Syntax Standard which is used to carry (encrypted or unencrypted) private certificate keypairs.

Public-Key Cryptography Standard, number 8, describes the Private-Key Information Syntax Standard which is used to carry (encrypted or unencrypted) private certificate keypairs. See RFC 5208.

16 questions
11
votes
1 answer

Why can ssh-keygen export a public key in PEM PKCS8 format?

In the documentation of ssh-keygen (man ssh-keygen) it says for the option -m that an export to the format “PKCS8” (PEM PKCS8 public key) is possible. That works, and I can read the files using openssl. But the thing that really confuses me: isn't…
Edward
  • 211
  • 1
  • 2
  • 5
7
votes
1 answer

Ed25519 PKCS8 private key example from IETF draft seems malformed

Malformed PKCS8 Key Algorithm Identifiers for Ed25519, Ed448, X25519 and X448 for use in the Internet X.509 Public Key Infrastructure § 10.3. Examples of Ed25519 Private Key states the following: An example of the same Ed25519 private key encoded…
neubert
  • 2,969
  • 1
  • 29
  • 58
6
votes
1 answer

What are the differences between plain and encrypted private keys?

It seems like there are different kind of private key formats, namely: PKCS#5 plain private key PKCS#8 plain private key PKCS#5 encrypted private key PKCS#8 encrypted private key I have seen these names of keys thrown around in articles and…
xenon
  • 235
  • 1
  • 2
  • 7
5
votes
1 answer

Why ssh-gen makes difference between PEM and PKCS8?

Correct me if I am wrong, but PKCS8 is format to store private key info. It could be binary-enoded (DER) or Base64 encoded (PEM). man ssh-config -m key_format Specify a key format for the -i (import) or -e (export) conver‐ …
user996142
  • 191
  • 1
  • 1
  • 4
4
votes
1 answer

ASN.1 OID of bcrypt

What is the ASN.1 OID associated to bcrypt (the key derivation scheme)? For instance, PBKDF2 has 1.2.840.113549.1.5.12 and it is therefore possible to store a private key in a PKCS#8 structure, encrypted with a password. Is that possible with…
3
votes
1 answer

What is the technical name for a public key container in DER format?

I have a public key in the following (format-neutral; the type is specified by the DER bytes) format: $ cat pubkey.der | openssl asn1parse -inform der -i 0:d=0 hl=4 l= 290 cons: SEQUENCE 4:d=1 hl=2 l= 13 cons: SEQUENCE 6:d=2 hl=2 l=…
mpontillo
  • 151
  • 7
2
votes
2 answers

How badly does disclosing an M-bit prefix of an N-bit private key compromise security?

I apologize profusely for knowing nothing about cryptography, please go easy on me! I'm working on a project where I have a 2048-bit RSA private key and a public certificate generated from the private key. I encrypt secrets at one end-point using…
0xbe5077ed
  • 123
  • 4
2
votes
1 answer

Kyber prime modulus p and base generator g

I am trying to learn more about Crystals Kyber. I am playing around with a Java implementation. I am only focussing on Kyber-512 for now, I have locally changed the source code in order to remove the DER PKCS8/X.509 encodings so my public/private…
Bart
  • 123
  • 4
1
vote
2 answers

Is PyCryptodome's export_key with passphrase secure?

When exporting a private key with PyCryptodome, DER format, PKCS#8 and a suitably strong passphrase, is the resulting exported key secure enough to place somewhere that you would not normally want sensitive information stored, such as a database or…
Stoopkid
  • 123
  • 3
1
vote
0 answers

How to get the key data from the pkcs#8 format?

Being newbie to crypto, I understood that RSA keys are shared are pairs $(e,n)$ or $(d,n)$. But when I was given a doc with keys, they were in PKCS#8 format. How to get the keys out of this format?
Maulik
  • 11
  • 2
1
vote
0 answers

Need help with PKCS#12 3 key triple des key expansion

I am trying to decrypt PKCS8-Shrouded Key Bag inside a PKCS#12 pfx file. The oid for the encrypted data is PbeWithSHAAnd3-KeyTripleDES CBC. Iteration count and salt has been provided within the pfx file, and I know the password. As far as I know,…
user45979
  • 11
  • 1
1
vote
0 answers

Is it possible to check private key syntax using openssl?

I have a DER-serialized private key. The tool I have to provide the key to gives me algid parse error, not a sequence, and it looks like the problem is that the key is not PKCS#8. The command that the most popular comment to the answer suggests,…
gicig
  • 111
  • 1
  • 2
0
votes
1 answer

creating PKCS8 private keys with a PBMAC1 hash

PKCS#8 provides two encryption schemes (PBES1 and PBES2) and one message authentication scheme (PBMAC1). It seems like a combined method (eg. authenticated encryption) would be ideal but whatever. Anyway, my question is... are there any tools in…
neubert
  • 2,969
  • 1
  • 29
  • 58
0
votes
0 answers

What format to use to store private and public key in one file other than a PKCS12 keystore?

TLDR I want to generate an X25519 keypair and then store it in a single file for easier handling, but I cannot use a keystore like PKCS#12. Why OpenSSL makes it quite easy to generate a private key in PEM encoding via: openssl genpkey -algorithm…
Leprechaun
  • 101
  • 1
0
votes
0 answers

How to extract a private key from .PFX file to .PEM file using AES-GCM as a password-based encryption?

I'm trying to extract a private key from a .PFX file to a .PEM file format. I was able to do it using Aes128Cbc in either .NET or OpenSSL: .NET: PbeParameters pbeParams = new PbeParameters(PbeEncryptionAlgorithm.Aes128Cbc, HashAlgorithmName.SHA256,…
1
2