Questions tagged [ber]

The Basic Encoding Rules were the original rules laid out by the ASN.1 standard for encoding abstract information into a concrete data stream. The rules, collectively referred to as a transfer syntax in ASN.1 parlance, specify the exact octet sequences which are used to encode a given data item.

Definition:

The Basic Encoding Rules (BER) are the rules that were initiated from the ASN.1 definition for encoding abstract information into a concrete data stream.

The rules, known as a transfer syntax in the ASN.1 parlance, denote the octet sequences which are used to encode a specific piece of data.

Important Links:

50 questions
1
vote
0 answers

BER encode a string in go for LDAP userCertificate;binary

I'm currently trying to build an simple LDAP server using https://github.com/nmcclain/ldap to serve mail clients (primarily Outlook) with an address book containing S/MIME Certificates. So far the part regarding the "normal" LDAP attributes like sn,…
tiom
  • 137
  • 1
  • 2
  • 7
1
vote
2 answers

How to create ASN.1 specification file from BER?

We have received a specifications document for CDR encoded in TLV from a vendor and we are trying to build a parser for it. According to them, their CDR is formatted as per ASN.1 BER encoding. However when asked for ASN.1 specification file, they…
Boodey
  • 11
  • 1
1
vote
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
  • 147
  • 13
1
vote
2 answers

EMV TLV parsing sometimes does not display constructed values (childs)

My method parseTLV() sometimes does not properly decend into constructed values (child TLVs). I use a filter ((tag & 0x20)! = 0) to detect constructed values, but sometimes it doesn't work as expected. For…
Ihdina
  • 950
  • 6
  • 21
1
vote
2 answers

Find and replace (increment) ASN.1 BER hex value

I have a long string of hex (converted from BER ASN.1) where I need to find and increment a particular value which is incorrect. the ASN.1 tag is 84 and the length byte will change from 01 to 02 when the value >…
1
vote
1 answer

Encoding of first identifier of an OID in ASN.1 into BER

OID's it seems are a way to represent a tree like structure. Eg 1.3.6.1 being iso(1).org(3).did(6).internet(1) The encoding scheme used most commonly seems to be BER and I am confused about the encoding of the first two digits. Why are the first…
Angus Comber
  • 9,316
  • 14
  • 59
  • 107
1
vote
2 answers

ASN Basic Encoding Rule of an integer

I'm currently studying the Abstract Syntax Notation One and reading the ITU-T Recommendation X.690. On page 15 in paragraph 8.3.2, there is written: If the contents octets of an integer value encoding consist of more than one octet, then the bits…
Jaffa
  • 12,442
  • 4
  • 49
  • 101
1
vote
1 answer

Can't DER encode and BER decode RSA public key

I have problems using Crypto++ to save a RSA public key (that I obtained loading a private key file in PKCS#8 format). When decoding the key, I always get a BERDecodeErr exception. Here is the code I am using: CryptoPP::RSASSA_PKCS1v15_SHA_Signer …
Mildred
  • 3,887
  • 4
  • 36
  • 44
1
vote
2 answers

Untagged CHOICE in ASN.1

We are using the JAC ASN.1 Compiler in our (legacy) project and experienced a situation where we received ASN.1 messages we could not parse. I took a look at the parser code and noticed that this is a bug in the library. Since switching to a…
Ingo Bürk
  • 19,263
  • 6
  • 66
  • 100
1
vote
2 answers

ASN.1 SET type restrictions

I'm confused about the limitations on the ASN.1 SET type. In general, I realize that a SET type is basically the same as a SEQUENCE, except the order of the components doesn't matter. The seminal book on ASN.1, "ASN.1 — Communication Between…
Channel72
  • 24,139
  • 32
  • 108
  • 180
0
votes
0 answers

How to get BER for QPSK modulation?

I am trying to compare data before modulation using the BER block. But my probability turns out to be very bad. It should be close to 0. Based on the scheme from the Simulation example: BPSK Demodulator,(Block scheme)I am trying to calculate BER.…
Ice Cool
  • 11
  • 2
0
votes
1 answer

why asn1_create_element exits with code 137 but asn1_print_structure don't

I'm trying to use asn1_create_element() from libtasn1.h but it exist with an error 137. However asn1_print_structure() that uses the same definitions and source works. asn1_print_structure(stdout, definitions, "IEC61850.GOOSEpdu", ASN1_PRINT_ALL);…
0
votes
1 answer

How to initialize ASN1ObjectIdentifier from an OID string which contains components larger than int max value?

I am trying to reference an unregistered ASN.1 Object Identifier which is compliant with the {joint-iso-itu-t(2) uuid(25)} arc. I am using the com.objsys.asn1j.runtime package. But it seems that the asn1rt library only accepts int[] as identifier. I…
Okan Konur
  • 94
  • 1
  • 8
0
votes
0 answers

Bert Topic Modeling

Does bert give a topic to a set of words (topics) extracted from a text? Or, is it for us humans to interpret them? I have tried BerTopic, Top2Vec and LDA for topic modeling of a set of product reviews to extract the most important topics within the…
Atefeh
  • 1
0
votes
1 answer

cms Enveloped Data binary encoding problem in pkijs

I'm trying trying to implement exchange of CMS encrypted content using the pkijs library. Basically I've just copied the example from here: https://pkijs.org/examples/CMSEnvelopedExample.html here the excerpt for…
pyrogen
  • 209
  • 1
  • 7