Questions tagged [asn1]
The asn1 tag has no usage guidance.
32 questions
1
vote
1
answer
143
views
How to generate an X9.62 encoded ECDSA prime256v1 private key using OpenSSL?
I created a private key using Analog device's signtool. It can be found part of "CrossCore Embedded Studio for Blackfin, SHARC and SHARC+ - Release (Rev. 2.12.0)". Link: https://www.analog....
1
vote
2
answers
128
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 ...
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 ...
0
votes
0
answers
258
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 ...
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(...
0
votes
1
answer
181
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 ...
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 ...
1
vote
1
answer
606
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 ...
0
votes
0
answers
421
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 ...
2
votes
1
answer
2k
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 ...
1
vote
0
answers
115
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 ...
2
votes
0
answers
605
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, ...
5
votes
3
answers
4k
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. ...
2
votes
0
answers
434
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 ...
0
votes
1
answer
98
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 ...
4
votes
0
answers
254
views
ASN.1 encoding question
RecipientInfo ::= CHOICE {
ktri KeyTransRecipientInfo,
kari [1] KeyAgreeRecipientInfo,
kekri [2] KEKRecipientInfo,
pwri [3] PasswordRecipientInfo,
ori [4] OtherRecipientInfo }
KeyAgreeRecipientInfo ::...
6
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 ...
2
votes
0
answers
310
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 ...
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 ::=...
2
votes
1
answer
407
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 ...
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 ...
0
votes
1
answer
170
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:
...
10
votes
2
answers
556
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 ...
2
votes
0
answers
596
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 ...
2
votes
1
answer
139
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 ...
6
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 ...
1
vote
0
answers
107
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 ...
17
votes
1
answer
19k
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==
----...
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 ....
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),
...
6
votes
3
answers
2k
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 ...
2
votes
1
answer
2k
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] ...