Instant-Hybrid Neural-Cryptography (IHNC) based on fast machine learning

Nowadays, cryptographic systems’ designers are facing significant challenges in their designs. They have to constantly search for new ideas of fast unbreakable algorithms with a very powerful key generator. In this paper, we propose a novel hybrid neural-cryptography methodology. It depends on new rule of very fast Backpropagation (BP) instant machine learning (ML). This proposed Hybrid Cryptography system is constructed from Encryptor and Decryptor based on the asymmetric Autoencoder type. The Encryptor encrypts and compresses a set of data to be instant code (i-code) using public key. While the Decryptor recovers this i-code (ciphered-data) based on two keys together. The first is the private key and the other is called instant-key (i-key). This i-key is generated from 3 factors as well (the original data itself, the generated i-code and the private key). The i-key is changing periodically with every transformation of plain data set, so it is powerful unpredictable key against the brute force.


Introduction
Nowadays, information security has become a very important issue for governments, companies and even individuals. Therefore, cryptographic systems' designers must constantly search for up-to-date cryptography algorithms with higher efficiency to counter these potential threats.
Usually, any cryptographic security level depends on two major complicating factors. The first factor depends on the complexity of the selected Cryptographic Algorithm (CA) that responsible to convert plaintext to ciphertext, or vice versa. The second factor is the complexity of the secret key(s) generation. Both factors must be difficult enough that the information cannot be accessed or predicted easily.
There are two main types of CA. The first type is called Asymmetric Key Algorithm (AKA) or Public-key cryptography while the other is called Symmetric Key Algorithm (SKA).
Essentially, any security system are built on the basis of CA with its Cryptographic Keys (CK). These keys should be known only to the main users and hidden from others. Attackers often try to find, explore, extract, or even steal CK to recover hidden and confidential information. Significantly, as long as the CK is confidential, the information is safe.
In practice, keeping CK secret is one of the most difficult problems. Therefore, CK must be very complex (very long) to be retrieved. Thus, the CK are generated using powerful algorithms to ensure that each CK is unpredictable [1].
There is a direct proportion between the n-bits of CK and its security level. Oftentimes, n-bit security means that attackers have up to 2 n times to break it [2].
Towards more powerful CA and CK, designers thought to integrate and collect more than one CA (often AKA and SKA) in single algorithm called Hybrid cryptography technique. So, this combination of multiple encryption rules simultaneously takes advantage of their strengths. They collected as many strengths as possible. Besides, they also get rid of many weaknesses as possible.
& Assem Badr abmageed@eng.modern-academy.edu.eg Hybrid encryption is a unique technology that combines a strong algorithm (such as AKA encryption) with a low execution time (likes SKA encryption). It utilizes more than one key to perform its task, each key has long width (Larger number of bits) likes AKA. Moreover, it handles large amount of data simultaneously with highly speed of processing likes SKA.
The essential advantage of the hybrid encryption is that it generates a new encrypted key with each new transformation from plain to cipher data [3]. Frequently, this key is generated randomly by strong algorithms. According to this power and the constant changes of the generated key, hackers can't anticipate it. Therefore, this key is the second line of defense against hackers. Moreover, this generated key ensures stronger security during data transmission over the communication media, because this key is unpredictable.
Toward strongest hybrid cryptography, designers utilized neural network (NN) in the field of cryptography that called Neuro-Cryptography (or neural cryptography). This concept is now rapidly increasing. In the past two decades, many researchers already have collected and combined different NNs with various classical cryptographic paradigms [4]. The designers invented many complex neurocryptography rules [5][6][7]. They have created their CA by using different learning algorithms to generate strong keys [8][9][10][11][12].
As long as the NN architecture (within neural cryptography) is deeper, the generated keys are too complex to predict.
In recent years, machine learning (ML) techniques have become increasingly powerful in cryptography while processing more than 3 quintillion (3 followed by 18 zeros) of data-bytes around the world every day [13]. ML techniques can be used to obtain the relationship(s) between original data and its encrypted data within cryptographic systems. Also, it can be used to generate CK. Furthermore, ML is used to compress/decompress messages before they are encrypted/decrypted.
The concept of utilizing different machine learning (ML) in Neuro-Cryptography is growing rapidly. Various researchers have proposed many Neuro-Cryptography rules [14][15][16].
From literature survey, there is a lack of research on hybrid-type Neuro-Cryptography (particularly for autoencoders) using backpropagation ML. Therefore, this research proposes a novel hybrid neuro-cryptography rule with instant-changing key based on the fast BP ML paradigm called ''Instant Learning-Ratio Machine-Learning (ILRML)'' [17].
Due to the great dependence of the ILRML algorithm for our proposed Neuro-Cryptography design, we will dedicate a large space to it in this introduction section.
As its name implies, the ILRML is very fast BP supervised learning. It can update all the weights in the NN during a single iteration. So, it can be used to encrypt/ decrypt the original/ciphered data during the online communications. It relies on the learning ratio (Dl) rather than the learning rate (g). In spite the ILRML runs its forward propagation (FP) like any conventional ML rule, but it has a fundamental difference during BP. The Fig. 1 shows the concept of ILRML for one neuron.
For simple explanation of ILRML, we will firstly discuss the case of single neuron within a NN. The ILRML checks (each learning iteration) the difference between any instant output from neuron and its instant desired target (d).
If that difference is unacceptable (according to the required accuracy), then the ILRML enables intersections between the curve of this neuron's activation function and the constant function of d as shown in the Fig. 2.
The intersection may be one point (or two points due to the curvature of activation function). In our case, the constant function d ¼ 0:8 intersect with the functions (Linear, Sigmoid, Tanh and ReLU) at the points (2.0, 1.3863, 1.0986 and 0.8) respectively. These intersection points are called (post-intersection). It considered as instant updated pre-activation factor and symbolled by x new .
The ILRML divides the pre-activation factor x new (of the assigned function) over the old pre-activation factor (the old sum of product) x old to generate the instant learning ratio (D') of this neuron during that iteration.
The ILRML uses the factor D' to update the old values of the neuron's inputs and their weights by multipling them according to the next algorithms 1 and 2.
In fact, the factor x new can be determined (in the programming of this algorithm) from the inverse of the activation function (at the point d).
As we mentioned before, the ILRML differs in their BP. So, we will discuss two associated algorithms from BP point-of-view. The algorithm 1 explains the feed-backward during BP from a neuron (in any layer) to all neurons in the previous layer as demonstrated in Fig. 3 [17]. While the algorithm 2 illustrates the feed-backward from all neurons (of any layer) to one neuron in the previous layer as demonstrated in Fig. 4 [17].
The remaining relevant issues in this research will be organized in this way. In Sect. 2, the description of the basic architecture of the IHNC system and its general key   19953-19972 19955 formats besides its workflow. In Sect. 3, proposes an architecture of a lite-IHNC. It includes 2 sub-sections. The first for describing its Encryptor-unit and the second for its Decryptor-unit. The Sect. 4, includes proposal of a Deep-IHNC (to confirm our idea) as a case study with its results. Eventually, the conclusion and future hope.
Algorithm 1 The BP of the ILRML from a neuron to the previous layer.
Algorithm 2 The ILRML BP from all neurons of a layer to one of previous neuron.

The basic architecture of the IHNC
In this section, we will introduce general architecture of our proposed IHNC. Let's first discuss three major requirements for this design. The first requirement is to find a suitable structure of an Artificial Neural Network (ANN) that can be divided into 2 complementary sub-ANNs to perform two tasks (encryption task and decryption task).
The second requirement, the number of outputs (from the first divided sub-ANN) must equal the same number of inputs (to the second sub-ANN) to transfer the ciphereddata between them.
Third requirement, the selected ANN should have similar numbers of its inputs and outputs to recover the same encrypted (original) data.
According to the previous requirements, neural autoencoders are the best choice for our construction.
Therefore, we will utilize these two sub-ANNs (autoencoder stages) to carry out our idea as will be explained later on.
The main structure of the IHNC system should contain two units (Encryptor and Decryptor) as seen in the Fig. 5. The Encryptor-unit includes a fully autoencoder (Encoder and Decoder stages) while the Decryptor contains only its Decoder-stage.
All initial values of the Encoder-stage are considered as the public-key (green key) of the IHNC. Moreover, all the initial values of the decoder-stage (decoder1 or decoder2) are considered as the private key (yellow key) of the IHNC.
The Encryptor-unit carries out 2 tasks. The first task is relying on the FP by passing an instant sample of plain data (original data) through the initial weights (Public key) of encoder-stage only to generate an instant code (i-Code). This i-Code represents the instant ciphered data. Moreover, it can also call the compressed code according to the autoencoder. The second task (of the Encryptor) depends on the BP by passing the same sample of plain data through the initial weights (Private-key) of the Decoder1. This second task generates Learning ratios (as instant-key) from all neurons in this decoder. Both the generated instant-key (i-key) and instant-code (i-Code) are changing periodically with each new sample of plain-data to the Encryptor-unit.
Both i-key and i-code are sent to the Decryptor-unit (directly or through suitable communication media).
On the other hand, the Decryptor-unit includes only decoder-stage (Decoder2). It exactly similar to the Deco-der1 in the Encryptor-unit. The Decoder1 is loaded by the private key (initial values of its weight) and it receives both the i-Code and i-key to recover the instant original data.
As mentioned before, we have Public, Private and Instant keys. The Public and Private keys consist of all initial values of the weights within Encoder-stage and Decoder-stage respectively. While the i-key consists of all generated learning ratios (D') from Decoder1. Like any computer system, all weights values are represented by the Double-precision floating-point (Flot64) format to get high accuracy numbering during the FP and BP calculations through the neural autoencoder.
During the IHNC design, the designers are free to choose any number of neurons inside their autoencoders, and then any number of their weights. Therefore, the size of their keys can vary from one design to another (according the security level requirement). This gives flexibility in the designs because the size of their keys is not fixed like many recent encryption systems. let us give examples. If the public or private key contains only 10 weights, then the size of that key will be 640 bits while if it contains 1000 weights, then it will be 64,000 bits and so on.
Also, the instant key depends on the number of neurons (not the weights) inside the decoder1. For example, if it contains 100 neurons, the i-key size will be 6400 bits.
Further, IHNC designers are free to arrange those weights in concatenation form. For example, as shown in Fig. 6. Here the designer has arranged all the weights of the two keys (public and private) in a regular order. The designer started with the first weight of the first neuron of the Encoder-stage ''ðW init encr Þ j1;k1 '' and then the second weight of the same neuron ''ðW init encr Þ j1;k2 '' until he finishes all the weights of the first neuron. Then, he completes the rest of the weights in the same way. Also, he arranged all learning ratios from the first neuron ''ðD decr Þ 1;1 '' to the last one ''ðD decr Þ j;i '' inside the i-key.
Moreover, Fig. 6 shows the width of the instant plaindata (total number of either autoencoder inputs or output * 64 bits). Besides, it shows the width of the instant compressed data or i-code that will be transferred from the Encryptor to Decryptor (total number of either Decoderstage inputs or Encoder-stage outputs * 64 bits).
Furthermore, the designers are more free if they rely on the principle of Asymmetric Stacked Autoencoder (ASA) characteristics [21], they are free to choose how many layers will be inside the encoder-stage and the rest of the asymmetric-autoencoder layers to the decoder unit.
This methodology gives more flexibility to their designs because the same IHNC autoencoder can decrypt the same plain-data in many i-codes and i-keys at the same time. In addition, send them to several users (those have the compatible decoders) at once.
In this case, subscribers will receive the same information, but with different encrypted codes and instant keys. Therefore, they can retrieve the same original information with different keys those agreed between the sender and all the recipients.
For instance, assume IHNC application has an ASA with seven layers as seen in the Fig. 7. It can send three i-codes (i-code1, i-code2 and i-code3) for the same plain-data simultaneously from three encoders (Encoder-a, Encoder-b and Encoder-c) respectively. Now let's explain the whole operations of the IHNC system through two flowcharts. The first one for carrying out the encryption as demonstrated in the Fig. 8. In step-1, the user uploads the public-key (as initial weights) to the Encoder in the encryptor-unit.
Step-2, the user loads the private-key (initial weights) in the Decoder1 of the encryptor too. From Step-3 to step-5, the user loads his/her instant plain-data to the input of the encryptor-unit and run the FP to all neurons in the encoder. So they get the instant ciphered-data or instant-code (i-code) from the Encoderstage of the autoencoder. In step-6 and step-7, The user feeds backward the same samples of the instant inputs to the Decoder-stage (as desired target) and run the instant learning ratios BP to Decoder1 only. So the user get the instant-key (i-key) as the learning ratios (D') of all neurons within Decoder1. In the last step-8, both the i-key and i-code are sending to the decryptor-unit.
On the other side, another user receives both i-code and i-key to the compatible Decryptor (Decoder2) as step-9 and step-11 respectively in Fig. 9. Also the user loads the common private-key as step 10. In step-12 the Encryptorunit updates the received i-code and initial weights of Decoder using the received i-key. In the last 2 steps (13 and 14), the Decryptor run its FP to recover the instant originaldata as will be explained in the next section. In this section, we will discuss a simple structure of IHNC system called lite-IHNC. It operates depending on the ML algorithms of the instant D' that discussed in introductionsection. First, before we start diving into the details (formulas, algorithms, applications), we have to provide the Symbolkey for the next part of this research. Therefore, assume an ANN includes two subsequent layers ''j'' and layer ''k'' (k ¼ j þ 1) as seen in Fig. 10. Each layer has ''i''-number of neurons. The weights between them are labeled by two parameters. The First is the number of the source neuron and the other is the number of the destination neuron. For instance, ''W J1;ki '' indicates the weight between the first neuron of layer ''j'' and the ''i'' neuron in the destination layer ''k''. Moreover, the symbol D k8 indicates the learning ratio of eighth neuron in the layer ''k'' and so on. Now, all details of the lite-IHNC will be discussed in the next sub-sections.
All weights in that encoder-stage represents the publickey (with size 1024 bits) as shown in the upper segment of the Fig. 12 and step (1) of algorithm 3.
An instant data sample is delivered to the encoder inputs (p 1 : p 8 ) as step (3)

of algorithm (3).
The FP runs inside the Encryptor-unit to generate the icodes (C1 old and C2 old ) as step (4) of algorithm 3 and as illustrated in the formulas (2: 6). Moreover, it generates the sum-of-products that called ''Pre activation old '' (from decoder stage) as demonstrated in formula (7).
During the BP (for the decoder-stage only), the same data sample is delivered also to the decoder as desired target ''p i '' as step (5) of same algorithm 3. According to the instant-ML of the learning ratios (that introduced in introduction part), each desired target intersects with its corresponding neuron function-curve to produce new ''Pre activation new '' for each neuron ''i'' of the outputlayer ''op'' as formula (8 and 9).
These intersections are similar as carrying out the neuron inverse-function (as mentioned earlier in the formula (1) above in the introduction part).
Pre activation new ¼ Each new pre-activation }Pre activation Desired ðiÞ'' value will be divided over its corresponding old-activation value to produce its learning ratios(i) as formula (10) and step (6) of the same algorithm. In this case, all generated learning ratios (D 1 : D 8 ) will be considered as the generated i-key. Thus here, the i-key size is 8Ds Ã 64 bit ¼ 512 bits as illustrated in the Fig. 13.
These generated i-key and i-code will be transferred to the Decryptor-unit as step (7 and 8) of the same algorithm.
Algorithm 3 the encryption process of the lite-IHNC. Firstly, it updates the received i-codes (C1 old and C2 old ) according to the formula of the step (9) in the algorithm 2 to be (C1 new and C2 new ) as illustrated in the formulas (11 and 12) and step (5) of algorithm 4.
Secondly, all Decoder's weights are updated according to the formula in the step (8) in the algorithm 2. Here, only 2 formulas are written (W new C1;op1 and W new C2;op1 ) for the neuron-1as illustrated in the formulas (13 and 14) and step (4) of algorithm 4.
after that, the Decryptor unit needs only the FP to recover the original data from the Decoder2. One sample of this recovered data from the 1st neuron is demonstrated in formula (15).
From formula (10), will get the learning ratio (D 1 ) of the 1 st neuron as seen in the formula (18). And so on, for all rest neurons' outputs (OPi new ) as step (6) of algorithm 4.

Case study and results of a deep-IHNC
In last section, we introduced a lite IHNC to simplify our idea. But in this section will propose deeper one. As long as this proposed Deep-IHNC architecture is deeper, the i-codes and i-keys are too complex to crack. Further, its original data is too safe to be predictable. In this section, we will not mathematically analyze this application. Because it includes similar equations mentioned above albeit in a deeper way. But we will see its behaviors during encrypting a text as well as decryption process with 100% accuracy.
Therefore, we prepared more complex IHNC system depending on asymmetric autoencoder. All parameters in this application are declared with double precision data type (64 bits) to get high accuracy during its computation process.
The proposed Deep-IHNC supports task parallelism by handling 8 characters (via 8 inputs) simultaneously.
Its Encryptor-unit contains seven layers (L a ; L b ; L c ; L d ; L e ; L f and L g ) as shown in the Fig. 15. For more complexity in our design, the encoder-stage of the Encoder-unit is completely differing than its decoder-stage. The encoder-stage contains five layers (L a ; L b ; L c ; L d ; L e ), while its decoder contains 2 layers (L f ; L g ). Moreover, the encoder-stage has 8 inputs (p 1 : p 8 ) that divided into 2 groups (p 1 : p 4 ) and (p 5 : p 8 ). Each group is fully connected with 2 neuron (L a1 ; L a2 ) and (L a3 ; L a4 ) respectively through 8 weights for each group.
A different interface for the decoder-stage output is designed to give more asymmetry to the autoencoder. The 8 neurons ðop 1 : op 8 Þ of the output layer ''L f '' are fully connected with the 3 neurons in the layer ''L g '' via 24 weights.
The input-layer ''L a '' can accept 8 characters concurrently via its 8 inputs (p 1 : p 8 ). This total number of inputs can be exceeded or reduced depending on the designed system requirements. Each input accepts complete character in ASCII-code format.
We select the ReLU-type as activation function for all neurons in that system, because all inputs have ASCIIcodes with positive values greater than one.
Our scenario here, is encrypting a text of 80 characters as seen in the Fig. 16. The Decryptor is fed forward with sequential sets of characters (eight characters per encryption cycle). Therefore, the FP runs to generate the relevant i-codes as shown in the Fig. 17. The figure shows the changes of 10 i-codes during encryption operations for 10 sets of characters.
Further, the decoder-stage of the Encryptor is fed backward with the same characters sets (to be their desired targets) to the output layer ''L g ''. Thus, its BP ML is run to generate ten i-keys based on the previous formulas. Each ikey is represented by eleven learning ratios (D a : D g Þ andðD f 1 : D f 3 ) as demonstrated in Fig. 18. This figure displays sequence changes of 10 samples of i-keys during the BP.
Furthermore, after each encryption cycle, the Encryptorunit sends its generated i-key (designated for 8 characters) with its associated i-code to the Decryptor-unit.
On other hand, the Decryptor-unit is similar in its architecture to the decoder-stage in the Encryptor. It has 2 layers, input layer ''L p '' and output layer ''L q '' with fully connected weights as illustrated in the Fig. 19.
During each decryption cycle, the Decryptor is loaded with the same accepted private-key. It received ''i-code'' and ''i-key'', it performs four main tasks. In the first task, it uses the received i-key to update the received i-code as seen in the Fig. 20. It displays the received 10 samples of old i-codes and their updating (new) i-codes (within the Decryptor-unit) during 10 samples.
In the second task, the received i-key is also used to update all the initial weights (that loaded with private-key) inside the Decryptor as illustrated in the Fig. 21. It shows the old values of all weights (private keys) for all neurons (q 1 : q 8 ) in the layer ''L q '' along with their updating values during 10 sequential samples of decryptions.
In the third task, the Decryptor runs its FP to restore the original sets of characters. the Fig. 22 shows the recovered original characters across all outputs ''Out 1 : Out 8 '' from the eight neurons (q 1 : q 8 ) of layer ''L q ''. Eventually, in the fourth task, the Decryptor-unit collects all the character sets retrieved from all the outputs of the layer ''L q '' in the same sequence (as it encrypted) as shown in the Fig. 23. When we compare the input text to the output text, we find that they are exactly the same.
Eventually, there is a trade-off between building a more in-depth ANN versus its cost and speed of processing. many researchers recommend to implement their systems by using hardware description-language (like VHDL) over the FPGA [22][23][24][25][26][27].
The mentioned structures of the IHNC systems can be realized using software programs. However, to get more high speed of processing, hardware systems are recommended. In this case, the designers will face some challenges while writing the IHNC system by VHDL code. We can summarize these challenges in the following points: (1) A new datatype (according to Mantissa and Exponent rule) must be added (in VHDL code) to represent all parameters in Float64. (2) All IHNC parameters (plain data, weights, learning ratios, outputs…etc.) must be declared by this added Float64 datatype. Fig. 17 The generated i-codes (in our scenario) from the Deep-IHNC Fig. 18 The Changes of the i-key (10 data samples) in the Deep-IHNC Neural Computing and Applications (2022) 34:19953-19972 19967 (3) Three VHDL-functions based on Mantissa and Exponent rule must be written to carry out the following.
• Function1 to make multiplication of Float64 (to perform the products during FP). • Function2 to make summation of Float64 (to perform the sum of products during FP). • Function3 to make division of Float64 (to get the learning ratios D' during BP).

Conclusion and hope
In this research, we proposed a new methodology of Hybrid cryptography. It has been realized using the asymmetric autoencoder based on the new concept of machine learning called the instant learning ratio ''D'''. This Hybrid cryptography ''IHNC'' serves the task parallelism. It encrypts multiple data concurrently using Public-key and convert them to compressed instant-code (i-code). Further, it generates instant-key (every encryption process). Moreover, it uses the instant-code as well as the privatekey to recover the original data simultaneously.
The proposed hybrid neuro-cryptography does not belong to a specific architecture of neural autoencoder, so each cryptography designer can get creative with her/his design to get their complexity required. In the future, I hope to design and implement this Hybrid cryptographic system based on the VHDL and FPGA to make the encryption/decryption time within a few clocks for each data block.
Eventually, I hope to use this proposed Hybrid cryptographic rule in an application contains several end-to-end Encryptor/Decryptor units.

Declarations
Conflict of interest The authors whose names are listed immediately below certify that they have NO affiliations with or involvement in any organization or entity with any financial interest (such as honoraria; educational grants; participation in speaker's bureaus; membership, employment, consultancies, stock ownership, or other equity interest' and expert testimony or patent-licensing arrangements), or non-financial interest (such as personal or professional relationships, affiliations, knowledge or beliefs) in the subject matter or materials discussed in this manuscript.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons. org/licenses/by/4.0/.