Questions tagged [asn1]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
75 views

what are the valid characters in an ASN.1 name?

In ASN.1 you'll have definitions like this: id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 } X.680 (page 22) says the following: Each production consists of the following parts, on one or ...
neubert's user avatar
  • 1,748
0 votes
0 answers
2k views

How to save AES Key in PEM file

I'd like to store a private symmetric key, aes-256, in a PEM file. My understanding is that usually these types of keys are derived using RSA/EC DH and there's no need to save them, but in my ...
emartin's user avatar
0 votes
0 answers
226 views

OpenSSL cli: how to extract ESSCertID or ESSCertIDv2 from SignerInfo of timestamp token

If I have a Timestamp token, then the signing certificate for the token is identified via the ESSCertID (for RFC3161 tokens) or the ESSCertIDv2 (for FC5816) of the signing certificate, which is the ...
matthias_buehlmann's user avatar
0 votes
2 answers
1k views

Signing CSR using an ECC keypair

I'm trying to sign a CSR using python-asn1crypto and python-pkcs11. I have an ECC Keypair stored in a Hardware Security Module (HSM). Here's a code sample: key = decode_ec_public_key(...
No name's user avatar
  • 213
0 votes
1 answer
167 views

Where are field names of decoded human readable X.509 certificates specified?

The ASN.1 module for X.509 certificates as specified in RFC 5912 - Section 14 is as follows: TBSCertificate ::= SEQUENCE { version [0] Version DEFAULT v1, serialNumber ...
goulashsoup's user avatar
1 vote
1 answer
2k views

how to generate RSAES-OAEP keys?

RFC4055 describes RSAES-OAEP keys and RSASSA-PSS keys. OpenSSL's genpkey utility supports let's you generate RSASSA-PSS keys (you have to set the aglorithm parameter to RSA-PSS) but if it supports ...
neubert's user avatar
  • 1,748
1 vote
1 answer
562 views

OpenSSL ECC key - Additional byte in DER encoding for one curve

In the below, I use OpenSSL to create a private key for the secp224k1 curve. Note the length of the private key in the DER - 0x1d. That's 29 bytes, or 232 bits, not 224. It appears that a leading zero ...
AJM's user avatar
  • 117
0 votes
0 answers
363 views

Can I use OpenSSL to generate a key from asn1 configuration file without specifying the modular multiplicative inverse q^-1 (mod p)

I'm trying to create this gimmicky public-private RSA key pair where p and q are the same number. I would want to use the asn1 parser in OpenSSL, but I'm required to specify the coeff parameter, the ...
Magnus's user avatar
  • 377
2 votes
1 answer
1k views

ASN.1 encoding of X25519 private key

I'm using mbed TLS for ECDH key agreement using Curve25519. The private and public keys are stored and transmitted as Hex strings as easily generated with mbed TLS. Those strings are big-endian. This ...
signpainter's user avatar
1 vote
0 answers
105 views

RFC6960 requested ocsp service definition

In RFC6960 (https://www.rfc-editor.org/rfc/rfc6960) is written the request data contains the requested service and the OCSP responder checks, if the requested service is provided. But when I had a ...
micha's user avatar
  • 11
2 votes
0 answers
575 views

ASN.1-based network protocol fuzzer [closed]

I want to do network protocol-based fuzzing using a network protocol specified in ASN.1. After investigating the available open source tools, I need to decide between the Peach community edition, ...
Pete's user avatar
  • 21
5 votes
3 answers
3k views

ASN.1 encapsulated BITSTRING type in openSSL

I am currently building an ASN.1 parser which supposed to decode X.509v3 certificates and epoch files in ASN.1 DER format. The parser is working well apart from one issue which I couldn't seem to get. ...
Dima Shifrin's user avatar
2 votes
0 answers
384 views

ASN1 Public Key Signature Verification

I'm interested in handling licenses I distribute with my app with ASN1 and including the Public Key within my application. I've already created the Private/Public Keys, but my confusion is in how the ...
Jack O'Leary's user avatar
0 votes
1 answer
87 views

What threats and mitigations are there for a CA when processing a CSR?

Question What kinds of technical nastiness/attacks should I look for in a Certificate Request (CSR) ? Assume the ASN1 parser is secure on the CA. I'm strictly concerned with the process of ...
makerofthings7's user avatar
4 votes
0 answers
239 views

ASN.1 encoding question

RecipientInfo ::= CHOICE { ktri KeyTransRecipientInfo, kari [1] KeyAgreeRecipientInfo, kekri [2] KEKRecipientInfo, pwri [3] PasswordRecipientInfo, ori [4] OtherRecipientInfo } KeyAgreeRecipientInfo ::...
Chris's user avatar
  • 141
5 votes
1 answer
1k views

Why are there leading 0x00 bytes in the subjectPublicKey field of a DER X.509 cert?

For a simple example, I'm using a 512-bit RSA cert to illustrate my question. The cert can be found in both DER and PEM form here. I've been going through the certificate using this ASN.1 decoder (the ...
Stipe Matic's user avatar
2 votes
0 answers
291 views

Finding the EMSA-PKCS1-v1_5 DigestAlgorithm field in the x509 certificate

From the RFC - https://www.ietf.org/rfc/rfc3447.txt A.2.4 RSASSA-PKCS1-v1_5 For each OID, the parameters field associated with this OID in a value of type AlgorithmIdentifier shall have a value ...
user93353's user avatar
  • 2,022
4 votes
1 answer
2k views

encoding of optional NULL in DER

In PKCS1 there's DigestInfo: DigestInfo ::= SEQUENCE { digestAlgorithm AlgorithmIdentifier, digest OCTET STRING } AlgorithmIdentifier is defined in RFC5280: AlgorithmIdentifier ::=...
neubert's user avatar
  • 1,748
2 votes
1 answer
398 views

Why is the digest algorithm specified in two places in CMS / PKCS7?

In RFC5652, Cryptographic Message Syntax (CMS), section 5.3. SignerInfo Type, there's a digestAlgorithm field that has values like id-sha256, id-sha1, etc. In that same RFC, section 5.1. SignedData ...
neubert's user avatar
  • 1,748
1 vote
1 answer
1k views

How do I get the subject public key from a PKCS7 message?

Quoting RFC4562, Cryptographic Message Syntax (CMS), section 5.6. Signature Verification Process: The recipient MAY obtain the correct public key for the signer by any means, but the preferred ...
neubert's user avatar
  • 1,748
0 votes
1 answer
156 views

extendedCertificate's in PKCS7 / CMS

In PKCS7 / CMS, for the signed-data content type, there's a CertifcateChoices field in the certicates field in SignedData that is a SET of CertificateChoices. CertificateChoices is defined thusly: ...
neubert's user avatar
  • 1,748
10 votes
2 answers
545 views

Are there any meta-formats for crypto?

Are there are any (properly specified) meta-formats / schema formats for describing cryptographic message structures? I'm looking for a way to describe the format (where some channels might want ...
cloudfeet's user avatar
  • 2,548
2 votes
0 answers
559 views

CMS/PKCS#7: specifying signatureAlgorithm with digest?

I'm confused about algorithm selection for Cryptographic Message Syntax (a.k.a. CMS, PKCS#7) signed objects (RFC5652 Section 5.1). The SignerInfo structure (RFC5652 Section 5.3) has two separate ...
Richard Hansen's user avatar
2 votes
1 answer
133 views

Downloadable Autonomous System contact information

When under (a security) attack, it might be useful for the victim to first identify the source IP, then potentially contact the offending ISP. There seem to be plenty of tools for the part where an IP ...
sandyp's user avatar
  • 1,124
5 votes
3 answers
3k views

What part of the CSR is hashed in order to create its signature?

I'd like to change the CSR before it is transferred to the CA without going through the CSR creation process again. To do that I need to know how to calculate the signature of the CSR after I modified ...
jhscheer's user avatar
  • 201
1 vote
0 answers
99 views

is this optional keyword redundant? [closed]

KDC-REQ ::= SEQUENCE { -- NOTE: first tag is [1], not [0] pvno [1] INTEGER (5) , msg-type [2] INTEGER (10 -- AS -- | 12 -- TGS --), padata [3] SEQUENCE OF PA-DATA ...
neubert's user avatar
  • 1,748
15 votes
1 answer
18k views

Why does openssl writes EC parameters when generating private key?

When I'm generating a private key with openssl, it writes the curve's parameters, and the actual private key: ❯ openssl ecparam -name secp256k1 -genkey -----BEGIN EC PARAMETERS----- BgUrgQQACg== ----...
Elazar Leibovich's user avatar
4 votes
1 answer
4k views

How to verify the signature in an iOS Passbook pass?

The Passbook application in the new iOS6 keeps track of movie tickets, coupons, and other 'passes' for you, and the passes themselves are loaded onto the user's device via file packages with the ....
MidnightLightning's user avatar
8 votes
2 answers
6k views

ASN.1: ENUMERATED vs INTEGER

From the X.509 specs: CRLReason ::= ENUMERATED { unspecified (0), keyCompromise (1), cACompromise (2), affiliationChanged (3), ...
ansur's user avatar
  • 183
6 votes
3 answers
1k views

How do I test and secure ASN.1 Parsers?

As far as I can tell, .NET doesn't have an ASN.1 parser for reading or writing data built in the framework. This means that any code that creates or verifies ASN.1 data is using a 3rd party library ...
makerofthings7's user avatar
2 votes
1 answer
1k views

question about implicitly tags in ASN.1

From the X.509 RFC, in the "Implicitly Tagged Module" section: CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint DistributionPoint ::= SEQUENCE { distributionPoint [0] ...
compcert's user avatar
  • 641