1 Introduction

The stereographic projection (SGP) is an important geometric transformation in the theory of functions of complex variables [15, 22, 49, 63]. It establishes a topological equivalence between the Riemann sphere \(\mathbb {S}\) and the extended complex plane \(\overline{\mathbb {C}} = \mathbb {C} \cup \{\infty \}\), where \(\mathbb {C}\) is the field of complex numbers. Intuitively, the SGP had been early recognized in geography and astronomy [35, 38].

The SGP plays a major role in spherical image processing, particularly in omnidirectional image processing [4, 8, 10, 17, 21], where it is shown that most common catadioptric omnidirectional images are bijectively mapped onto the sphere. Therefore, [16], omnidirectional images can be processed by algorithms established for spherical images. The conformal transformation between \(\mathbb {S}\) and \(\overline{\mathbb {C}}\) is implemented for extracting points of interest in omnidirectional images, image registration, detecting and matching objects.

In this paper, we establish a bijective projection of a 3D point cloud or a 3D object onto a 2D binary image. Such a bijection will make it easy to implement various applications such as encryption, watermarking, template matching, object detection and tracking, image registration and classification, etc. We will apply the proposed technique to 3D point cloud encryption, which shows both the correctness and efficiency of the projection technique. With this respect, we would like to mention that the proposed technique is based on the SGP after appropriate preprocessing. It is also worthwhile to mention that the previously mentioned applications of the SGP work only on points (or pixels) that lie on \(\mathbb {S}\), i.e., surface and not volume point clouds.

The rapid growth of technology and communication systems has made the use of 3D content very popular in many different domains and in various applications. These applications are not restricted to a specific area; rather, they include a wide range of fields and industries such as education [39], prototyping and manufacturing [64], medicine [31, 34, 47], construction and architecture [11], virtual reality [48], augmented reality [7], 3D visualization [9], and various industries like film, animation [43] and gaming [55]. This wide-spread use of 3D contents in a variety of applications and technologies makes describing, representing, and securing 3D contents urgent issues. So it is indispensable to protect 3D contents against unauthorized access by means of encryption tools, which are applied to achieve a high level of confidentiality, integrity, and security for 3D contents when implemented via unsecured channels.

Many cryptosystems have been proposed to encrypt different types of 1D and 2D data [18, 58, 59]. However, these ciphers are not suitable for encrypting 3D objects due to the special structure and features of these objects, which impose a set of restrictions on any 3D cipher, such as preserving the dimensional and spatial stability [3] which is a critical requirement to correctly display the 3D objects in the virtual space. Direct applications of these conventional ciphers to 3D content may require high computational power and preclude the possibility of real-time data communication.

In addition to introducing a 2D representation technique based on the SGP for 3D objects, we introduce a symmetric cipher for securing 3D contents. The cryptosystem is based on the use of the SGP, chaotic permutations, chaotic circuits, and Latin cubes. We assume that the 3D object lies inside the unit ball in \(\mathbb {R}^3\). This adds no restriction to the 3D content, as this constraint can always be achieved via appropriate dilations. The 3D object is mapped onto the unit sphere, and the stereographic projection maps it once more into the XY-plane (or the complex plane \(\mathbb {C}\)). Chaotic maps are used to construct chaotic sequences, which are used to build a series of chaotic permutations for the projected points. Then, other chaotic sequences are constructed and employed with chaotic logic gates, in addition to the use of Latin cubes to strengthen the encryption scheme.

The rest of this paper is organized as follows: Sect. 2 reviews some related works in 3D-to-2D representations of 3D objects along with their applications. Section 3 establishes 3D objects to be implemented in this paper, where we use quadric surfaces in the construction. However, the encryption technique is applicable to other 3D objects as implemented in Sect. 8. In Sect. 4, we review the properties of the stereographic projection implemented in the sequel. The 3D-to-2D representation is presented in Sect. 5. The basic encryption tools of this paper are introduced in Sect. 6. Section 7 introduces 3D-SGP-based encryption and decryption procedures. In Sect. 8, we demonstrate the outcomes of the proposed cipher on some examples and evaluate the performance in terms of visual, statistical, and quantitative measures.

2 Literature review

This section reviews some literature on the techniques and applications of the SGP transformations as well as 3D encryption techniques. Yavartanoo et al. [66] applied stereographic projection with different mapping functions, e.g., UV, Kavrayskiy VII, Eckert IV, and Cassini, to map 3D objects onto 2D images for classifying the 3D objects using 2D convolutional neural networks (CNNs), and the accuracy of each mapping function is measured. In the previous projection, the 3D object is normalized to be contained in a unit sphere, and translated to coincide the center of the object with the sphere center. Each point on the 3D object surface is represented by a unit vector from the sphere origin which maps a 3D point, i.e. \((e_x,e_y,e_z)\), on the sphere surface and is mapped using any of the previously mentioned mapping functions into its corresponding 2D plane coordinates, i.e., (uv), using the longitude and latitude parameters of \((e_x,e_y,e_z)\).

Lyu et al. [36] introduced a different mapping approach to segment a 3D plain point cloud, based on constructing a graph from the 3D  point cloud, and then mapping the graph vertices onto a 2D image. The 2D image is used by a 2D CNN to segment the local patterns in the 3D point cloud. The set of vertices is mapped into 2D integer coordinates while preserving the graph topology. This is achieved by formulating a minimization problem to select the set of 2D coordinates that minimize some loss functions. The loss function compares the distances on the graph between two 3D points and a metric function estimates the mapped distance in the 2D space.

Another projection technique to map a 3D point cloud for the purpose of assessing quality is discussed by Yang et al. [65], which is based on dividing the 3D point cloud into many layers for which subsets of the 3D points are assigned to. Furthermore, these layers are projected to six perpendicular 2D image planes (corresponding to six faces of a cube) via the orthographic projection. The idea to map a 3D point cloud into many layers has also been shown by Gao et al. [20] after projecting the cloud points onto a 2D image via some projection transformations.

As for 3D object encryption, several approaches have been proposed for 3D point cloud encryption. In particular, Martin del Rey [37] introduced an encryption scheme of 3D solid objects based on using a 3D Cat chaotic map first in the confusion phase. Then, a 2nd order memory reversible 3D cellular automata (3D-CA) is used in the diffusion phase. This method interprets first the 3D solid object as a 3D Boolean array whose bits are 1’s for occupied positions and 0’s for empty positions. Second, during the confusion phase, the 3D array bits are permuted N times via the discretized 3D Cat map with some initial secret key; and then divided into two 3D sub-arrays. The two sub-arrays are interpreted as initial configurations of the 3D-CA in the diffusion step which is evolved T times by the 3D-CA transition function. After M rounds in the diffusion phase, the union of the two diffused sub-arrays outputs the encrypted object.

Jin et al. [28] proposed two encryption schemes for 3D point clouds based on the logistic map. The first scheme implemented three random sequences generated by the logistic map to randomly shuffle the coordinates of the 3D point clouds. Such a shuffling procedure severely affects the geometric stability of 3D objects as shown by Annaby et al. [3]. The second scheme is based on random rotation and translation generated by the logistic map. Jin et al. [29] used the 3D Lu chaotic map for the encryption of the vertices, polygons, and textures that constitute a 3D textured surface model. The vertices’ vectors of the 3D model are multiplied by a randomly generated vector via Lu chaotic map, while the polgons’ vertices are substituted with randomly generated set of vertices via the same map, and then sorted to yield the encrypted polygon’s vertices. The texture image of the 3D color model is decomposed into its channels, and then each channel is encrypted via the method introduced by Jin et al. [27]. The encrypted vertices, polygons, and textures are thus composited together to form the final encrypted 3D textured model.

