Skip to content
JohannDouglasM edited this page Oct 26, 2026 · 29 revisions

Concept

This library provides a public key infrastructure (PKI). It is based on ASAP, a routing protocol specialized for decentralized networks, especially ad-hoc networks.

The concept is very close to PGP but easier to integrate into an ASAP environment. The library allows

  • creating RSA keys
  • creating certificates
  • exchanging certificates in a purely decentralized system
  • calculating a probability of correctness of a certificate

There is a 32' video explaining the concept of that component.

Certificates

The very core of each certificate is the public key of a user, let's say A(lice). A public key can be used by others to a) encrypt data to be sent to the user and b) to verify a digital signature.

A PKI is only as secure as the mechanism used to verify the relationship between a person's identity and their public key.

Attackers try to impersonate others. An attacker, let's call him Mallory, would claim to another person (e.g. Bob) that he is actually Alice. Each good PKI should give Bob enough time and the means to verify the issuer's claim. That's not an issue of computer science - it's about the real world.

Recipients of a public key must ensure that this key belongs to that person (technical term: subject). Mallory will always try to trick others. He is to blame. But recipients are even more to blame if they neglect to perform a reasonable verification. Bob should look at Mallory, ask for an ID or something like that and realize that he is not Alice.

Signing

Receivers can create a certificate if they are convinced of subjects' identity. Alice met Bob for instance. Bob is convinced that he really met Alice. He would take the public key, add the name Alice (and a few other parameters) and sign it. Bob becomes the issuer of a certificate.

A certificate is a proclamation of the issuer:

I, the issuer (Bob), hereby proclaim that this public key belongs to the subject (Alice). I sign it.

A certificate contains at least: Subject (name, id or both), issuer (name, id or both), subjects' public key. There is usually a "valid since and until" timestamp. Let's use the abbreviation: cert(B,A) - B signed A.

Verifying

Even Alice would be interested in getting this certificate. Why is that? She could present this certificate to others, e.g. C(lara). Clara would try to verify the signature.

She can do so if she has got issuers' public key. Clara could verify that Bob proclaimed that the public key belongs to Alice. Clara could use this key, if she trusts Bob. We are going to discuss this special kind of trust very soon.

ASAP Certificate concepts

The previous considerations are the basics of digital certificates. This library adds a few concepts. But before that, here are some general settings:

  • Key pairs are automatically replaced after one year. Users then have to meet again to exchange their new keys.

Identity Assurance and Signing Failure

Signing a public key is a very critical moment in each PKI. An issuer must ensure that s/he is not fooled by an attacker. There is always a probability to sign the wrong subject, though.

Signing Failure

We use the term signing failure for this probability. Probabilities range from 0% (never happens) to 100% (always happens). We shorten the numbers and use integer values from 0 (= 0% never makes any mistake) to 10 (= 100% is always cheated).

Each person in our PKI can define a signing failure for any other person. This number is never published. The signing failure describes e.g. Alice's estimate of how easy Bob can be cheated. Most likely, estimations of Alice and Clara will differ.

Signing failure is not a measure of how much people like each other. Alice and Bob could be very close friends. Nevertheless, Alice could estimate that Bob is somewhat sloppy in this matter. Maybe it is part of his charming nature. That doesn't make his Certificates better, though. Maybe Clara does not like Alice at all but has to admit that she is very thorough in this matter.

The signing failure estimation is not a measure of friendship but of thoroughness.

Let's use this abbreviation: sf(B,5) - signing failure of B is estimated 5 (== 50%)

In this lib we define:

  • sf(yourself, 0). We never make mistakes.
  • sf(!yourself, 1 <= x <= 10) Signing failure of any other person than ourself can never be better than 1.

The reason is explained very soon.

Identity Assurance

Public keys are used to sign (and to encrypt) data. A certificate is one example.

By verifying a signature, we verify its sender. But how sure can we be? In other words: What is the probability that we are cheated?

Bob directly received a public key from Alice. In this library, he has to assume to make no mistakes. Bob can be sure of Alice's authorship if he can verify the signature.

Clara received Alice's public key with Bob's certificate. Let's say, Clara estimates Bob's signing failure to 5 (= 50%). Half of Bob's certificates are false. They contain a public key. But this key does not belong to the subject. Bob was cheated about subjects' identity during key exchange.

