I’ve always been interested in geometry and proportions. I find it facinating how we use percentages and proportions to represent things that (without a context) can sometimes seem misleading or even meaningless.
While discussing proportions with a family member, it occurred to me a way to use them in geometry as a cryptographic method, specifically, the use of proportions between regular polygons inscribed in a circle. Let’s explore the idea step by step.
1. The Background
In standard public-key cryptography, we rely on “hard” problems such as factoring large integers (RSA) or the discrete logarithm problem (Diffie–Hellman, Elliptic Curves). These problems are believed to be computationally intractable to invert—thus, an attacker can’t easily recover the private key from the public data.
Now, consider a whimsical geometric alternative: regular polygons. This figures have many interesting properties that combined can potentially help to “publicly” exchange information between 2 parties that can (theoretically) allow each one to derive a common secret and use it to encrypt further communications.
Regular polygons are those which are closed (all sides are sequentially connected), have the same length on each side (equilateral), and all angles are equal in measure (equiangular). Some properties of polygons are: their angles, diagonals, the apothem, each side of a regular polygon can be defined as a chord, the circumradius, the symmetry lines, etc.
When two or more of these polygons share the same center and all of their vetex lie in the same circunference, it is said that such polygons are inscribed in a circle.
Now, Imagine two regular polygons A and B inscribed in a circle. Each has a certain number of sides (unknown to outsiders). The idea is to publicly exchange some parameters of these polygons without revealing others—hoping to replicate the “public-key” principle.
Let’s see how we can use all of these in public-key cryptography.
Disclaimer: The approach described here is not recommended for real-world security. We’ll see why at the end of this post. However, it serves as a fun, educational lens on cryptography.
2. The Scenario
We have two protagonists:
- Alice: She defines a regular polygon A with:
- Side length “lA“ (kept secret, never publicly disclosed).
- An orientation of the polygon as the angle “θA“, which can be shared publicly.
- Note that the number of sides of the polygon A (nA) is initially unknown —even to Alice—until further geometry is applied.
- Bob: He defines another regular polygon B on the same circle. Polygon B has:
- A certain number of sides “nB“.
- A known radius “r” of that circle (Bob’s private choice, or known only to him).
- The orientation “θB” that might be deduced from “θA“ in the process (easier to see when A and B share one of their vertex, named here as V0).
Both actors want to exchange limited data from their own polygons so each one can figure out their own polygon’s number of sides (and the other’s, if needed) but avoiding third parties to easily figure out them as well.
2.1 Choosing what to share publicly
The information to be shared publicly must be such that by itself or in combination with the other publicly shared information cannot easily derive in the determination of any of the other properties of the polygons A and B.
After some digging and thinkering, we determine that Alice will share (imagine she broadcasts it) θA the angle from the x-axis to the side of polygon A at the common vertex V0 and Bob shares (or broadcasts) the ratio z (you will se how it’s calculated in a bit).
From solely these two parameters (visible to everyone) it is challenging that a third party determines what polygons are in play without making wild guessing or making bold assuptions, so it looks like we have our public information.
2.2 What remains private
Alice already knows lA (the side length of polygon A) but never discloses it.
Bob’s already knows the radius r of the inscribed circle and the number of sides of his polygon nB, but none of these will be revealed, instead, Bob will impose r to θA (shared by Alice) to effectively set the number of sides of Alices polygon (given that lA is already fixed and that there is a know proportion “k” between the length of a side and the radius). Bob, knowing both Polygons can now calculate a value that can be “safely” shared publicly and that Alice can use along with her private information to derive the same 2 polygons that Bob now has. This is where the “proportions” come handy. Proportions are values relative to other input values and they mean little wihtout at least of the inputs. There are many proportions that can be used between regular polygons determined by polygons measurements and its angles can be used as well.
3. How the Geometric “Key Exchange” would work?
To understan the steps to take place for Alice and Bob to exchange keys, first we need to know some formulas that will be used.
3.1 Useful formulas
a) Side of a Regular Polygon
If a regular polygon of “n” sides (n-gon) is inscribed in a circle of radius r, each side is:
l =2 * r * sin (π / n).
b) Theta, beta and delta
We often define θ as the angle between the x-axis and the polygon’s side at vertex V0. That θ relates to π/n (or 2π/n depending on exactly how it’s measured).
β=180 – (2 * θ) = (2 * π)/ n (also known as internal angle)
δ=θB−θA
c) k and l proportions
Let k= l / r Where 0 < k <= 2 for polygons inscribed in a circle.
z= lB /lA
d) Sides of a polygon based on its side length and the radius
n = ( 2 * π ) / ArcSin( l / (2 * r))
3.2. The Exchange Steps
- Alice Chooses lA
Alice picks a random side length lA∈(1,MAX_LENGTH). She then decides her polygon A has an orientation θA. The number of sides of her polygons is unknown by now but in definitive each side will have a length of lA and the side will have θA degrees respectively to the x axis. - Alice Broadcasts θA To everyone (including Bob). She does not publish lA.
- Bob defines its polygon and uses θA
Bob picks a random radius r ∈(1,MAX_R) and then picks a random number of sides nB ∈(3,MAX_SIDES) or lB (as Alice did). Bob then imposes r to θA and he now can infer lA given that θA approximates to ArcSin( lA /(2 * r )). - Bob computes z publishes it
Being r the same for both polygons and having lB and lA, Bob calculates z with formula c (from section 3.1) and shares it back with Alice publicly - Alice, now knowing z, θA (and privately lA) finds her own polygon
Using z Alice can now calculate lB = z * lA , and the radius from r = lA / [ 2 * π * Sin(θA) ]. Thus now having the possibility of calculating n for both polygons as n = (2 * π) / (ArcSin( l/(2*r)).
4. Why This might seem secure?
- θA and z are Public: But the angle or orientation and the ratio between side lengths might not directly disclose number of sizes of the polygons nA or nB or its radius.
- No Single Formula: An eavesdropper sees θA and z but does not know the circle radius or either polygon’s side length or the number of sides of any polygon. It might appear that a random third party can’t invert the geometry easily.
- Now Alice and Bob can use data from their polygons to encrypt information with a shared secret that they choose from any of the polygon’s undisclosed properties (e.g. the radius) or securely exchange other information about the polygon (e.g. the coordinates of the center).
- If the center is set, both can secretly agree on a process to continuously change the encryption key by synchronously rotating the polygons by a certain angle and even scale the radius (up and down) and using polygon vertex as keys. This would also make a great use of the key space and (if done correctly) it may even been possible use the keys in an unordered sequence (as with HMAC).
5. Weaknesses: Is the process truly “hard” to invert?
Despite appearances, this scheme struggles to meet the standard of public-key cryptography:
- Straightforward algebraic inversion
The formulas for inscribed polygons are well-known, and if we suspect nA or nB is not astronomically large, an attacker can systematically search integer possibilities. For instance, by knowing the definition of θA and z and that the polygons are inscribed, a third party with enough computational resources (common now in gaming PCs, or AI enabled desktop computers) can enumerate nA and nB (say from 3…1000, and on) and compare the resulting geometry with θA and z. This would be the equivalent of brute forcing the algorithm. - No known “Hard Problem”
There is no discrete log or factoring-like challenge embedded here (as opposed to RSA or Diffie-Hellman curves). The relationships are simple sines, cosines, and integer side counts. - No True Trapdoor
The essence of public-key cryptosystems is a function that is easy to compute but very hard to invert. Regular polygons in a circle do not provide that one-way trapdoor. - The inherent geometric calculations imply that really big numbers (e.g. huge n’s) will have to deal with really tiny numbers (e.g. Sins and ArcSins) which may impose risks on calculation errors for asymmetric platforms due to limitation and numeric implementation of the trigonomietric functions.
Hence, while θA and z may not be trivially combined in a single formula, they are not formidable obstacles for an adversary with (now deemed) modest computational resources.
6. Conclusion and finale thoughts
We’ve walked through a proposed method where Alice and Bob share: θA (from Alice, no lA revealed) and z (from Bob) allowing each to figure out each other’s hidden polygon parameters. The scheme is educational, showing a geometric analogy to partial information exchange.
However, it does not provide security on par with established cryptographic protocols as:
- There’s no hard underlying math problem (like discrete logs).
- A modest integer search can invert the geometry.
So, while it’s a fun illustration of cryptographic concepts, it’s not a replacement for RSA, Diffie–Hellman, or other well-studied solutions.
But don’t get me wrong, geometry can be used for cryptography! The new pos-quantm-safe encryption algorithms are based on multi-dimensional lattices, and there are problems hard-enought to solve in geometry (like finding rectangles inscribed in jordan curves) that can also be used.
Sometimes an idea may appear good (even perhaps a ground-breakig) but it must be carefully analyzed and tested by other peers and field-specialist to validate it as a solid proposed solution to a real-non-trivial problem.
Just as we might consider Quality Assurance in software projects, cryptography has its “own QA”. In this case relying on a basic-geometry-based key exchange with no proven hardness assumption accrues risk.
If you need real security, turn to vetted methods—lattice-based systems, elliptic curves, or classical RSA. Simple geometry can serve as a nice teaching tool, but it’s no match for the complexities of modern cryptography or current crude computing power.
Never the less, don’t ever stop being curious, share ideas, try new things and test them thoroughly. Who knows, perhaps one day, one of those trys can make a real difference.