Jia et al. [26] proposed two 3D point cloud encryption schemes based on 2D and 3D Cat chaotic maps. In the first scheme, each coordinate vector is reshaped into a square matrix and then permuted via a random permutation matrix generated by the 2D chaotic map. The second encryption scheme employs a 3D Cat chaotic map to form a 4-by-4 transformation matrix which maps each 3D point into a new position. The previous matrix consists of a 3-by-3 rotation matrix and a 3-by-1 translation vector. Rajakumar et al. [44] proposed another scheme for securing 3D point and mesh cloud data. This scheme utilized the sequence generated by a chaotic map to transform the coordinates of the cloud data. Jolfaei et al. [30] introduced a 3D object encryption scheme, claiming spatial and dimensional stability guarantees. However, Annaby et al. [3] questioned these stability notions, and rigorously developed two enhanced methods for 3D object encryption, and comprehensively investigated the geometric stability of 3D ciphers involving rigid body motion and 3D coordinate shuffling, see also Annaby et al. [1].

3 3D quadric point clouds

In this section, we generate some 3D point clouds represented by quadric surfaces. These objects are implemented throughout this paper in the operation of the SGP that projects the 3D objects into the plane. Furthermore, these 3D objects are utilized in an encryption application for 3D objects. We assume that the 3D object lies in the cube

$$\begin{aligned} - L \le x, y, z \le L, \end{aligned}$$
(1)

where xyz are the coordinates of the cube points and \(L>0\) is a given number. Let us consider 3D mesh which includes \(\mathcal {N}^3\) points, \(\mathcal {N} \in \mathbb {N}\) is fixed. These points are assumed to be hosted in the cube (1). The cube is sliced into \(\mathcal {N}\) equidistant parallel frames in the direction of the planes

$$\begin{aligned} X_k = Y_k = Z_k = -L + \left( \frac{2L}{\mathcal {N}-1} \right) k , \quad k = 0, 1, \ldots , \mathcal {N}-1, \end{aligned}$$
(2)

where k denotes the frame index, and \(X_k\) is the \(X-\)coordinate of the kth frame, similarly for \(Y_k, Z_k\).

Fig. 1
figure 1

A 3D mesh of the cube (1), \(L = 1, \ \mathcal {N} = 4\) with frames (2) parallel to the plane coordinates

If the set A is defined to hold these different coordinate values, i.e.,

$$\begin{aligned} A = \left\{ -L + \left( \frac{2L}{\mathcal {N}-1} \right) k , \quad k = 0, 1, \ldots , \mathcal {N}-1 \right\} , \end{aligned}$$
(3)

then the cubic mesh of \(\mathcal {N}^3\) points is merely the set of ordered triples

$$\begin{aligned} \mathcal {M} = A^3 = A \times A \times A . \end{aligned}$$
(4)

Fig. 1 exhibits the case \(\mathcal {N}=4\).

Now we illustrate how to construct 3D clusters based on quadric surfaces (volumes). We figure out the construction for the sphere and the hyperboloid with one sheet. The biggest sphere that can be contained in the cube (1) is

$$\begin{aligned} x^2 + y^2 + z^2 = L^2. \end{aligned}$$
(5)

Hence the 3D spherical point cloud is

$$\begin{aligned} \mathcal {P}_s = \mathcal {M} \cap \left\{ \left( x, y, z \right) : x^2 + y^2 + z^2 \le L^2 \right\} . \end{aligned}$$
(6)

As for the hyperbolic hyperboloid, the construction is a bit complicated. The general equations of the circular hyperbolic hyperboloid whose axis is the z-axis is

$$\begin{aligned} \frac{x^2}{a^2} + \frac{y^2}{a^2} - \frac{z^2}{c^2} = 1 , \end{aligned}$$
(7)

where ac are fixed positive real numbers. To make sure that the cube (1) contains the portion of (7) that lies between the planes \(z = \pm L\), a and c must satisfy

$$\begin{aligned} d_0 := \frac{a}{c} \sqrt{c^2 + L^2} \le L, \end{aligned}$$
(8)
Fig. 2
figure 2

The cube (1) contains the hyperbolic hyperboloid (7) that lies between the planes \(z = \pm 1\) where \(L = 1, a = \frac{1}{\sqrt{3}}\) and \(c = \frac{1}{\sqrt{2}}\)

As shown in Fig. 2. To construct the hyperbolic hyperboloid mesh that lies entirely inside the portion of (7)–(8), we take the intersection of these internal points with the full mesh \(\mathcal {M}\), i.e.

$$\begin{aligned} \mathcal {P}_h = \mathcal {M} \cap \left\{ \left( x, y, z \right) : x^2 + y^2 \le \frac{a^2}{c^2}(c^2 + z^2 ) \right\} . \end{aligned}$$
(9)

Fig. 3 illustrates these two examples. Likewise, we can extend the procedure not only to various quadric surfaces but also to other surfaces.

Fig. 3
figure 3

a A full cubic mesh with \(\mathcal {N} = 64,\, L=1\). b The spherical point cloud and the hyperboloid with one sheet inside the cube. c The constructed point clouds

Fig. 4
figure 4

Examples of the SGP between \(\mathbb {S}\) and \(\overline{\mathbb {C}}\), with respect to the north pole (a), (b) and with respect to the south pole (c)

4 Stereographic projection

The SGP is a geometric transformation that maps the Riemann sphere \(\mathbb {S}\) onto the extended complex plane \(\overline{\mathbb {C}}\), [15, 22, 63]. There are several ways to establish this correspondence between \(\mathbb {S}\) and \(\overline{\mathbb {C}}\) by considering a ray from one of the poles of \(\mathbb {S}\) to \(\overline{\mathbb {C}}\) as illustrated in Fig. 4. In this paper, we consider the projection illustrated in Fig. 4a. This imposes no restrictions on the results of the paper. Consider the Riemann sphere \(\mathbb {S}\) in the UVW-space

$$\begin{aligned} u^2 + v^2 + w^2 = 1, \end{aligned}$$
(10)

with radius 1, center O(0, 0, 0), north pole N(0, 0, 1), and the south pole \(S(0, 0, -1)\). Let the extended XY-plane \(\overline{\mathbb {C}}\) coincide with the extended UV-plane, as shown in Fig. 4a. Any outgoing ray from the north pole N meets the sphere and the plane in two corresponding points: M(uvw) on \(\mathbb {S}\) and P(xy) in the plane. This transformation between the sphere and the extended plane is isogonal and homeomorphic [49]. For a given point P(xy) on \(\mathbb {C}\), the corresponding point on the sphere \(\mathbb {S}\) is M(uvw), [15], where

$$\begin{aligned} u = \frac{2x}{\rho ^2 + 1}, \ v = \frac{2y}{\rho ^2 + 1}, \ w = \frac{\rho ^2 - 1}{\rho ^2 + 1}, \ \rho ^2 = x^2 + y^2. \end{aligned}$$
(11)

The point at infinity \(\infty\) in \(\overline{\mathbb {C}}\) is mapped onto N. Conversely, if M(uvw) lies on the sphere, then the corresponding point P(xy) on the plane is given by

$$\begin{aligned} x = \frac{u}{1-w}, \quad y = \frac{v}{1-w}, \quad w \ne 1. \end{aligned}$$
(12)

When \(w = 1,\) i.e. \(M = N, N\) is mapped onto \(\infty\).