Clara has got a message. It is signed by Alice. Clara got Alice public key from Bob. Ironically, the situation is very clear if she cannot verify the signature. This message is most probably not from Alice.

It becomes more complex, if Clara can verify the signature. She can calculate: Due to her estimation of Bob's signing failure, the chance to work with a wrong public key is 50%.

What is the probability that this message is from Alice after a successful verification? 50% of course. Only half of Bob's certificates are false. The other half are ok.

Identity Assurance is a probability. How sure can we be of senders' identity after a successful verification? It is a product.

A more complex example. Assume:

  • There are Alice, Bob, Clara and David
  • We have estimated their signing failure: sf(A, 1), sf(B,5), sf(C,2), sf(D,3).
  • We only met Alice directly. We have got some certificates: cert(A,B), cert(B,C), cert(C,D). Alice signed Bob, Bob signed Clara etc.
  • We received a signed message from David. We can verify this message.

Question: How sure can we be of David's identity?

We have his public key. But we have not met him in person. We have a certificate issued by Clara, though. We assume that Clara is quite thorough but 20% of her certificates are wrong.

In other words: There is a 80% chance that we have got the right public key.

Unfortunately, we cannot verify this certificate directly. We never met Clara in person. We have a certificate issued by Bob, though. We think of Bob very highly but is is often distracted. We assume 50% of his certificates are wrong.

In other words: There is a 50% chance that we have got the right public key of Clara. We assumed that we have an 80% chance that Clara signed David's certificate correctly. We have a 0,5 * 0,8 = 0,4 = 40% chance that we have got the right public key of David.

Unfortunately, we have not met Bob in person. We have a certificate issued by Alice. We assigned her the lowest signature failure possible (1 == 10%).

In other words: there is a 90% chance that we have got the right public key of Bob. Let's calculate: 0,9 * 0,4 = 0,36 = 36%. We have a 36% chance so far that we have got David's right public key. Fortunately, we met Alice directly. We make no mistakes. Identity assurance is not getting worse. Let's calculate: 1 * 0,36 = 0,36 = 36%.

Answer: Our identity assurance of David is 36% = 4 in our example.

broken certificate chain - what assurance now?

Let's assume we don't have a public key of Bob. Maybe we have no certificate from Alice (cert(A,B)) or this certificate is outdated. What now? We have a signed message. We have got the required public key. It is signed by Clara. Her key is signed by Bob. We cannot verify Bob. But hey, there are so many people involved. This must count for something.

No, it does not. It is not about social relations. It is a simple calculation. We cannot verify Bob's certificate. We have no idea if there even is a real person behind this public key. The whole Bob, Clara, David chain can be a ploy.

If you know those people, meet them and exchange keys.

Identity assurance is 0 if we have not got a public key directly and if there is no unbroken chain of certificates that leads to the sender.

Rules for better assurance

How can we improve identity assurance?

We could set the signature failure of each person to its minimum (1 = 10%) which is not a very good idea. But it illustrates an effect.

  • 0 hops: Identity assurance is 10 if we met the person directly.
  • 1 hop: We met a person A who met person B. Identity assurance of B would be 90% = 9 on our side.
  • 2 hops: 0,9 * 0,9 = 0,81 = 81% = 8
  • 3 hops: 0,9 * 0,9 * 0,9 = 0,729 = 73% = 7
  • ...

The numerical sequence is obvious: 10,9,8,7,6 etc. We defined the best signing failure to be 1 to get that effect. A minimum failure of 0 would keep users in a mistaken feeling of safety (10, 10, 10, ...).

There is no such thing as perfect security. That's a fact but no reason to be afraid. We have to be aware of it and work with it. Each intermediary step makes assurance weaker. That's true in the real world as well as in the digital one.

Be honest with yourself when estimating signing failure. A better number does not increase security. It clouds your justment. Don't be afraid of uncertainty. Deal with it, embrace it. We can only work with things we realize not with things we hide from ourselves.

A low identity assurance of someone can also be read as sign to meet this person. In most cases, talking to people is a good thing. There is only one way to a better identity assurance: Shorten the chain. Exchange keys with as many people as you can.