**The 3D Face Algorithm (Part I)**

I dreamt this up. Seriously, I kid you not. I don't know if it is a compression, encryption or hash algorithm. A lot of it is a bit fuzzy.

The 3D Face algorithm is an attempt at compression (and hopefully encryption as a by-product) using the faces of any 3 dimensional shape which is a platonic solid. Platonic solids are regular, convex polyhedrons. They have faces which are congruent, regular polygons with the same number of faces meeting at each vertex.

There exists only five platonic solids. These have names derived from the number of faces. A convex polyhedron is therefore a platonic solid if and only if:

1. all its faces are congruent convex regular polygons

2. none of its faces intersect except at their edges, and

3. the same number of faces meet at each of its vertices.

Each platonic solid can therefore be denoted by a symbol {p,q} where p is the number of vertices
of each face and q is the number of faces meeting at each vertex.
The symbol **{p,q}** is called the Schlafi symbol and gives a combinational description of the polyhedron.

Ok, I won't bore you with the mathematics. It's here on Wikipedia.

The one platonic solid I'll be using for example is the **dodecahedron**.
It has 5 vertices in each face and 3 faces meeting at each vertex. It has a total of 12 faces,
20 vertices and 30 edges. And it looks a little like a football (and being Nigerian and all, perfect!).

The application of platonic solids in compression (or encryption) is summarised in a single sentence:
**the spread of data unto the congruent convex regular polygon faces of the platonic solid**.
This *data spread* is affected by 2 factors:

1. A public key which determines **face rotation** which is the
transition of the virtual read or write head from one polygon face to the other.

2. A private key determining **face layering** which is the filteration of data into layers on a particular face.

The compression (or encryption) process is as follows:

1. A start at the **base face** or **face 0**.
Determination of which face is base is also part of face rotation and therefore a function of the public key.

2. Some data of fixed length is read from the data stream, mathematical operations performed (encryption? hashing?) on it

3. The resulting data is then stored on the selected face. How? It should be done so that if data preexists on the face (from previous operations), the contents do not overflow into another face. Face data may be zeroed out or seeded.

4. Data written on a face is placed in layers dependent on the private key.

5. The next face is then chosen using some mathematical function of the public key (a suggestion is that it goes along the edge and vertices).

6. Step 2 is repeated if the data stream has not run out.

7. After the data stream has run out, the write head will be at **face x**.
The sha1 (or some other hash algorithm) hash of the data stream is calculated and written
(as per steps 3 and 4) on the next face, **face x+1** marking the face as the final
face at which a subsequent decompression must start.

8. Compression then quits.

The part II of this paper goes here