Questions tagged [asn.1]

Abstract Syntax Notation One (ASN.1) is a language that defines the way data is sent across dissimilar communication systems.

Abstract Syntax Notation One (ASN.1) is a language that defines the way data is sent across dissimilar communication systems.

ASN.1 ensures that the data received is the same as the data transmitted by providing a common syntax for specifying Application layer (program-to-program communications) protocols.

ASN.1 is an ISO /ITU standard based on the OSI model. It was first defined in 1984 as part of CCITT X.409; revised in 1995; then became its own standard, X.208, in 1998.

38 questions
13
votes
2 answers

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: sign: function (hash, priv) { var d = priv; var n = ecparams.getN(); var e =…
Ben
  • 241
  • 1
  • 2
  • 6
8
votes
1 answer

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 01 is 1.1.1, but how does 2a 86 48 86 f7 0d get…
Matt Elson
  • 729
  • 7
  • 14
8
votes
2 answers

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 used is it mandatory to use DER encoding…
Maarten Bodewes
  • 96,351
  • 14
  • 169
  • 323
7
votes
2 answers

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 OCTET STRING at the beginning of the DER private key…
joeforker
  • 571
  • 5
  • 13
5
votes
1 answer

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. const uint8_t secret[] = {0xb2,0x9a,0xc6,0xbd,0xc7,0x3d,0xc4,0xe1, 0x85,0xa7,0x3c,0x96,0xf8,0x1c,0x58,0x43, …
Dogus Ural
  • 153
  • 1
  • 6
5
votes
1 answer

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 private expo prime 1 prime 2 exponent 1 exponent…
croraf
  • 299
  • 1
  • 5
  • 12
5
votes
2 answers

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 should I identify the KDF used? It seems that the…
Maarten Bodewes
  • 96,351
  • 14
  • 169
  • 323
4
votes
1 answer

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 of the message digest calculation process depends…
Lazarus
  • 43
  • 1
  • 3
4
votes
2 answers

Why is the signatureAlgorithm field in X.509 certificates redundant?

See the ASN.1 description of an X.509 certificate below: Certificate ::= SEQUENCE { tbsCertificate TBSCertificate ({ x509_note_tbs_certificate }), signatureAlgorithm AlgorithmIdentifier, signature BIT STRING ({…
Mark
  • 835
  • 7
  • 24
4
votes
1 answer

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, where $m = 193$ and is defined by $f(x) =…
neubert
  • 2,969
  • 1
  • 29
  • 58
4
votes
3 answers

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 "some valid DER encoded ASN.1" || "some extra bytes" – is the correct behavior to…
Alex Gaynor
  • 356
  • 1
  • 4
  • 11
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
0 answers

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 recommendations for encoding curves defined over…
Vadym Fedyukovych
  • 2,347
  • 14
  • 19
3
votes
1 answer

What's the ASN.1 structure of ECIES encryption result?

I got a ECIES encryption result and a publickey,the publickey after decoding to ASN.1, I obtained the following: SEQUENCE { SEQUENCE { OBJECTIDENTIFIER 1.2.840.10045.2.1 (ecPublicKey) SEQUENCE { INTEGER 0x01 (1 decimal) …
Jswq
  • 155
  • 1
  • 6
3
votes
1 answer

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 same purpose? Do they have to be the same? Can…
Nocta
  • 133
  • 3
1
2 3