Notice that the points of the upper hemisphere of \(\mathbb {S}\) are mapped onto \(\mathbb {D}' = \{z \in \mathbb {C}: \vert z \vert > 1\} \cup \{ \infty \}\), while those of the lower hemisphere are mapped onto the open unit disc \(\mathbb {D} = \{z \in \mathbb {C}: \vert z \vert < 1\}\). Moreover, the unit circle \(\partial \mathbb {D} = \{z \in \mathbb {C}: \vert z \vert = 1\}\) is mapped onto itself.

The SGP enjoys several important topological and geometric properties, which make it an efficient tool in various image processing applications. As it is mentioned above, the stereographic projection is homeomorphic [15], i.e. a continuous \(1-1\) correspondence with a continuous inverse. In addition, this projection maps circles on the sphere onto circles or straight lines on the plane, [22, 49]. In particular, circles on the sphere which are parallel to the UV-plane are mapped onto concentric circles in the XY-plane with center at the origin. In other words, the circles

$$\begin{aligned} w = k, \quad u^2 + v^2 = 1-k^2, \quad \vert k \vert < 1, \end{aligned}$$
(13)

are mapped onto the circles

$$\begin{aligned} x^2 + y^2 = \frac{1+k}{1-k}, \quad \vert k \vert < 1. \end{aligned}$$
(14)

Fig. 5 illustrates the transformation between circles (13) and (14) for some particular cases.

Fig. 5
figure 5

The SGP maps the circles (13), \(k=\frac{1}{2}, 0, \frac{-3}{4}\) onto the circles (14), \(k=\frac{1}{2}, 0, \frac{-3}{4}\), respectively

5 2D representations of 3D objects

In this section, we demonstrate the basic technique of projecting 3D objects onto 2D ones. Without any loss of generality, we assume that we have a 3D point cloud which consists of the points \(P_j = (u_j, v_j, w_j), j = 1, 2, \ldots , n\), all situated in the Riemann sphere \(\mathbb {S}\), i.e.

$$\begin{aligned} \Vert P_j - O\Vert \le 1, \quad O = (0, 0, 0), \end{aligned}$$
(15)

where \(\Vert \cdot \Vert\) denotes the Euclidean norm. This point cloud is a part of the cubic mesh (4) which consists of \(\mathcal {N}^3\) uniformly distributed points. We take \(L = \frac{1}{\sqrt{3}}\approx 0.57735\) since the biggest cube that lies inside \(\mathbb {S}\) is given by (1) with a side length of \(\frac{2}{\sqrt{3}}\). To be able to apply the SGP to this 3D point cloud, the 3D points are transformed onto the surface of the ball (15). We consider the \(\mathcal {N}^2\) roots of unity corresponding to the \(\mathcal {N}^2\) points in each horizontal frame as follows. Let \(z_l\) be the roots of unity where

$$\begin{aligned} z_l := (x_l, y_l) := \left( \cos \left( \frac{2\pi (l-1)}{\mathcal {N}^2}\right) , \sin \left( \frac{2\pi (l-1)}{\mathcal {N}^2}\right) \right) , \end{aligned}$$
(16)

and \(l = 1, \ldots , \mathcal {N}^2.\)

The transformation of 3D objects into the plane is established in two steps. In the first step, the points of the 3D object which lie inside the cube given by (1) with \(L = L_o = \frac{1}{\sqrt{3}}\) are transformed into the surface of the Riemann sphere \(\mathbb {S}\) (10). In the second step, we apply the SGP to tranform the points into the plane. Both steps are \(1-1\) correspondence transformations as we will see below. We start with transforming the whole mesh points from the cube (1) into \(\mathbb {S}\) as shown in the first row of Fig. 6. The points of the mesh are \((u_i, v_j, w_k) \in \mathcal {M}\), where

$$\begin{aligned} \begin{aligned} u_i&= - L_o + \left( \frac{2L_o}{\mathcal {N}-1} \right) i,\\ v_j&= - L_o + \left( \frac{2L_o}{\mathcal {N}-1} \right) j,\\ w_k&= - L_o + \left( \frac{2L_o}{\mathcal {N}-1} \right) k,\\ i, j, k&= 0, \ldots , \mathcal {N} - 1. \end{aligned} \end{aligned}$$
(17)

The transformation is defined as follows. The mesh points in the horizontal plane \(w = w_k\) are mapped onto the points on \(\mathbb {S}\), where \(w = w_k\), i.e.,

$$\begin{aligned} u^2 + v^2& = {} 1 - w_k^2 = r_k^2,\; w = w_k, \end{aligned}$$
(18)
$$\begin{aligned} r_k& = {} \sqrt{1 - L_o^2\left( \frac{2k}{\mathcal {N}-1}-1\right) ^2 }, \end{aligned}$$
(19)

and \(k = 0, \ldots , \mathcal {N} - 1\). The points (17) with \(w = w_k\) for a fixed k are mapped in a \(1-1\) manner onto the following points on (18)–(19)

$$\begin{aligned} P_l = \left( r_k x_l , r_k y_l , w_k \right) , \ l = 1, \ldots , \mathcal {N}^2. \end{aligned}$$
(20)

Since the number of points (17) with \(w = w_k\) is \(\mathcal {N}^2\) and also the number of points (20) is \(\mathcal {N}^2\), this transformation can be made \(1-1\) as indicated below. Finally, the points \(P_l\) are transformed into the plane via a conformal SGP transformation.

Fig. 6
figure 6

2D representation of 3D point clouds. a 3D point clouds. b The projection of the 3D point clouds on the sphere using representation (20). c 2D projection of the 3D point clouds

Fig. 7
figure 7

Illustration of the transformation of points of the mesh of \(w = w_{\mathcal {N} - 1} = w_3\) onto the points \(P_l\) on the circle on the Riemann sphere \(\mathbb {S}\) where \(\mathcal {N} = 4\). a The mesh points in the horizontal plane \(w = w_3\). b The sectors \(S_1, S_2, S_3, S_4\). Points of similar colors are mapped onto each other

There are several ways to transform the points \((u_i, v_j, w_k)\) of (17), where \(w = w_k\) is fixed, onto the points \(P_l\) of (20) in a \(1-1\) manner. A simple way is to transform the points of the frame \(w = w_k\) into a vector of length \(\mathcal {N}^2, \langle \widetilde{P_l} \rangle , l = 1, \ldots , \mathcal {N}^2\) and then take the transformation \(\widetilde{P_l} \leftrightarrow P_l\). Let us illustrate one of these ways. The points (20) lie in \(\mathcal {N}\) equal sectors of the plane \(w = w_k\) determined via

$$\begin{aligned} \left( \frac{2 \pi (\mathcal {N} - 1)(j-1)}{\mathcal {N}^2}\right) \le \arg w < \left( \frac{2 \pi (\mathcal {N} - 1)j}{\mathcal {N}^2}\right) , \end{aligned}$$
(21)

\(j = 1, \ldots , \mathcal {N}\). Each sector of (21) contains exactly \(\mathcal {N}\) elements of (20) as illustrated in Fig. 7. The elements of each sector are prescribed in the following tableau

$$\begin{aligned} \begin{aligned} S_1&: P_1, P_2, \ldots , P_\mathcal {N} \\ S_2&: P_{\mathcal {N} + 1}, P_{\mathcal {N} + 2}, \ldots , P_{2\mathcal {N}} \\ S_3&: P_{2\mathcal {N} + 1}, P_{2\mathcal {N} + 2}, \ldots , P_{3\mathcal {N}} \\ \cdots&: \quad \cdots \quad \cdots \quad \cdots \quad \cdots \\ S_\mathcal {N}&: P_{(\mathcal {N} - 1)\mathcal {N} + 1}, P_{(\mathcal {N} - 1)\mathcal {N} + 2}, \ldots , P_{\mathcal {N}^2} . \end{aligned} \end{aligned}$$
(22)

Thus, the sector \(S_j\) contains the points

$$\begin{aligned} \begin{aligned} S_j : P_{(j - 1)\mathcal {N} + 1}, P_{(j - 1)\mathcal {N} + 2}, \ldots , P_{(j - 1)\mathcal {N} + \mathcal {N}}, \\ j = 1, \ldots , \mathcal {N}. \end{aligned} \end{aligned}$$
(23)

The mesh points (17) in the frame \(w = w_k\) are mapped onto the \(P_l\)’s as follows. Fix j and map \((u_i, v_j, w_k)\) onto the points in the sector \(S_j\), i.e.,

$$\begin{aligned} (u_i, v_{j-1}, w_k) \leftrightarrow P_{(j - 1) \mathcal {N} + (i + 1)}, \quad i = 0, 1, \ldots , \mathcal {N}-1. \end{aligned}$$
(24)

We repeat this transformation for each j and each k. This gives the transformations of the whole mesh onto the surface of the sphere \(\mathbb {S}\). The SGP now sends these points from \(\mathbb {S}\) into the UV-plane (XY-plane). Both tranformations are \(1-1\) correspondence, and therefore the operation has a \(1-1\) inverse as shown in the first row of Fig. 6.

The situation when the 3D object is a proper non-empty subset of the complete mesh is carried out similarly. The set \(\mathcal {M}\) is considered as a 3D binary image, where each point of the mesh is a pixel with a value of 1 (white) if this point is not in the 3D object, otherwise the pixel is assigned a value of 0 (black). Every point of the mesh is transformed as described above with its value to form a binary 2D image as shown in the rows 2–6 of Fig. 6.

The previous representation corresponds to the distribution of the \(\mathcal {N}^2\) roots of unity. We can establish other representations corresponding to the \(\mathcal {N}^2\) roots of any complex number \(z_0 = e^{i \theta _0}, \ -\pi < \theta _0 \le \pi\), which lies on the unit circle. In this case, the roots are

$$\begin{aligned} \tilde{z}_l := (\tilde{x}_l, \tilde{y}_l) := \left( \cos \left( \frac{\theta _0 + 2\pi (l-1)}{\mathcal {N}^2}\right) , \sin \left( \frac{\theta _0 + 2\pi (l-1)}{\mathcal {N}^2}\right) \right) , \end{aligned}$$
(25)

where \(l = 1, \ldots , \mathcal {N}^2\), and we proceed exactly as the previous construction is carried out.

6 Encryption tools

In the proposed cipher, we employ three tools, namely, chaotic maps, chaotic circuits, and Latin cubes in addition to the SGP transformation. These tools ensure that the encryption scheme is effective, reliable, and robust to different types of attacks.

6.1 Chaotic maps

Chaotic maps have several advantages, including primarily their random behavior and high sensitivity to the initial conditions and the control parameters. Therefore, such maps have been extensively used to encrypt different types of data and to promote the confusion and diffusion properties of encryption schemes. For the proposed cipher, we generate random permutation sequences and random binary circuits using respectively two chaotic maps, namely, the logistic [2] and the Gauss-Circle maps [50, 51]. These maps can be respectively defined as follows:

$$\begin{aligned} x_{i+1}& = {} \mu x_{i}(1 - x_{i}), \quad \mu \in (3.57,4], \end{aligned}$$
(26)
$$\begin{aligned} x_{i+1}& = {} e^{- \alpha \left( \frac{5}{4} \left( (x_{i} + \Omega + \frac{\lambda }{2 \pi } \sin (2 \pi x_{i})) \text{ mod } 1 \right) - \frac{1}{2}\right) ^2} + \beta , \end{aligned}$$
(27)

where \(x_i \in (0,1), x \text{ mod } 1:= x - \lfloor x \rfloor\), and \(\alpha , \beta , \lambda\), and \(\Omega\) are real numbers with \(\alpha > 0\), and \(\Omega\) can be limited to \(0 \le \Omega < 1\). The parameters with \(\alpha = 9, \beta = 0.481, \lambda = 10^6\), and \(\Omega = 0.5\) are the best choices for its chaotic behavior [51].

The Gauss-circle map is a recursive function that is a composition of the circle map [12] and Gauss map [46]. The chosen intervals of the systems parameters are selected such that the iterations of an initial \(x_0\) do not lead to any periodic motion but to chaotic trajectories within the interval (0, 1). The logistic and Gauss-circle maps were chosen to generate highly chaotic sequences for permuting points.

6.2 Chaotic circuits

Image encryption schemes widely employ chaotic circuits, particularly the XOR gate [2, 30]. As indicated in [2], any reversible chaotic gate can be used for data encryption (with certain limitations on the security strength). Nevertheless, chaotic circuits have been seldom used for encrypting 3D objects or point cloud data. In our encryption scheme, we transform a given 3D object onto a 2D circular binary image. Consequently, we apply the Fredkin gate to the transformed 2D image and a chaotically-generated binary image.

Fig. 8
figure 8

a Fredkin gate with three inputs. b The truth table for all possible input states

The Fredkin gate (Fig. 8) is a universal reversible gate [42, 56]. This gate takes a 3-bit input (ABC), and outputs 3 bits (PQR) such that the state P is always the same as A, and \(Q = B\), \(R = C\) if \(A = 0; Q = C, R = B\) if \(A = 1\). That is, the Fredkin gate leaves the controlling bit A as it is, and swaps BC if and only if \(A = 1\). This is why this gate is called the controlling swap gate, CSWAP. The outputs of Fredkin gate can be expressed in terms of inputs by the following Boolean expressions

$$\begin{aligned} \begin{aligned} P&= A, \\ Q&= B \oplus (A(B \oplus C)) = A^{ \prime } B \oplus AC, \\ R&= C \oplus (A(B \oplus C)) = A^{ \prime } C \oplus AB,\\ \end{aligned} \end{aligned}$$
(28)

where \(A^{ \prime }\) is the inverter of the bit A and \(\oplus\) is the XOR. As shown in Fig. 8b, the truth table of the Fredkin gate illustrates how the gate works with different combinations of inputs and the corresponding outputs for each combination. Another useful property of the Fredkin gate is that the numbers of zeros and ones are conserved throughout, which helps to show that the model is not wasteful. We point out to the fact that Fredkin gate is more secure than other reversible gates [2, 32].

6.3 Latin cubes

A Latin square of order M is an \(M \times M\) matrix filled with a set of M distinctive symbol elements, where each symbol appears exactly once in each row, column, and cell. A Latin cube is a generalization of the Latin square concept to three dimensions, where each symbol appears exactly once in each row, column, and page. A Latin cube L = \(\{ a_{ijk} \}\) of order M is an \(M \times M \times M\) cube (M rows, M columns, and M pages) in which each cell contains a single symbol from a set S of M different symbols, such that for any two fixed subscripts, the cells \(a_{ijk}\) contain different numbers when the other subscript runs from 1 to M. Latin cubes have many desirable properties, including symmetry, transitivity, and orthogonality, making them useful for a variety of applications in science and engineering.

Fig. 9
figure 9

a A \(4 \times 4\) Latin square. b Three orthogonal Latin cubes \(L_1, L_2, \text {and } L_3\)

Three Latin cubes on the same set S are orthogonal if, when the cubes are superimposed, each ordered triple in \(S \times S \times S\) occurs exactly once, as shown in Fig. 9. Latin squares/cubes are widely used in experimental design, particularly in the design of experiments involving randomization. Latin squares and cubes are applied in many image ciphers [24, 61, 62] for permutation and substitution operations and the encryption schemes based on them are resilient to known attacks, such as frequency analysis and statistical attacks, as both have uniform histograms. The existence and construction methods of orthogonal Latin cubes have been studied in [5, 6].

Fig. 10
figure 10

The proposed encryption scheme for 3D point clouds

Fig. 11
figure 11

Binary image shuffling using the Fredkin gate

7 Encryption and decryption schemes

This section introduces the overall workflow of the proposed 3D object encryption and decryption schemes. The flow consists of three steps: the plain-cloud representation and projection, the 3D plain-cloud permutation and shuffling, and the cipher-cloud representation step. Figure 12 shows the application of the encryption-decryption schemes. Applying logistic and Gauss-circle maps, we generate chaotic sequences using the secret key \(\mathcal {K} = \left( K_1, K_2, K_3, K_4, K_5 \right) ^{\top }, \ K_i \in \left( 0, 1 \right) , \ 1 \le i \le 5\). The encryption scheme is outlined in Fig. 10.

I. Plain-cloud representation and projection.

Assume that the 3D plaintext lies inside a cube with \(\mathcal {N}^3\) mesh points (as shown in Fig. 12a for the example of a ball). The plaintext can be represented by a 3D binary image by assigning a value 0 (black) for points of the 3D point cloud and a value 1 (white) for the rest of the mesh points, as shown in Fig. 12b. A correspondence between the frames and circles (20) obtained by the roots of unity is established. These 3D circles on \(\mathbb {S}\) are mapped via the SGP (12) to obtain the 2D circles on the XY-plane, as shown in Fig. 13b, c.

II. Permutation steps.

Firstly, \(\mathcal {N}\) permutations are implemented on the binary values of each frame, i.e., on their projections in the XY-plane. The logistic (26) and Gauss-circle (27) maps are applied alternatively with different perturbations of \(K_1\) as initial values to generate these \(\mathcal {N}\) permutations such that the even-numbered frames are permuted using the logistic map, while the odd-numbered frames are shuffled using the Gauss-circle one. The circles in the XY-plane are themselves chaotically permuted using a permutation generated via the use of the Gauss-circle map (27) with the key \(K_2\) as an initial value.

On each ray of the XY-plane, \(\theta =\frac{2 \pi (l-1)}{\mathcal {N}^2}\), \(1\le l\le \mathcal {N}^2\), there are \(\mathcal {N}\) binary pixels. These pixels are permuted via \(\mathcal {N}^2\) permutations maps, each of which has a size \(\mathcal {N}\). The permutation maps are created and implemented following the same scenario mentioned above, using the key \(K_3\) in place of \(K_1\). The last permutation is executed on the whole \(\mathcal {N}^3\) binary values of the circular binary image. For this purpose, the permutation sequence is generated by using the Gauss-circle map (27) with \(K_4\) as an initial value.

III. Applying Fredkin gate and Latin cubes.

Before applying the Fredkin gate, the \(\mathcal {N}^3\) points are split into two equal halves of binary sequences (referred to as B and C in Fig. 8a). Then, we generate a random binary sequence using the logistic map (26) of length \(\lceil \frac{\mathcal {N}^3}{2} \rceil\) and \(K_5\) as an initial value, and use the generated sequence as a control sequence of the Fredkin gate (28). Using the Fredkin gate with the existing binary circular image, the two halves of \(\mathcal {N}^3\) binary values will be shuffled to yield two binary sequences (denoted as Q, R in Fig. 8a). Finally, merging the two shuffled halves gives us the permuted \(\mathcal {N}^3\) points. The shuffling process using the Fredkin gate is illustrated in Fig. 11.

Using Algorithm 1 of [24], three orthogonal Latin cubes of order \(\mathcal {N}\) are created, and we use the corresponding elements in these Latin cubes as indices to permute the binary values representing the frame points with each other.

IV. The 3D cipher-cloud formation.

After the previously mentioned series of operations, the 3D plaintext is transformed into a binary encrypted 2D image. We can reverse the projection step to form a 3D ciphertext. We first apply the inverse of the SGP (11) to obtain sphere points representing the cipher point cloud, as shown in Fig. 12c and Fig. 13g. Finally, the points on the sphere are mapped onto the mesh using the inverse of the transformations established in Sect. 5 to obtain the ciphertext.

Fig. 12
figure 12

Example of the encryption-decryption algorithm. a Frames with \(\mathcal {N}^3 = 32^3\) points. b Plain point cloud with 12568 points. c Cipher point cloud. d Decrypted point cloud

The decryption algorithm is indeed the reverse of the encryption steps. If we are given a ciphertext along with the secret keys, we start by representing a binary image as indicated above. Since all the used projections, permutations, logic circuits, and Latin cube permutations are all \(1-1\) correspondences, the inverse of the encryption algorithm exists. Following the same steps of I a correspondence between the 3D ciphertext and a circular binary image in the XY-plane is established. After that, we reverse the encryption operations to retrieve the 3D plaintext. Figure 12 shows the application of the encryption and decryption procedures on a 3D point cloud with 12568 points. Figure 12a shows \(\mathcal {N}^3 = 32^3\) points, i.e., the totality of the frame points, Fig. 12b shows 1728 points of the plaintext, Fig. 12c shows 12568 points of the ciphertext, and Fig. 12d shows the decrypted plain point cloud.

Figure 13 shows a more detailed example for the encryption steps. As shown in Fig. 13a, we have \(\mathcal {N} = 64\) frames, with a total of \(64^3 = 262144\) frame points. The corresponding circles of unity for these frames are depicted in Fig. 13b. The SGP for these circles is shown in Fig. 13c. The 3D plain point cloud in Fig. 13d is a (solid) hyperboloid of one sheet with 133152 points. The first step of the proposed cipher is to construct the corresponding circles representation for these points, as illustrated in Fig. 13e. Then, we apply the SGP to these circle points in order to obtain the plane points, as shown in Fig. 13f. Hence, we assign the binary values corresponding to the frames points such that 0 indicates that the point belongs to the plain point cloud and 1 indicates that the point does not belong to the plain point cloud. Consequently, as mentioned in Sect. 6, we applied chaotic permutations, chaotic circuits, and Latin cube permutations to obtain the points depicted in Fig. 13i. We then applied the inverse SGP to obtain the 3D points shown in Fig. 13h. Finally, in Fig. 13g, we obtained the 3D points of the cipher point cloud. More examples are shown in Figs. 14 and 15 for regular and irregular point clouds, respectively.

Fig. 13
figure 13

Encryption steps for a 3D point cloud with 133152 points and \(\mathcal {N}=64\). a Frame points \(\mathcal {N}^3\). b Circles of unity corresponding to a. c The SGP of the circles of unity. d Plain point cloud. e Circles of unity corresponding to the points in d. f Stereographic projection of e. i After applying different permutation series and chaotic circuits. h Circles of unity resulting from the reverse projection of the points in i. g Cipher point cloud

8 Simulation results and statistical analysis

Fig. 14
figure 14

Encryption steps for five point-cloud examples: a cube, b ball, c cylinder, d double cone, and e hyperboloid of one sheet. Each example has the following corresponding forms: plain point cloud (Row 1), 3D sphere points (Row 2), SGP of sphere points (Row 3), permuted projected points (Row 4), inverse projection of permuted points (Row 5), cipher point cloud (Row 6), and decrypted point cloud (Row 7)

We applied the proposed cipher to five 3D point clouds, namely, cube, ball, cylinder, double cone, and hyperboloid of one sheet. The number of points n for each one of these point clouds is mentioned in Table 1. Figure 14 shows the encryption steps for five examples. The first row shows the plain point cloud, the second row shows the 3D sphere points corresponding to the plain point cloud, the third row shows the SGP of the sphere points, the fourth row shows the result after applying different permutation maps on the projected points, the fifth row shows the inverse projection of the permuted points, and the last row shows the cipher point clouds. All examples were generally encrypted by the arbitrary (but fixed) secret key \(\mathcal {K} = (0.1, 0.8, 0.2, 0.6, 0.4)^\top\). For all examples, the cipher point cloud is clearly random, with no visual clues to the original point cloud. This is also assured by the histogram analysis, which is carried out below. Also, the decrypted point clouds are essentially identical to their corresponding original ones. More importantly, all of the point cloud encryption results turned out to be geometrically stable [1], i.e., each of the resulting cipher point clouds is strictly located within the sphere enclosing the original point cloud.

Furthermore, we demonstrate the advantages of the proposed cipher through several experiments. First of all, we carry out a similarity analysis to examine the robustness of the proposed approach against potential statistical attacks (Sect. 8.1). In Sect. 8.2, we compute the size of the key space of the proposed cipher to demonstrate its resistance against the brute-force attacks. We then investigate the sensitivity of the proposed method to key perturbations (Sect. 8.3) and plaintext perturbations (Sect. 8.4). In addition, histogram analysis is carried out in Sect. 8.5. In Sect. 8.6, we use the structural similarity index (SSIM) to measure the dissimilarity between plain and cipher point clouds. Finally, in Sect. 8.7, we apply the NPCR and UACI randomness tests to evaluate the strength of the proposed method against differential attacks.

Fig. 15
figure 15

Encryption and decryption results for the torus and irregularly shaped point-cloud examples: a torus, b bunny, c dog. d teapot. Each example has the following corresponding forms: plain point cloud (Row 1), 3D sphere points (Row 2), SGP of sphere points (Row 3), permuted projected points (Row 4), inverse projection of permuted points (Row 5), cipher point cloud (Row 6), and decrypted point cloud (Row 7)

Before we carry out the above mentioned analysis, we would like to point out to Fig. 15. In this figure, we implement a complete encryption-decryption experiments to another manifold, the torus, and to other irregular 3D objects, bunny, dog, and teapot. As shown encryption and decryption algorithms work perfectly.

8.1 Similarity analysis

Any similarity patterns between a plain point cloud and a corresponding cipher point cloud can leak information about the cipher or its key. Indeed, using known-plaintext attacks, the adversary can reveal the relationship between plain and cipher point clouds by selecting pairs of plaintexts and their corresponding ciphertexts and performing some statistical analyses on these pairs. We examined the robustness of the proposed encryption method against such types of attacks by evaluating key measures of similarity for 3D point clouds: the Hausdorff distance and the Euclidean distance.

The Hausdorff distance [14, 45] measure is widely applied (with different variants) in computational geometry and also in other domains such as computer vision and pattern recognition [52, 54]. Let \(\varvec{X}\) and \(\varvec{Y}\) be two 3D point clouds with N and M elements, respectively, where \(N, M \in \mathbb {N}\). The Hausdorff distance between \(\varvec{X}\) and \(\varvec{Y}\) is defined to be

$$\begin{aligned} H(\varvec{X}, \varvec{Y}) := \max \Bigg \{ h(\varvec{X}, \varvec{Y}), h(\varvec{Y}, \varvec{X}) \Bigg \}, \end{aligned}$$
(29)

where \(h(\varvec{X}, \varvec{Y})\) and \(h(\varvec{Y}, \varvec{X})\) are the directed Hausdorff distances:

$$\begin{aligned} h(\varvec{X}, \varvec{Y}) & := {} \underset{x \in \varvec{X}}{\sup } \ \underset{y \in \varvec{Y}}{\inf } \Vert x - y \Vert , \end{aligned}$$
(30)
$$\begin{aligned} h(\varvec{Y}, \varvec{X})& := {} \underset{y \in \varvec{Y}}{\sup } \ \underset{x \in \varvec{X}}{\inf } \Vert y - x \Vert , \end{aligned}$$
(31)

where \(\Vert \cdot \Vert\) denotes the Euclidean norm, sup and inf represent the supremum and the infimum, respectively. The set of all compact subsets of \(\mathbb {R}^n, n \in \mathbb {N}\) (including 3D finite point clouds) together with the Hausdorff distance is a complete metric space [14]. If \(h(\varvec{X}, \varvec{Y})= d_1\), this means that for every \(x \in \varvec{X}\),

$$\begin{aligned} B_{d_1}(x) \cap \varvec{Y} \ne \phi , \end{aligned}$$
(32)

i.e. every ball centered at x with a radius \(d_1\) must contain at least one point of \(\varvec{Y}\). The distance \(d_2 = h(\varvec{Y}, \varvec{X})\) can be interpreted similarly. If \(H(\varvec{X}, \varvec{Y})=d\), then for each \(x \in \varvec{X},\ y \in \varvec{Y}\),

$$\begin{aligned} B_{d}(x) \cap \varvec{Y} \ne \phi , \quad \varvec{X} \cap B_{d}(y) \ne \phi . \end{aligned}$$
(33)

Thus, \(H(\varvec{X}, \varvec{Y})\) measures the degree of mismatch between \(\varvec{X}\) and \(\varvec{Y}\). The smaller \(H(\varvec{X}, \varvec{Y})\) is, the closer \(\varvec{X}\) and \(\varvec{Y}\) are to be.

In addition to the Hausdorff distance, we can use the Euclidean distance to measure the point-wise similarity between two point clouds. The Euclidean distance between two 3D points \(P^i\) and \(P^j\) is \(\left\Vert P^i - P^j \right\Vert\). So, for two point clouds \(\mathcal {P}\) and \(\mathcal {Q}\) with the same number of points n, the pairwise Euclidean distance between the jth pair of corresponding points is

$$\begin{aligned} E^j = \left\Vert P^i - Q^j \right\Vert , \quad 1 \le j \le n. \end{aligned}$$
(34)

Thus, the Euclidean distance between the two equal-sized point clouds \(\mathcal {P}\) and \(\mathcal {Q}\) can be defined as

$$\begin{aligned} E(\mathcal {P}, \mathcal {Q}) = \frac{1}{n} \sum _{j=1}^{n} E^j . \end{aligned}$$
(35)
Table 1 The Hausdorff (H) and Euclidean (E) distances between pairs of plain (\(\mathcal {P}\)) and cipher (\(\mathcal {C}\)) point clouds and pairs of plain (\(\mathcal {P}\)) and decrypted (\(\mathcal {D}\)) point clouds, where n denotes the number of points of the point cloud

We used both the Hausdorff and Euclidean metrics to measure the dissimilarity between corresponding pairs of plain point clouds \(\mathcal {P}\) and cipher point clouds \(\mathcal {C}\), and also to measure the similarity between corresponding pairs of plain point clouds \(\mathcal {P}\) and decrypted point clouds \(\mathcal {D}\). The Hausdorff and Euclidean distances for the point clouds of Fig. 14 are shown in Table 1. As shown in Table 1, the Hausdorff distance \(H(\mathcal {P}, \mathcal {C})\) is significantly larger than zero for all point clouds. This reflects that our method produces cipher point clouds that are highly different from their corresponding plain point clouds. Also, we realize that \(H(\mathcal {P}, \mathcal {D})\) is zero for all examples, and this indicates that the plain and decrypted point clouds are identical. The Euclidean distance results in Table 1 show similar patterns and lead to the same conclusions. For further illustration, Fig. 16 shows the pairwise Euclidean distance results for the Hyperboloid point cloud. Clearly, the Euclidean distance for each pair of plain and cipher points is significantly greater than zero, while the Euclidean distance for each pair of plain and decrypted points is zero.

Fig. 16
figure 16

Point-wise Euclidean distances for the hyperboloid point cloud with \(n = 16312\). a The distance between the plain and cipher point clouds. b The distance between the plain and decrypted point clouds

8.2 Key space analysis

The proposed cipher uses five seed points to initiate the chaotic maps. Considering the double precision 64-bit IEEE 754 format [25], a 64-bit number is represented using 1 bit for the sign, 11 bits for the exponent, and 52 bits for the fraction. In this format, the exponent is biased by adding \(1023=(01111111111)_2\) before being stored. Each key value is a fraction between 0 and 1, i.e., \(K_i \in (0, 1), 1 \le i \le 5\). Hence, the most significant bit of the biased exponent and the sign bit are both equal to 0. However, the fraction part uses all 52 bits. Therefore, the key length of the proposed cipher is \(310 (= 5 \times 62)\) bits. Accordingly, for a ciphertext-only attack, an exhaustive key search has to explore \(2^{310}\) possible keys. Obviously, this key space is large enough to abort brute-force attacks.

8.3 Sensitivity to key perturbation

One of the desired properties for any cipher is to be sensitive to small perturbations of the secret key. In fact, trying to encrypt a plaintext with a slightly modified secret key must produce a completely different ciphertext. Also, trying to decrypt a ciphertext with a slightly modified secret key must produce a completely different plaintext.

Fig. 17
figure 17

Key sensitivity test results for 15 perturbation values uniformly selected in the range \(\delta \in [-0.001, 0.001]\) for the cone. a Hausdorff distances, b Euclidean distances

We experimentally investigated the sensitivity of the proposed algorithm to perturbations of the secret key \(\mathcal {K}\) elements. In particular, we encrypted the cone point cloud using the proposed algorithm with the secret key \(\mathcal {K} = \left( 0.1, 0.8, 0.2, 0.6, 0.4 \right)\). Then, we perturbed each of the secret key elements by 15 perturbation values uniformly selected in the range \(\delta \in [-0.001, 0.001]\).

After that, we tried to decrypt the cipher point cloud using each of the perturbed key values. We computed the Hausdorff and Euclidean distances between the original plain point cloud and each of the decrypted point clouds obtained with different perturbed key values. Figure 17a shows a plot of the Hausdorff distances for the five key elements over the perturbation range. Figure 17b shows a similar plot of the average Euclidean distances. Obviously, for all key elements, the Hausdorff and Euclidean distances increase sharply at a very small deviation from the true key parameter values.

In fact, key perturbation aggressively distorts the cipher point clouds as well as the decrypted point clouds. For example, Fig. 18 shows the effect of using a slightly perturbed key in encrypting the cylinder plain point cloud (Fig. 18a). Specifically, two cipher point clouds were obtained through encrypting this point cloud with the key \(\mathcal {K} = \left( 0.1, 0.8, 0.2, 0.6, 0.4 \right)\) and the slightly modified key \(\widetilde{\mathcal {K}} = \left( 0.1001, 0.8, 0.2, 0.6, 0.4 \right)\), respectively. The pairwise Euclidean distances between the two cipher point clouds are plotted in Fig. 18b. Clearly, the computed distances are quite large. This result indicates that the perturbation of a single entry in the key \(\mathcal {K}\) leads to a large disparity in the encryption results.

Fig. 18
figure 18

Effects of key perturbation: a The cylinder plain point cloud with \(n = 172800\), b the pairwise Euclidean distance between the cipher point cloud obtained by an unperturbed key \(\mathcal {K} = \left( 0.1, 0.8, 0.2, 0.6, 0.4 \right)\), and the cipher point cloud obtained by a slightly perturbed key \(\widetilde{\mathcal {K}} = \left( 0.1001, 0.8, 0.2, 0.6, 0.4 \right)\)

Fig. 19
figure 19

Sensitivity to plaintext perturbation for the ball. The Euclidean distance between the original cipher point cloud and each of the ten ciphers obtained for each percentage value of the replaced points

8.4 Plaintext sensitivity analysis

One of the most important security strengths of any cipher is being highly sensitive to small perturbations in the plaintext, i.e., a small change in the plaintext leads to a significant change in the corresponding ciphertext. This sensitivity means that no meaningful relationship between the plaintext and the ciphertext can be revealed through differential cryptanalysis, where an attacker seeks to recover the secret key by observing the ciphertext changes caused by small plaintext changes.

In the proposed cipher, the binary sequence representing the plain point cloud is passed through various permutation stages, which are primarily based on highly chaotic maps. These permutation steps have a significant impact on the binary sequence of the plaintext, so that minor changes in the plaintext result in significant changes in the ciphertext.

We tested the resistance of the proposed cipher as follows. For the ball plain point cloud, we obtained the cipher point cloud with the proposed cipher. Then, the plain point cloud was modified by randomly replacing \(0.1\%\) of the plaintext points with non-plaintext frame points. The modified plaintext was thus encrypted by the proposed cipher with the same encryption key. Then, we computed the average Euclidean distance between the original ciphertext and the ciphertext obtained from the perturbed point cloud. We repeated this process for different percentages ranging from \(0.1\%\) to \(1\%\) with an increment of \(0.1\%\). Figure 19 shows the average Euclidean distance versus the perturbation percentage. As can be seen, the distance noticeably increases as the percentage increases, and this indicates the high sensitivity of our cipher to changes in the plaintext points.

Table 2 Histogram uniformity results in terms of chi-square values for plain and cipher point-cloud examples

8.5 Histogram analysis

Histogram analysis is a useful for evaluating the security and quality of a cipher. Since a good encryption method tends to encrypt a plaintext into a random one, it is desirable to see a uniformly distributed histogram for a ciphertext image.

For histogram analysis, we computed the number of points in each frame before and after encryption. As shown in Fig. 20, the histogram before encryption follows some point distribution over the frames while the histogram after encryption tends to be uniform. This reflects the high quality of the proposed cipher as it distributes the plaintext points randomly and uniformly over the frames.

The uniformity of a histogram based on the proposed encryption scheme can be evaluated using the chi-square metric [19, 40, 53],

$$\begin{aligned} \chi ^2 = \sum _{r=1}^{\mathcal {N}} \frac{(V_r - e)^2}{e}, \end{aligned}$$
(36)

where \(\mathcal {N}\) is the number of frames, r is the frame index, \(V_r\) is the number of zeros (number of plaintext or ciphertext points) in the frame r, and \(e = \frac{n}{\mathcal {N}}\) is the expected number of zeros in each frame, where n is the total number of plaintext or ciphertext points. Lower values of the chi-square statistic indicate better histogram uniformity. The values of this metric for the point-cloud examples before and after encryption are shown in Table 2. The sharp drop in the values after encryption demonstrates the uniformity of the histograms of the obtained ciphertexts.

Fig. 20
figure 20

Histogram distributions for the elliptic cone point cloud: a Before encryption, b After encryption

8.6 Structural similarity index measure

The structural similarity index measure (SSIM) is a widely used metric in image processing and computer vision [23, 57]. This metric plays a crucial role in quantifying the perceptual similarity between two images. Unlike traditional metrics such as the mean-squared error (MSE), the SSIM is a more robust measure of visual quality that takes into account the structure, luminance, and contrast information of the input images. The SSIM operates on the principle that the human visual system is highly sensitive to changes in structure and texture. As a result, this metric has gained popularity for assessing the fidelity of image compression, denoising, and various image enhancement techniques. The SSIM score ranges from \(-1\) to 1, where 1 represents perfect similarity. The SSIM provides a nuanced evaluation of image similarity and has been extensively applied in numerous applications, from medical imaging to video streaming optimization.

Table 3 Dissimilarity results between plain and cipher point clouds in terms of SSIM values

One of the remarkable features of the SSIM is its adaptability to various image types, including binary images, and this makes it a valuable tool for evaluating the dissimilarity between a plaintext and a corresponding ciphertext in the context of image encryption. When assessing binary image ciphers, the SSIM serves as an objective quantitative measure of the extent of structural and perceptual changes introduced during the encryption process. A low SSIM indicates a significant dissimilarity between the original plaintext and the resulting ciphertext. This can be a compelling way to visually demonstrate the effectiveness of an encryption algorithm in distorting the structural image characteristics, ensuring that sensitive information is concealed and protected from visual inspection. However, the SSIM should be used in conjunction with comprehensive cryptographic analysis to guarantee the overall security and confidentiality of the encrypted binary data. Nonetheless, the SSIM remains a powerful tool for providing empirical evidence of the visual dissimilarity between a plaintext and a corresponding ciphertext in image encryption scenarios.

The SSIM [13, 57] computation involves three terms, namely a luminance term, a contrast term, and a structural term. The overall index is a multiplicative combination of the three terms:

$$\begin{aligned} \text{ SSIM }(x,y)=[l(x,y)]^{\alpha } \cdot [c(x,y)]^{\beta } \cdot [s(x,y)]^{\gamma }, \end{aligned}$$
(37)

where

$$\begin{aligned} l(x,y)= \frac{2 \mu _x \mu _y + C_1}{\mu _x^2 + \mu _y^2 + C_1}, \end{aligned}$$
(38)
$$\begin{aligned} c(x,y)& = \frac{2 \sigma _x \sigma _y + C_2}{\sigma _x^2 + \sigma _y^2 + C_2}, \end{aligned}$$
(39)
$$\begin{aligned} s(x,y)& = \frac{\sigma _{xy} + C_3}{\sigma _x \sigma _y + C_3}. \end{aligned}$$
(40)

The parameters \(\mu _x, \mu _y, \sigma _x, \sigma _y,\) and \(\sigma _{xy}\) are respectively the local means, standard deviations, and cross-covariance for images xy. If \(\alpha = \beta = \gamma = 1\) (the default for the exponents in Eq. (37)), and \(C_3 = C_2/2\) (default selection of \(C_3\)), the index simplifies to:

$$\begin{aligned} \text{ SSIM }(x,y) = \frac{(2 \mu _x \mu _y + C_1) (2 \sigma _{xy} + C_2)}{(\mu _x^2 + \mu _y^2 + C_1) (\sigma _x^2 + \sigma _y^2 + C_2)}. \end{aligned}$$
(41)

The constants \(C_1, C_2, C_3\) are non-negative numbers used respectively as regularization constants for the luminance, contrast, and structural terms. These constants help avoid instabilities for image regions where the local mean or standard deviation is close to zero. Therefore, small non-zero values should be used for these constants [13]:

$$\begin{aligned} C_1 = (0.01G)^2, \ C_2 = (0.03G)^2, \ C_3 = C_2/2, \end{aligned}$$

where G is the dynamic range of the pixel values (255 for grayscale images and 1 for binary images). The SSIM values for binary image representations of corresponding pairs of plaintexts and ciphertexts are shown in Table 3. All SSIM values are close to zero, and this indicates that the compared plaintext and ciphertext are highly dissimilar in terms of their structure, luminance, and contrast. This result signifies a substantial lack of structural similarity or visual resemblance between the compared plaintext and ciphertext images. This means that the encryption process has introduced significant visual differences, making it challenging for an observer to deduce any information about the plain point cloud from the encrypted one.

8.7 NPCR and UACI randomness tests

The normalized pixel change rate (NPCR) and the unified average changing intensity (UACI) have emerged as statistical measures of image encryption strength against differential attacks [33, 40, 41]. Tests based on these measures have garnered widespread recognition and adoption within the image encryption community, owing to their ability to assess the randomness and robustness of encryption algorithms. By evaluating the subtle variations and transformations in pixel values, the NPCR and UACI can be used to evaluate and seek enhanced image encryption techniques.

Suppose ciphertext images before and after a one-pixel change in a plaintext image are \(C^1\) and \(C^2\), respectively. The pixel values at the grid position (ij) in \(C^1\) and \(C^2\) are denoted as \(C^1(i, j)\) and \(C^2(i, j)\), respectively, and a bipolar array D is defined as

$$\begin{aligned} D(i, j) = {\left\{ \begin{array}{ll} 0, \quad \text {if } C^1(i, j) = C^2(i, j),\\ 1, \quad \text {if } C^1(i, j) \ne C^2(i, j).\\ \end{array}\right. } \end{aligned}$$
(42)

Then, the NPCR and UACI can be mathematically defined respectively as follows [60]:

$${\boldsymbol{N}}(C^{1}, C^{2}) = \sum_{i, j} \frac{D(i, j)}{T} \times 100\%$$
(43)
$$\begin{aligned} {\boldsymbol{U}}(C^{1}, C^{2}) = \sum_{i, j} \frac{\vert C^{1}(i, j) - C^{2}(i, j) \vert }{F \cdot T} \times 100\% \end{aligned}$$
(44)

where T denotes the total number of pixels in the ciphertext, F denotes the largest supported pixel value that is compatible with the ciphertext image format, and \(\vert \cdot \vert\) denotes the absolute value function. It is obvious that the UACI gives the average difference between two paired ciphertext images, while the NPCR indicates the absolute number of pixels that change value in differential attacks.

The NPCR range is from 0 to 1. A zero-value NPCR (i.e., \(\varvec{N}(C^1, C^2) = 0\)) indicates that all pixel values in \(C^2\) are identical to the corresponding ones in \(C^1\). Conversely, a one-value NPCR (i.e., \(\varvec{N}(C^1, C^2) = 1\)) signifies that every pixel in \(C^2\) has been changed relative to the corresponding one in \(C^1\). In essence, establishing correlations between two ciphertext images, \(C^1\) and \(C^2\), before and after a differential attack turns to be a challenging endeavor. Nonetheless, occurrences of \(\varvec{N}(C^1, C^2) = 1\) are infrequent, as even when two independently generated truly random images are compared, they rarely achieve this maximum NPCR, especially when the image size significantly exceeds that of F. The UACI range is, indeed, confined to [0, 1] as well.

In our situation, we work with binary images where each pixel has a value of either 0 or 1, and therefore \(F = 1\) and \(T = \mathcal {N}^3\). As a result, we can observe that in our case, NPCR and UACI have the same value. The results of this test are shown in Table 4 after changing \(1\%\) of the plaintext points. Table 4 shows the NPCR scores for various point-clouds with \(N=262144 \ (512 \times 512)\), and when n selected with two values n1, n2. Clearly, the NPCR score is dependent on n (number of plaintext points) rather than \(\mathcal {N}^3\) (total number of frame points). The results show that when n is selected in a range around \(\mathcal {N}^3 / 2\), the NPCR value is close to 0.5 which is the optimal theoretical value for \(F=1\). When \(n \gg \mathcal {N}^3/2\), the NPCR value achieves much higher score than 0.5, and vice versa. Consequently, the choice of the number of points n representing the plain-cloud object affects the result of NPCR, and for accepting this score to be within the critical values, n should be selected to be close to \(\mathcal {N}^3/2\).

Table 4 NPCR results for cipher point clouds before and after differential attacks

9 Conclusions

This work introduces 2D-representations of 3D objects or 3D point clouds. The representation is based on the stereographic projection (SGP) transformation, its geometric and topological properties. The 3D objects of \(\mathbb {R}^3\) are mapped into the surface of the Riemann sphere \(\mathbb {S}\) and hence the SGP maps them into the extended complex plane \(\overline{\mathbb {C}} = \mathbb {C} \cup \{\infty \}\), where \(\mathbb {C}\) is the field of complex numbers. The representation is circular and 1–1. Consequently, the inversion from \(\overline{\mathbb {C}}\) into \(\mathbb {R}^3\) is guaranteed. Therefore, the representation proposed in this paper is efficient for various signal and image processing applications. It can be implemented in 3D image encryption, steganography and watermarking, defect and object detection and template matching, 3D-image restoration and classification, to mention a few. With this respect, we introduced a 3D object encryption algorithm that incorporates the proposed 2D-representations of 3D objects with chaotic permutations, chaotic circuits, and Latin cubes. To the best of our knowledge, no earlier work employed SGP in 3D object encryption algorithms. Our technique is combined with a series of permutations based on the use of chaotic and hyper-chaotic maps, chaotic Fredkin gates, and Latin cubes. Quantitative and statistical measures are used to demonstrate the effectiveness of the proposed 3D encryption algorithm. The efficiency and resilience of the suggested cipher against various forms of attack are demonstrated by a number of experiments, including key sensitivity, plaintext sensitivity, and histogram analysis.