Modular Square One-Way Function: Analyzing The Algorithm For Randomness, Regularity Schematic (Codec System) and Vector Normalization
Modular Square One-Way Function: Analyzing The Algorithm For Randomness, Regularity Schematic (Codec System) and Vector Normalization
Abstract: Actually, The proposed paper was built as one part working through analyzing one-way modular square which is
a special case of modular exponentiation with exponent of 2, counter form of quadratic residue, for encryption and PKI
implementation. Later on, Due to the amount of data regarding this analysis, it seems be better to separate it to three parts.
This paper (Part-1) aims to analyze a modular square one-way function using integer factorization (IF) or approximation
methods. It is supposed that such function has random characteristics. This analysis considers a new innovative idea, original
as claimed, focusing in notable regularities that could be used as a trapdoor for practical applications. Such as random
generator, new codec system and 3D vector normalization. At the end, different types of quadratic residue algorithms and
square root will be considered.
Keywords: Square Root Algorithm, Modular Square, Modular Arithmetic, Quadratic Nonresidue Square Root, One-Way Function,
Newton-Raphson Method, Exponentiation By Squaring, Jacobi Prime, Legendre Symbol, Fast Inverse Square Root (Invsqrt), Vector
Normalization.
How to Cite: Ahmed Mohammed Al-Fahdi. (2025). Modular Square One-Way Function: Analyzing the Algorithm for Randomness,
Regularity Schematic (Codec System) and Vector Normalization. International Journal of Innovative Science
and Research Technology, 10(1), 79-87. https://doi.org/10.5281/zenodo.14908867.
inverse square root algorithm allow to implement it in vector integer factorization (IF), discrete logarithmic (DL) and
normalization. [4][5] quadratic nonresidue (QR) leads to focus in the integer
factorization (IF) as simple start point. As a result of quadratic
B. Modular Square Function nonresidue Integers, the resulting arithmetic modular
In mathematics, there are only few functions assumed supposed to be irrational number, for noncomplete squares.
(conjectured) to be one-way. None of these functions is For such calculation, in this methodology, a way of numerical
proven to be one-way. It is theoretically not even known the analysis will be used called Newton’s approximation method
proof of existence of such functions. Modular square function which is also known as Newton-Raphson method. This way
(1) is supposed to be a one-way function. It is also called will help to find the roots or zeros with a real-valued function
square function. [1] 𝑓 and its derivative 𝑓′.For illustration, in geometrically
respective this allow to approximate the zeros using tangent
𝑦 = 𝑓(𝑥) = 𝑥 2 (𝑚𝑜𝑑 𝑛) of the function graph (Figure-1). The execution of a linear
approximation is in repeated process with a recursive
Analyzing the nonresidue quadratic root, for non- partitioning procedure. [6]
perfect squares, of this function using techniques such as
𝑓 ′(𝑥𝑖 ) = 2𝑥 (4)
Notice-1: The Methodology trick used here is that from III. RESULTS
above functions it is easy to calculate the square modular
(r) approximated to the closest integer using rational part The following table summarize the calculations that
approximation with threshold of 0.5. The same thing is have been done in the above section resulting from equations
done with the rational part of the root modular (n) (1-6) where:
approximated to the ratio of 0.5 using threshold of ¼ and
¾. 𝑥 2 :is the square, non-perfect squares chosed randomly
𝑥: is the square root
𝑟: is the square remainder approximated to integer (𝑥 2 −
2
𝑥𝑎𝑝𝑝 )
𝑛 :is the ratio, from rational par, of the root remainder
(𝑥𝑒𝑥𝑎𝑐𝑡 − 𝑥𝑎𝑝𝑝 ) × 𝑥𝑎𝑝𝑝
𝑛
: is the notified correlation between 𝑛 and 𝑟
𝑟
Notice-2: From number analysis, it is clear that the square After the suggested approximations, the ratio of the root
number residue (r) could be directly extracted as double modular to the square modular has fixed magnitude of (0.5)
of the root modular ratio (n) without the traditional with alternating sign as shown in the below figure (3).
subtraction method.
Fig 3: Root Modular ratio to the Square Modular with Fixed Magnitude at (0.5)
IV. RESULTS ANALYZING similar to the modular square function (1) which is a special
case of the modular exponent function as follow:
Form above methodology and results a case study has
been considered above for modular square one-way function 𝑄𝑢𝑎𝑑𝑟𝑎𝑡𝑖𝑐 𝑟𝑒𝑠𝑖𝑑𝑢𝑒 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛
using equation (7):
𝑥 2 = 𝑞(𝑚𝑜𝑑 𝑛) (11)
2 2
𝑟=𝑥 − 𝑥𝑎𝑝𝑝 (7)
𝑀𝑜𝑑𝑢𝑙𝑎𝑟 𝑠𝑞𝑢𝑎𝑟𝑒 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛
Analyzing the relation of such residue to the ratio of the
rational part of the root using equation (8): 𝑞 = 𝑥 2 (𝑚𝑜𝑑 𝑛)
19 35 -1 .5 -1
20 36 0 0 0
21 37 1 .5 1
22 38 2 1 1
23 39 3 1.5 1
24 40 4 2 1
25 41 5 2.5 1
26 42 6 3 1
27 43 6 3 -1
28 44 5 2.5 -1
29 45 4 2 -1
30 46 3 1.5 -1
31 47 2 1 -1
32 48 1 .5 -1
From the table (2) above, although the known factor(M).Such regularity could be illustrated by plotting
randomness property of the square modular function, there is graphs (figure 4-5) below:
a striking regularity represented by the normalized modular
Fig 4: Line Chart of the Normalized Modular Factor (M) - Equation (13)
Fig 5: Column Chart of the Normalized Modular Factor (M) - Equation (13)
From figure (4) above, it is notified that the pulse width direct, it is applicable for many applications such as codec,
is equal to the root of the lowest complete square. In addition cryptography and 3D graphic games. These are high tech
to that, the symbol of normalizing the ratio of the square fields in term of signal processing.
modular to the rational root modular could be simplified by
the follow definition: According to the results analyzing (part4) and the
previous background in signal processing, the analyzed
𝑀 characteristics of the studied algorithm is useful for the
1 𝑓𝑜𝑟 𝑠𝑞𝑢𝑎𝑟𝑒 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛 𝑙𝑜𝑤𝑒𝑟 𝑐𝑜𝑚𝑝𝑙𝑒𝑡𝑒 𝑠𝑞𝑢𝑎𝑟𝑒 following fields:
={ 0 𝑓𝑜𝑟 𝑎𝑛𝑦 𝑐𝑜𝑚𝑝𝑙𝑒𝑡𝑒 𝑠𝑞𝑢𝑎𝑟𝑒
−1 𝑓𝑜𝑟 𝑠𝑞𝑢𝑎𝑟𝑒 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛 𝑎𝑏𝑜𝑣𝑒 𝑐𝑜𝑚𝑝𝑙𝑒𝑡𝑒 𝑠𝑞𝑢𝑎𝑟𝑒 A. Randomness System Applications:
A.1 Although the randomness of the square modular, it
Analyzing figure (5), warped around any complete is notable that there is a striking regularity for the ratio of the
square there are equal a count of positive and negative rational root modular to the square modular and this
symbols equal to the root of that complete square. regularity schematic increase for the higher perfect squares as
shown in figure (5). This in turn, represent that the perfect
Notice: Implementing the methodology trick to squares space away for higher values. Considering the prime-
exponent higher than square, 3 ,4,5 does not work, need counting function 𝜋(𝑛) shown in the figure (6), It is
𝑟
further examine. That means such ( ) trapdoor does not work supersizing to figure out that there is a direct relationship
𝑛
with the exponential modular one-way algorithm higher than related to the growth rate of (M). This is something related to
2 as further it has been trayed. This enhances that the modular the prime number theorem. Furthermore, the prime number
square function as a special case of the modular exponent density (equation-14), has normal or gaussian probability
function. which in turn reflected to the rational part of the irrational
roots and hence the modular factor (M) around any perfect
V. IMPLEMENTATION AND PRACTICAL root shown in figure (5). [8]*
APPLICATIONS
𝜋(𝑥)
lim =1 (14)
𝑥→∞ 𝑥/log(𝑥)
Although it seems that the analysis of the above
algorithm done in the results analyzing section (4) simple and
perfect squares could be used also for smoothing the science in term of speed, it was easy practical way for
signal in similar way to Hann function. modular manual calculations analysis. From such analysis a
Using such codec for compression it is assumed to be normalized residue symbol M, similar Legendre, was
lossless compression which allows the data for further proposed as a trapdoor for the square modular calculation. By
processing including encryption or hashing. trial and error, such trapdoor does not work with higher
Such regularity characteristics applied for PCM from modular exponentiation. The characteristics shown by M
analogue to digital modulation such as that with a-law and propose different practical applications in cryptography,
𝜇-law with manipulated property of sampling rate and the codec systems and vectors normalization.
bit depth to represent each sample. In such coding the
complete square could be synchronized to Nyquist Newton approximation method is avoided in computer
frequency or (or folding frequency). Such characteristic science as it contains slow division operation. In contrast to
allows to have free of aliasing distortion samples. This that, for computation purposes, fast inverse square root was
could be clarified by transferring the time-based analyzed. Such method depends on a bit fiddling technique
algorithm to frequency based using Laplace by shifting rational part decimal followed by Newton
transformation. [9] iteration. There are many other algorithms could be used for
square modular such as Tonelli-Shanks and Cipolla’s
C. Vector Normalizing applications: algorithms. They were for quadratic residue (equation-11)
Vector normalizing is done by scaling the vector to the similar to square modular (equation-1)
magnitude such that:
The square root function analysis may play pivotal role
𝑉 = 𝑎𝑥 + 𝑏𝑦 + 𝑐𝑧 (15) in future with quantum computations. This is applied for the
quantum circuit gates and the quantum algorithms. This paper
2
Magnitude =|𝑉| = √𝑎2 + 𝑏 2 + 𝑐 2 (part-1), presented as a foundation of other two papers (part-
2 & part-3) dealing with cryptography and mathematical
𝑉 𝑎𝑥+𝑏𝑦+𝑐𝑧 conjectures.
Then normalized vector 𝑣 = |𝑉| = 2
√𝑎2 +𝑏 2 +𝑐 2
REFERENCES
That means multiplying the vector by the inverse square
1 [1]. Prof . Dr. Rolf Oppliger,Contemporary to
root ( 2 2 2 2 )
√𝑎 +𝑏 +𝑐 Cryptography,Infogaurd,Bar Switzerland ,2013
[2]. W. Diffie and M. Hellman”New Direction in
As a result of above, the square root algorithm in inverse Cryptography”,IEEE Trans, 1976
form is used for vector normalization. There is a c-code [3]. Center for education in mathematics and computing,
algorithm (Appendix [1]) called Fast Inverse Square Root Grade 6 Math Circles -Modular Arithmetic,University
algorithm referred as Fast InvSqrt (). It depends in the bit- of Waterloo,2020
fiddling techniques followed by Newton iterations, as it has [4]. Catalano,Fiore,Rosario,Vamvourellis,Algebraic
been done above in the methodology section. It was used by (Trapdoor) One-Way Functions and their
3dfx Interactive. In 2005, it become famous algorithm in the Applications, University of Catania
world of games as it is used by Id Software. This is because [5]. Evan Huynh,Rabin’s Cryptosystem, Department of
it was mysterious algorithm for the programmers as it Mathematics, Linnaeus University, Sweden 2021
depends on bits hacking playing with the rational part [6]. Anca-Maria Nica ,Quadratic Residues and
decimal, something similar to what have been done above in Applications in Cryptography, Alexandru Ioan Cuza
the methodology. The magic of such popularity was with the Universithy of Iasi, 2020
Magic number (0𝑥5𝐹3759𝐷𝐹) that use to minimize the [7]. Pranav Gokhale ,Implementation of Square Root
approximation error and not known precisely how it was Function Using Quantum Circuits, Princton
determined. It was derived through trial and error. University Class, 2015.
[8]. F.B. Roodenburg,Riemann’s Explicit Formula and the
Because of its speed the algorithm was used in graphics Prime Number Theorem, Delft Institute of Applied
of video games to normalize the surface for lightening and Mathmatics, 2020
shading calculations. Such algorithm can work as a hint to use [9]. Dushyant,Patrick,Nikolay, Non Intrusive Codec
the above result analysis for vector normalization. [10] Identification Algorithm ,Marsh 2012
[10]. Andrei Seymour-Howell,Fast inverse square-root
VI. CONCLUSION program,2021
In conclusion, throughout this paper one-way modular
square function was analyzed. This function is a special case
of modular exponentiation, which built the infrastructure of
public-key cryptography. Square root function was first
milestone in such analyzation. Integer factorization method
was used throughout Newton Raphson approximation
method. Although such method is not practical for computer
APPENDIX
Quote…
“If you couldn’t can’t explain it simply, you don’t understand it well enough “Albert Einstein…