Questions tagged [asn.1]
Abstract Syntax Notation One (ASN.1) is a language that defines the way data is sent across dissimilar communication systems.
36
questions
2
votes
0
answers
328
views
How to recognize DER nested OCTET SEQUENCEs?
I asked OpenSSL to generate a dummy Ed25519 private key for me and got this output:
https://lapo.it/asn1js/#MC4CAQAwBQYDK2VwBCIEIJCO9eKZEUOmL9CGfecuKqvYU_hLTAFXwl0Ipd8xNXbP
It decodes to the following:...
0
votes
1
answer
268
views
Verify message digest of time stamp token
I'm trying to verify a time stamp token embedded into a PDF using the PDF 2.0 feature of the "Document Time-stamp Dictionary". The embedded time stamp token is exactly the token of a time ...
2
votes
1
answer
287
views
ASN.1 integer question for DSA
I'm trying to implement own DSA signature check as per guide at this site page 20 in python.
...
1
vote
1
answer
166
views
Do RSA powers of two modulus always have MSB set to one and so when DER encoded have 0x00 prefix?
Looking at https://crypto.stackexchange.com/a/30616/16548 and all the ways I generate RSA keys (code, SSL) the MSB is always 1 and so when DER encoded has 0x00 ...
2
votes
0
answers
79
views
Is CMS for data still relevant
I have an application where I need to store small to moderate amounts of data in a symmetrically encrypted form. For various reasons, CMS with an AuthEnvelopedData seems to tick all the requirements.
...
1
vote
0
answers
30
views
For most applications of CMS, does the size of the payloads ever exceed that of a 32-bit integer?
For my hobby cryptography project, I'm planning to implement some helper functions that parses a subset of ASN.1 BER encoding without using a ASN.1 compiler. For this purpose, I'd like to use 32-bit ...
2
votes
1
answer
1k
views
Encode ASN.1 PKCS#8 Private Key with Public Key and attributes
I'm trying to encode an Ed25519 private key as a PEM file based on this document https://www.rfc-editor.org/rfc/rfc8410#page-7 .
I'm using an ASN.1 encoder written in Dart, and I can encode the ...
3
votes
1
answer
2k
views
PKCS#7 CMS - Message digest calculation process
i'm studying RFC 5652 in order to know exactly how to encode/decode PKCS#7 ASN.1 data.
I don't understand how one can create a signature when the field "signedAttrs" is present:
The result ...
0
votes
1
answer
57
views
Where can I read about DER certificate structure - fields and its registered values?
Where is an official documentation for ASN1 structure and values of x509 certs?
Using OpenSSL command like openssl asn1parse -in server.der -inform DER I can see ...
2
votes
2
answers
1k
views
openSSL created CSR signature size of 73 bytes but should't it be 70 bytes
after creating CSR using openSSL with secp256r1 curve
inspecting the file using openssl asn1parse -i -in ecTest.csr
the size of ...
0
votes
1
answer
560
views
Why is an RSA public key BITWRAP-ed in ASN.1 DER encoding?
While playing around with creating an RSA public key, and decoding it using a home brew ASN.1 decoder, I ran into the fact that the public key is BITWRAP-ed. BITWRAP seems to be an OpenSSL modifier, ...
5
votes
1
answer
6k
views
Converting raw ECC private key into ASN.1 DER encoded key
I created a random integer array of 32 bytes to use as my private key for secp256k1 curve.
...
1
vote
1
answer
606
views
X.509 ECDSA signature field in DER format includes '00' between bit string and sequence of r and s
I created a X.509 certificate with ECDSAwithSHA256(OID=1.2.840.10045.4.3.2) by openssl.
ECC parameter is secp256r1.
Following is the signatureAlgorithm and signatureValue.
...
1
vote
1
answer
746
views
Are EdDSA algorithms encoded by ASN.1 DER standards?
Is it required, or widely practiced to encode a EdDSA signature as a ASN.1 Sequence? Why or why not? How should you encode a EdDSA signature? I cannot find mention of DER or ASN in the EdDSA RFC.
...
1
vote
1
answer
1k
views
PKCS#7 non-detached Signature - Help understand the message structure
I am pretty new to ASN.1 format. I have a PKCS#7 signature which after doing an ASNdump looks like the one below. Can someone help me understand what each element below signifies? I could only ...
1
vote
2
answers
2k
views
Why is the signature field in X.509 a BIT STRING, despite there being ASN.1 (DER) data inside?
As can be seen from the following ASN.1 definition of an X.509 certificate, the Signature field is a BIT STRING.
...
4
votes
2
answers
1k
views
Why is the signatureAlgorithm field in X.509 certificates redundant?
See the ASN.1 description of an X.509 certificate below:
...
2
votes
1
answer
3k
views
Length of message in RSA and splitting of long messages
If I understand correctly in (unpadded) RSA the length of message M must be shorter than modulus n.
Encryption gives ciphertext that is also shorter than n.
Let's say I want to send a message of 2....
5
votes
1
answer
3k
views
What are these fields in ASN.1 encoding of RSA
Nice resource for ASN.1 structured RSA keys https://etherhack.co.uk/asymmetric/docs/rsa_key_breakdown.html in private key section shows following RSA private key related fields:
modulus
public exp
...
2
votes
1
answer
1k
views
Converting a "raw" non-ASN.1 EC private key to a public key?
I have this ECDSA private key that isn't very important, but I do not have it in any other format.
008AF2DA031B2DC39FBE418A238EFDA3B10ABC7C77FE12A750BFE899
I ...
3
votes
0
answers
233
views
Prime extension field encoding ASN.1
ASN.1 encoding for elliptic curve cryptography is recommended by Certicom, as explained at a related question, covering curves over prime fields and binary extension fields.
I'm looking for known ...
4
votes
1
answer
276
views
representing binary finite fields in ASN.1
In SEC 2: Recommended Elliptic Curve Domain Parameters two types of finite fields are utilized - $\mathbb{F}_p$ and $\mathbb{F}_{2^m}$. In the case of sect193r1, $\mathbb{F}_{2^m}$ is the finite field,...
1
vote
1
answer
1k
views
Correcting Improperly Formatted EC Private Keys [closed]
We are currently generating a secp521r1 key as follows using cryptography for Python:
...
3
votes
1
answer
1k
views
What's the ASN.1 structure of ECIES encryption result? [closed]
I got a ECIES encryption result and a publickey,the publickey after decoding to ASN.1, I obtained the following:
...
3
votes
1
answer
198
views
X509 certificates: Two Algorithm Identifiers?
I'm wondering why there are two Algorithm Identifiers in a X509 certificate. One is in the "to be signed" part and the other one is at the end right before the actual signature.
Are they used for the ...
3
votes
1
answer
325
views
converting finite field elements to octet strings
I need to convert elements of the finite field $GF(p^k)$, where $p$ is an odd prime, to octet strings.
To be more precise, I want to include elliptic curve points over $GF(p^2)$ in a Subject Public ...
1
vote
1
answer
210
views
Are there any existing ASN.1 structures for transferring symmetric keys?
Is there any reasonable ASN.1 standard to encode symmetric keys?
I found PSKC, but it seems extremely heavy, and I can't quite find any library (e.g. bouncycastle) that would simplify using it.
If all ...
8
votes
1
answer
4k
views
How is OID 2a 86 48 86 f7 0d parsed as 1.2.840.113549?
I saw that an RSA key, created by OpenSSL, contains the following HEX string:
2a 86 48 86 f7 0d 01 01 01
that HEX string gets interpreted as Object ID:
1.2.840.113549.1.1.1
It is obvious 01 01 ...
8
votes
2
answers
3k
views
BER or DER X9.62 for ECDSA signature
The signature format for ECDSA signatures can be encoded using ASN.1 integers according to X9.62 or it can comprise of two integers with the same size as the key size.
In case the X9.62 format is ...
3
votes
2
answers
2k
views
ASN.1 encoding off RSASSA-PSS default parameters
I am not totally sure the question belongs to crypto and not stackoverflow but nevertheless...
The problem is the encoding of the RSASSA-PSS default algorithm identifier parameters in an X509 ...
4
votes
3
answers
929
views
Verifying DER encoded DSA/ECDSA signature with extra content?
Having a DSA/ECDSA signature which is supposed to be DER encoded as an ASN.1 sequence of $r$ and $s$ (as described in the RFC), and being given some bytes which are ...
2
votes
2
answers
299
views
What does OIW stand for
There seem to be many OID's that have been put in the ASN.1 tree that have the following ISO identified organization: OIW.
One example is SHA-1 (ElGamal seems to be another):
...
5
votes
2
answers
5k
views
How to specify a NIST SP 800-108 KBKDF
Strange question maybe, but say I want to specify a protocol that complies with NIST SP 800-108. This lists a whole set of key based key derivation functions, with a very loose set of parameters.
How ...
4
votes
1
answer
254
views
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 ...
7
votes
2
answers
4k
views
How do I unpack the x and y values from the BITSTRING in a DER ECDSA public key?
In ASN.1, the X and Y values for a 256-bit elliptic curve key are stored as a single 66-byte ASN.1 BITSTRING. Are the values just the first and second half of this bitstring?
The private key is an ...
13
votes
2
answers
35k
views
How can I convert a DER ECDSA signature to ASN.1?
I having trouble verifying an ECDSA signature signed using client side javascript with Java/BouncyCastle.
The javascript signing function source:
...