Mathematically Based Assessment of the Accuracy of Protection of Cardiac Data Realized with the Help of Cryptography and Steganography

: This paper describes the application of cryptography and steganography in the protection of cardiac databases. The original cardiac data studied were transformed using a Daubechies wavelet transform. The next step is to conduct Energy Packing Efﬁciency-based compression. A watermark is added to the received data to protect against unauthorized access, before hybrid cryptography is performed using a suitably selected encryption algorithm. The presented and analyzed algorithm includes protection using public and symmetric key cryptography. The proposed software algorithm is performed on real electrocardiographic, photoplethysmographic, and Holter cardio data. We have evaluated the effectiveness of the applied approach and concluded that a sufﬁcient level of protection of the studied data has been achieved, with methods of authentication and accuracy applied to the users.


Introduction
Ensuring the protection and security of several real signals used in people's daily lives from malicious interference, unauthorized access, forgery, and severe attacks is possible today thanks to the creation of mathematically based software solutions. Cryptography [1] is a basic mathematical method for providing confidentiality (directly related to the protection of individuals' personal data) and the authentication of data and objects, as well as non-repudiation. Today, telemedicine, based on the latest advances in information and communication technologies, offers the opportunity for the remote continuous monitoring of patients, during which they perform their daily activities. Healthcare services are increasingly being used to ensure that health care is provided to each individual according to his or her needs, anytime, anywhere in the world. This enables each person to be part of their usual social community, while at the same time providing them with appropriate medical supervision and, if necessary, contact with their healthcare provider. Such an approach enables doctors to care for a larger number of patients while consuming fewer resources and providing appropriate health care at the right time. The security of data must be ensured when transmitting recorded medical information and personal data. The use of encryption technology is one of the most effective ways to maintain the security of biomedical signals. For this reason, issues related to authentication and confidentiality are at stake in telemedicine, ensuring that only authorized users should have access to patients' medical and personal data. At the same time, the quality of the original signals must be preserved to the extent necessary so as not to impair the data's diagnostic properties. In the implementation of information systems in health care, it is necessary to ensure reliability, safety, and security.

Background
The choice of certain encryption algorithms is determined by their application and the goals that are set. When implementing protection through an encryption procedure with a public asymmetric key, the mathematical method of the Rivest-Shamir-Adleman algorithm (RSA) is very often used [4]. This method remains highly valued to this day and is often used to ensure the encryption and integrity of the transmitted information, and verification of the originality of the data. Implementation of RSA keys to prevent cryptographic attacks when using smart cards on multiple devices is discussed in [5]. In [6], Michael Wiener analyzes a cryptanalytic attack on the use of short RSA secret exponents. The presented algorithm is based on continuous fractions and seeks to find sufficiently short secret exponents in polynomial time. When the secret degree increases in size beyond a certain maximum, the time required to find the secret exponent increases rapidly (exponentially). The decomposition of prime numbers has been the subject of much research looking for fast and simple techniques [7,8], including the creation of polynomials generating sums of squares with a targeted application in cryptography [9,10]. The authors of [11] propose a new method for realizing a semisimple factorization based on the properties of Pythagorean triplets, proposing a new mathematical model based on the binary approach for the greatest common divisor with simple arithmetic operations to find the sum of two squares of one or both prime factors.
Another commonly used mathematical method for the encryption process is elliptic curve cryptography, an approach to provide public key encryption that is based on the algebraic structure of elliptic curves on finite fields [12]. Security encryption systems based on public key cryptography, such as RSA systems, use semiprime factorization [11], an important numerical method. Elliptic curve cryptography uses smaller-length keys to implement the same level of security as the RSA algorithm [13].
The authors of [14] present a new cryptographic algorithm with a public key, using a matrix model to improve the efficiency and speed of encryption. The authors include several unknown quantities and one additional sub-equation during the encrypting process. The execution time of the algorithm proposed by the authors was found to be faster when compared with the RSA and elliptic curve cryptography algorithms.
The use of cryptography in biomedical applications is a popular and well-functioning method for ensuring the confidentiality of medical research and the personal data of individuals. A symmetric encryption algorithm [15] based on the double chaotic layer encryption method was proposed and tested on electroencephalograms. This algorithm's intended usage is electroencephalograms, electrocardiograms, and blood pressure data and it is oriented for telemedical applications. The data used in the research were taken from the public database of PhysioBank [16].
The authors of [17] propose the use of the RSA algorithm in medical imaging, using watermark and Discrete Wavelet Transform of Daubechies with two coefficients (Db2) and two levels of decomposition. The proposed watermark procedure (the watermark is encrypted with a key generated by the RSA algorithm) was tested on three types of images (MRI, CT, and US). The proposed scheme shows a good degree of protection against alleged attacks before transmitting medical images through communication channels.
In [18], the authors explore the issue of maintaining the integrity and confidentiality of patient's medical information when transmitted wirelessly, via Wireless Body Area Networks (BANs).
A 128-bit secret key generation using an electrocardiographic (ECG) signal to protect communications via wireless BANs is proposed by the authors of [19]. The paper presents a scheme for creating the secret key, which uses the parameters of the patient's ECG signal. The obtained results show the effectiveness of this solution for generating a unique key and a key agreement for the protection of transmitted information.

The Purpose of This Article
The purpose of this article is to present a method for the application of cryptography to protect three types of cardio data: ECG, photoplethysmographic signal (PPG), and Holter. The encryption procedure is performed after compression of the studied data and performing a wavelet transform (WT) on the resulting sequence. The proposed encryption procedure aims to offer good protection of the three types of cardio signals when creating an archive of the used ECG, PPG, and Holter records, obtained in the study of cardio records from patients with various cardiovascular diseases and a healthy control group. The created algorithm is implemented in software in a Microsoft Visual C++ programming environment as a standard software application. Mathematical analyses of the conducted researches have been made and evaluation characteristics have been determined.
This study analyzes the effectiveness of the individual steps in implementing the applied cardio data protection procedure (using parameters to evaluate the effectiveness of the algorithms used in the procedure) and to compare the values of the parameters of the output signal with those of the input signal for all three types of cardio data.
Another research task of the article is to make an analysis of the influence of the length of the watermark, the choice of specific wavelet basis (Haar, Db4, Db8, Db12, and Db16 wavelet basis were studied), and the choice of method for processing threshold coefficients on the estimating parameters of the output-transformed cardio signal. The results of the research are presented parametrically and graphically.
The rest of this paper is organized as follows. Section 2 presents the technology used in this study and the proposed method for protecting cardiac data from possible attacks and attempts at unauthorized access. Section 3 shows the results obtained by applying the described method on three types of cardio data and presents the comparative analyses. Finally, Sections 4 and 5 provide the final remarks in the form of discussion and conclusions, respectively.

Materials and Methods
Cryptography is a mathematically based technology that implements cryptographic algorithms, codes, and protocols to ensure the protection of information, data, messages, communications, and methods and tools for their implementation. Cryptographic software is an algorithm for encrypting, namely, converting original data and information into incomprehensible strings of characters (transmitted through communication channels) so that this form cannot be used by persons without authorized access [20]. The second stage (decryption) consists of the correct inverse transformation (through the application of mathematical functions and security parameters) of the encrypted data. On the other hand, cryptanalysis aims to compromise the security that is achieved through cryptography.
Another aspect of cryptography is the authentication [21] of the transmitted message to the two parties involved, the process-sender and recipient. This ensures the integrity of the transmitted message and its rejection/non-rejection.
Some of the parameters used in encryption, called keys, do not change over time. The cryptographic code used can be likened to a dictionary of correspondence of the entered meaning of the words used and can result in unreadable, or without logic or meaning expressions, data, and signs. Cryptographic protocols used in practice are rules and agreements of action for the practical implementation of cryptographic algorithms and codes. A practical cryptosystem consists of a cryptographic algorithm or code and a cryptographic protocol. Cryptographic methods and tools are sets of cryptographic mechanisms, the key elements of which are cryptographic algorithms [22], specifically responsible for the implementation of the necessary security and protection of information.

Cardio Data Protection Methods
Modern means of data protection are becoming more and more common due to the daily need to transmit medical records (ECG, PPG, blood pressure, etc.) through communication channels and ensure their integrity and resistance to various types of attacks. The advantage of protecting cardio signals is that they are relatively less susceptible to fraud due to their unique nature. On the other hand, ECG and PPG sensors generate a constantly large number of reports that need to be processed in real time.
Electrocardiography and photoplethysmography are modern non-challenging tools for studying the health status of subjects, providing information about the state of the cardiovascular system, the activity of the autonomic nervous system, and others. This paper presents the results attached to three types of cardio data: PPG ( Figure 1), ECG ( Figure 2), and Holter records. The waveform of the cardio signal recorded by a Holter device is identical to that of the ECG signals recorded with an electrocardiograph; the difference is that the Holter device is designed to record continuous ECG data (24 h, 72 h, and more) All data on which the tests are applied are obtained cardio records, which is especially important for the reality of the results. Preliminary processing was applied to the three types of study data, which includes the reduction of interference [23], detection of the maximum deviations in the signals (QRS complexes are Q, R, S-characteristic points in the ECG signal, with a maximum deviation of the amplitude at the R point [24]), and localization of the P peak at the PPG signal.
Another aspect of cryptography is the authentication [21] of the transmitted message to the two parties involved, the process-sender and recipient. This ensures the integrity of the transmitted message and its rejection/non-rejection.
Some of the parameters used in encryption, called keys, do not change over time. The cryptographic code used can be likened to a dictionary of correspondence of the entered meaning of the words used and can result in unreadable, or without logic or meaning expressions, data, and signs. Cryptographic protocols used in practice are rules and agreements of action for the practical implementation of cryptographic algorithms and codes. A practical cryptosystem consists of a cryptographic algorithm or code and a cryptographic protocol. Cryptographic methods and tools are sets of cryptographic mechanisms, the key elements of which are cryptographic algorithms [22], specifically responsible for the implementation of the necessary security and protection of information.

Cardio Data Protection Methods
Modern means of data protection are becoming more and more common due to the daily need to transmit medical records (ECG, PPG, blood pressure, etc.) through communication channels and ensure their integrity and resistance to various types of attacks. The advantage of protecting cardio signals is that they are relatively less susceptible to fraud due to their unique nature. On the other hand, ECG and PPG sensors generate a constantly large number of reports that need to be processed in real time.
Electrocardiography and photoplethysmography are modern non-challenging tools for studying the health status of subjects, providing information about the state of the cardiovascular system, the activity of the autonomic nervous system, and others. This paper presents the results attached to three types of cardio data: PPG ( Figure 1), ECG ( Figure  2), and Holter records. The waveform of the cardio signal recorded by a Holter device is identical to that of the ECG signals recorded with an electrocardiograph; the difference is that the Holter device is designed to record continuous ECG data (24 h, 72 h, and more) All data on which the tests are applied are obtained cardio records, which is especially important for the reality of the results. Preliminary processing was applied to the three types of study data, which includes the reduction of interference [23], detection of the maximum deviations in the signals (QRS complexes are Q, R, S-characteristic points in the ECG signal, with a maximum deviation of the amplitude at the R point [24]), and localization of the P peak at the PPG signal.

Cardio Data Protection Procedure
The cardio data protection mathematically based method proposed and researched in this paper ( Figure 3) consists of the following steps: • Applying the Discrete Wavelet Transform with Daubechies basis with four coefficients to the studied cardio data;

Cardio Data Protection Procedure
The cardio data protection mathematically based method proposed and researched in this paper ( Figure 3) consists of the following steps:

•
Applying the Discrete Wavelet Transform with Daubechies basis with four coefficients to the studied cardio data; • Application of optimized Energy Packing Efficiency-based compression of the obtained sequence; • Watermark embedding in the reduced WT coefficients; • Encryption procedure using a hybrid cryptography algorithm; • Applying the Inverse Discrete Wavelet Transform of the obtained sequence; • Determination of the studied parameters for evaluation of the used algorithms.

Cardio Data Protection Procedure
The cardio data protection mathematically based method proposed and rese in this paper ( Figure 3) consists of the following steps: • Applying the Discrete Wavelet Transform with Daubechies basis with four cients to the studied cardio data; • Application of optimized Energy Packing Efficiency-based compression of t tained sequence; • Watermark embedding in the reduced WT coefficients; • Encryption procedure using a hybrid cryptography algorithm; • Applying the Inverse Discrete Wavelet Transform of the obtained sequence; • Determination of the studied parameters for evaluation of the used algorithm  Discrete Wavelet Transform, based on the concept of Multi-Resolution Analysis, can be applied to each signal examined. The studied input (ECG, PPG, Holter) signal can be represented by a wavelet function ϕ i, j and scaling function ψ i,n [25]: (1) In the implementation of the wavelet transform, the digital signal x(t) ∈ L 2 (R) is represented as the sum of orthogonal scaling functions and wavelets collection of details and a low-resolution approximation [26]: In this paper, Daubechies wavelet transform is implemented. Wavelet transforms are suitable for studying the properties of cardio signals (which are non-stationary and dynamic in nature) because in their application they provide information about the signal in both the frequency and time domains. The classical Fourier transform provides good information about the frequency distribution of the signal but does not provide information about the exact moment at which a frequency component appears. The Daubechies discrete WT used in this study has a compactly maintained orthonormal basis. A Daubechies transform with four wavelet coefficients (Db4) and four levels of decomposition is chosen.

Compression
The next step in the cardio data encryption procedure involves the application of optimized compression based on the Energy Packing Efficiency (EPE) method [27]. The chosen method of compression requires preliminary data processing (normalization of the studied sequence is carried out): first by amplitude and then by period. After this input processing, the EPE-based threshold processing itself takes place. At each subsequent level i of the wave decomposition of the data, the corresponding signal energy is calculated, using the current values of the detailed coefficients D(i, j), total K for the respective level: Compression based on the Energy Packaging Efficiency processing method reduces any excess information in the signal (but it does not remove the diagnostic properties of the signal) when processing the signal threshold, setting a zero value of insignificant wavelet coefficients (their presence in the studied sequence does not significantly affect the significance of the signal).

Digital Watermarking
The incorporation of a watermark in cardiac signals and data, as well as in the header of the compact record in which personal information about a particular patient is transmitted, is used to protect the continuity of personal data and the medical research of individuals. Cardio signals must be stored and transmitted with sufficient accuracy to ensure that their most important property, namely their ability to carry diagnostic information, is preserved. To this end, it is important to preserve them without changing the form of the basic waveforms of the cardio signals, which must not be influenced by the embedded watermark. Digital encryption of watermarks by quantizing cardiac data was used in this work.

Embedding
In this work, the watermark is embedded in cardiac data after a Db4 wavelet transform with four levels of decomposition. The watermark (sequence Mr) was embedded in the lowest frequency, to ensure its resilience to attacks. The sequence Mr with cardio data information {cd i } is added to coefficient c i whereby the transformed coefficient c i is obtained at the lowest fourth decomposition level by the formula [28]: Extraction Extraction is implemented through this rule, where c * i is the WT coefficient of the lowest-frequency sub-band and cd * i is the embedded watermark sequence [28]: This presented embedding/extraction method is stable and resistant to compression, filtration, and geometric transformations.

Encryption
In this work for the encryption of cardio records (ECG, Holter, PPG), the cryptographic hybrid algorithm is applied and analyzed. The presented hybrid crypto algorithm used two keys: a public key and a private key. The algorithm uses the RSA algorithm to encrypt the public key, with most of the work on encrypting/decrypting cardio records performed through a more efficient AES algorithm using a symmetric key.
RSA was one of the first public-key cryptosystems, being first published in 1977. Created as a revolutionary technology for encryption and decryption, RSA is able to provide sufficient security for data and today's information systems. RSA technology is based on an encryption procedure using a public key; authentication of the sender with a digital signature. The technology is difficult to break because it is based on decomposing numbers that have a very high total number of digits (for example, 200 or more) into prime factors. The technology provides a method for generating through simple calculations of two prime numbers and also generates through calculations and two keys needed for the process of transmitting information. Bit multiplication and modular multiplication are the simple arithmetic operations on which the algorithm is based. The data is initially divided into segments in order to implement the process of their encryption.
Applied algorithm implementation steps for key generation: • Software generation of two large prime numbers (d and z, so d = z); • The remainder of the product of the public key and private key determination (p = d * z); • Euler's totient function determination according to the formula: • Software integer (k) generation, with the integer within the range (1, ϕ(p)), where k and ϕ(p) are relatively prime; • For decryption purposes, the number q is calculated, so q = k −1 mod ϕ(p); • The public key (k, p) used in encryption algorithm determination; • The private key (q) formation.
Advantage of RSA algorithm: The issue of key sharing as an asymmetric key pair (public and private key) is easy to solve.
Disadvantages of RSA algorithm: The implementation of the algorithm requires a lot of buffer memory, so it is not suitable for encrypting medical data such as ECG, PPG, or Holter cardio records, as they generate a large number of values per unit of time. It is slow and insufficiently resistant to attacks.
The AES algorithm (the Rijndael algorithm) is a symmetric encryption algorithm having the same encryption/decryption keys with a length of 128, 192, or 256 bits according to AES technology.
The AES algorithm has four stages: 1.
Key Expansions-during this first step in the algorithm, the creation of round keys from the cipher key are performed; 2.
Initial Round during which the process of adding the round keys are made-each byte of the state is bitwise XOR-ed using this received round key; 3.
Rounds includes the following steps: • The non-linear substitution procedure (each byte is replaced by another according to a rule set in tabular form); • Transposition (of the last three rows) of the state is performed cyclically, according to a certain number of steps; • The mixing operation procedure is performed by multiplying (each state column with a polynomial expression); • In this step, the added round key is the initial round key.

4.
Final Round: Sub-Bytes, Shift-Rows, and finally the implementation of Round-Key.
Advantages of AES: Fast and suitable for encrypting large data, such as medical cardio signals. It can easily maintain a large key size and is less open to attack.
Disadvantages of AES: The implementation of key exchange can be a problem, as the same key is used for encryption/decryption, while there is no good resistance to interpolation attacks.
In the implementation of the presented procedure, we used 12 rounds for a 192-bit key.

The Cardio Database Used for the Study
The encryption algorithm was applied based on real cardio data ECG and FIG signals, obtained using a specially designed PPG device by the authors, allowing for the simultaneous recording of two PPG signals and one ECG signal. In parallel, a Holter recording was made, using a Holter monitoring device placed on the studied individual. Holter can continuously record cardiac data for up to 72 h. This study involved the three types of cardio recordings performed simultaneously with a duration of 2 h, with the same sampling rate. A parallel recording of 24 separate triples of signals (ECG, PPG, Holter) was made, and each received triplet of signals was analyzed to match its main parameters relevant to the diagnostic process (detection of maximum amplitude deviations, formation of time series constituting the intervals of successive heartbeats, etc.).

Evaluation of Presented Algorithms
An assessment of the presented data protection procedure was made in the paper. The evaluation of the algorithms involved in the procedure was made by calculating appropriate parameters for the evaluation of cardio data: 1.
The Euclidean error-distance parameter (Percentage Residual Difference) accurately estimates the distortion in the decrypted data relative to the initial cardio input data [29]: where: x ori is the original initial cardio signal, x tr is the converted cardio signal, L is the length of the investigated signal. The parameter Signal to Noise Ratio (SNR) is: 3. The parameter Peak Signal to Noise Ratio (PSNR) is the ratio of the maximum value of the converted cardio signal to the mean squared deviation of the original, initial cardio signal (where max is the maximum value from the original ECG signal) [30]: 4. The parameter Mean Square Error (MSE) is used to quantify the reconstruction error [31]:
The parameter evaluating the relative entropy Kullback-Leibler divergence (KLD) [34] is: KLD(p or , p tr ) = p or (x)log p tr (x) p or (x) dx.

Evaluation of Compressed Algorithm
The Energy Packing Efficiency-based compressed algorithm used in this paper was assessed by the Euclidean error-distance parameter and compression ratio, determined by the formula [29]: where: NS in is the length of the initial cardio signal, NS out is the length of the output cardio signal.
Estimates were made using the parameters of PRD and compression ratio on the three types of examined cardio signals. The tables below (Tables 1-3) show the obtained parameters for the EPE-based method of reduction of the WT coefficients for the studied ECG, Holter, and PPG signals. The results are shown for the tests performed on the three types of signals (ECG, Table 1; Holter, Table 2; PPG, Table 3). The compression ratio, according to the studies conducted based on 24 triples, simultaneously recorded different ECG, Holter, and PPG signals, ranging from 3.87 (for PPG) to 5.07 (for Holter). Increasing the degree of data compression resulted in an increase in the PRD parameter, which indicates that there are changes in the data compared to the original input data. The advantage of cardio signals is that they are recorded with many reports per unit time and contain a lot of redundant information that can be compressed without a significant loss of information. On the other hand, it is extremely important to preserve the shapes and amplitudes of the main waves in the signal that carry diagnostic information. An appropriate ratio between PRD and CR can be selected for each specific application, with the main goal being to preserve the diagnostic properties of the compressed cardio signal. Studies on the size of the block, into which the time cardio series is divided in order to perform compression, show an increase in the compression ratio with increasing block length. The parameter prd, measuring the quality of the received signal and its similarity to the original signal, also reduces some of the increase, which is not essential. The EPE-based algorithm has the ability to control the compression ratio according to the needs of different cardiac applications. The results presented below were obtained by establishing EPE values equal to 0.99% for all levels of decomposition. The EPE-based algorithm has the ability to control the compression ratio according to the needs of different cardiac applications. The results presented below were obtained by establishing EPE values equal to 0.99% for all levels of decomposition.

Evaluation of Watermarked Algorithm
The evaluation of the procedure for embedding the watermark is performed on the obtained cardio data sequence from the previously performed steps: compression and watermarked WT cardio coefficients. The evaluation parameters are PRD and PSNR. The obtained values of these parameters for PPG signals are shown in Table 4. At higher values of the PSNR indicator, the transformations performed on the studied signals have a higher quality.

Evaluation of Encryption Algorithm
The evaluation of the encryption procedure is based on the transformation of PPG signals, with the calculated values shown in Table 5. The table shows the determined values of PRD and SNR for 12 PPG signals before encryption and after decryption. The calculated values can be used to estimate the magnitude of the differences between the values of the studied signals. The studied parameters show that there are no large differences between the original and the decrypted signals, and therefore the considered procedures are suitable for application in cardiac information, as they retain their diagnostic capabilities. The Signal to Ratio varies from 31.83 to 46.37, which are good parameter values showing a sufficient degree of preservation of the quality of the converted signal.

Evaluation of Proposed Cardio Data Protection Procedure
An evaluation of the proposed procedure for encryption of cardio signals in the implementation of different lengths of the built-in watermark has been made ( Table 6). The results were obtained by applying the procedure on the PPG data. The parameters in Table 7 were obtained from evaluating 24 PPG signals (each signal represented 2 h of recording). The results in Table 7 show a high degree of compression when using the Haar transformation, but worsened values for the other estimation parameters. The application of the Db4 transformation in the implementation of the presented method proved to be the most optimal in terms of the obtained values of the studied parameters (almost the same results are obtained with Db8). The application of Daubechies wavelet transform with more coefficients than eight leads to a deterioration of the studied parameters. The dependence of MSE on the selected algorithm of threshold processing of the coefficients in the compression step of the proposed method was studied. The initial ECG data examined are shown in Figure 4, while Figure 5 shows a graph of the reconstructed data.
Mathematics 2022, 10, x FOR PEER REVIEW 1 data examined are shown in Figure 4, while Figure 5 shows a graph of the reconstru data.     Figure 4). The calculations were performed on the basis of the initial inpu ECG signal and the received output ECG signal. The research aims to demonstrate bot the values of the obtained MSE between the input and output signal and the difference in the MSE (graphically represented) using the amplitude method of reduction of the co efficients ( Figure 6) and the EPE method ( Figure 7). The comparison between the tw graphs shows significantly lower MSE values when using the EPE method.  It is worth discussing the analysis of the PRD parameter for different methods o threshold processing. Figure 8 shows a graph of the dependence of the PRD paramete (determined in the output-transformed signal) and the compression ratio when using th amplitude method of threshold processing. The graphs show a significant increase in PRD  Figure 4). The calculations were performed on the basis of the initial input ECG signal and the received output ECG signal. The research aims to demonstrate both the values of the obtained MSE between the input and output signal and the differences in the MSE (graphically represented) using the amplitude method of reduction of the coefficients ( Figure 6) and the EPE method ( Figure 7). The comparison between the two graphs shows significantly lower MSE values when using the EPE method.   Figure 4). The calculations were performed on the basis of the initial input ECG signal and the received output ECG signal. The research aims to demonstrate both the values of the obtained MSE between the input and output signal and the differences in the MSE (graphically represented) using the amplitude method of reduction of the coefficients ( Figure 6) and the EPE method ( Figure 7). The comparison between the two graphs shows significantly lower MSE values when using the EPE method.  It is worth discussing the analysis of the PRD parameter for different methods of threshold processing. Figure 8 shows a graph of the dependence of the PRD parameter (determined in the output-transformed signal) and the compression ratio when using the amplitude method of threshold processing. The graphs show a significant increase in PRD    Figure 4). The calculations were performed on the basis of the initial input ECG signal and the received output ECG signal. The research aims to demonstrate both the values of the obtained MSE between the input and output signal and the differences in the MSE (graphically represented) using the amplitude method of reduction of the coefficients ( Figure 6) and the EPE method ( Figure 7). The comparison between the two graphs shows significantly lower MSE values when using the EPE method.  It is worth discussing the analysis of the PRD parameter for different methods of threshold processing. Figure 8 shows a graph of the dependence of the PRD parameter (determined in the output-transformed signal) and the compression ratio when using the amplitude method of threshold processing. The graphs show a significant increase in PRD It is worth discussing the analysis of the PRD parameter for different methods of threshold processing. Figure 8 shows a graph of the dependence of the PRD parameter (determined in the output-transformed signal) and the compression ratio when using the amplitude method of threshold processing. The graphs show a significant increase in PRD at compression ratios greater than 5, leading to distortions in the values of the reconstructed cardio data (PPG, ECG, and Holter). In threshold processing using the EPE-based method, the PRD values were significantly lower (Figure 9), which is an indication of a better identity of the reconstructed data compared to the input. This allows for the realization of high degrees of compression in the implementation of the cardio data protection procedure, with the achievement of good identity between the submitted and received cardio data. method, the PRD values were significantly lower (Figure 9), which better identity of the reconstructed data compared to the input. Thi zation of high degrees of compression in the implementation of the c procedure, with the achievement of good identity between the sub cardio data.  Implementations of the cardio data protection procedure with ses affect the dependence of PRD on BER ( Figure 10). Using Db4 an ratios of the studied parameters were obtained. When using the wa Db16 with an increase in BER above 0.03, a significant increase in served. The results were obtained in studies on PPG. method, the PRD values were significantly lower (Figure 9), which better identity of the reconstructed data compared to the input. Thi zation of high degrees of compression in the implementation of the c procedure, with the achievement of good identity between the sub cardio data.  Implementations of the cardio data protection procedure with ses affect the dependence of PRD on BER ( Figure 10). Using Db4 an ratios of the studied parameters were obtained. When using the wa Db16 with an increase in BER above 0.03, a significant increase in served. The results were obtained in studies on PPG. Implementations of the cardio data protection procedure with different wavelet bases affect the dependence of PRD on BER ( Figure 10). Using Db4 and Db8, more optimal ratios of the studied parameters were obtained. When using the wavelet bases Db12 and Db16 with an increase in BER above 0.03, a significant increase in PRD values was observed. The results were obtained in studies on PPG. The results of the Signal to Noise ratio in the output cardio signal to the inp are shown in Figure 11. Daubechies wavelet realizations with four and eight co achieved a higher Signal to Noise ratio in the output signal compared to the inp studied. The results were obtained in studies on PPG. All results were obtained in research conducted through a software progra MATLAB environment and all showed the effectiveness, security, stability, and use of the proposed scheme in telemedicine.

Discussion
The authors are about to apply the proposed procedure for the protection data on a larger number of real cardio data (ECG, PPG, and Holter), which are still being collected and will be organized, stored, and protected. Access will b ized through an information platform in a database of cardio records. The appli the proposed procedure for the protection of cardio data will provide an oppor highlight all the strengths and possible weaknesses of the protection procedure. R PPG, and Holter records are currently being collected from patients with vario The results of the Signal to Noise ratio in the output cardio signal to the input signal are shown in Figure 11. Daubechies wavelet realizations with four and eight coefficients achieved a higher Signal to Noise ratio in the output signal compared to the input signal studied. The results were obtained in studies on PPG.
Mathematics 2022, 10, x FOR PEER REVIEW Figure 10. Dependence of the PRD coefficient on BER in the implementation of cardio da tion procedure with different wavelet basis.
The results of the Signal to Noise ratio in the output cardio signal to the inp are shown in Figure 11. Daubechies wavelet realizations with four and eight co achieved a higher Signal to Noise ratio in the output signal compared to the inp studied. The results were obtained in studies on PPG. All results were obtained in research conducted through a software progra MATLAB environment and all showed the effectiveness, security, stability, and use of the proposed scheme in telemedicine.

Discussion
The authors are about to apply the proposed procedure for the protection data on a larger number of real cardio data (ECG, PPG, and Holter), which are c still being collected and will be organized, stored, and protected. Access will be ized through an information platform in a database of cardio records. The appli the proposed procedure for the protection of cardio data will provide an oppor highlight all the strengths and possible weaknesses of the protection procedure. R PPG, and Holter records are currently being collected from patients with vario conditions and healthy volunteers. In some cardiac diseases, deviations from the All results were obtained in research conducted through a software program in the MATLAB environment and all showed the effectiveness, security, stability, and potential use of the proposed scheme in telemedicine.

Discussion
The authors are about to apply the proposed procedure for the protection of cardio data on a larger number of real cardio data (ECG, PPG, and Holter), which are currently still being collected and will be organized, stored, and protected. Access will be authorized through an information platform in a database of cardio records. The application of the proposed procedure for the protection of cardio data will provide an opportunity to highlight all the strengths and possible weaknesses of the protection procedure. Real ECG, PPG, and Holter records are currently being collected from patients with various heart conditions and healthy volunteers. In some cardiac diseases, deviations from the standard form of cardio signals are observed. Testing the proposed procedure with such data will allow for wider use of the discussed encryption method. The authors envisage the application and analysis of evaluation parameters in the application of other cryptographic methods of protection (e.g., adaptive Humming Bird method and others).

Conclusions
The purpose of cryptography is to protect data from unauthorized use. The cryptographic method offers a secure change of transmission data with different procedures; after acceptance in the opposite environment, the data is decrypted and restored to its original appearance. Cryptography can solve problems related to network data protection, as well as its successful implementation enabling the protection of applications and data on communication channels, cloud computing, etc.
This paper aims to provide an effective cryptographic solution that is sufficient to address issues related to the challenges of transmitting biomedical signals and data (providing protection, preserving the integrity of data, and the confidentiality of patients' personal information). The proposed protection procedure is applied to three types of cardio data: ECG, PPG, and Holter records. All tested signals are real and received with either a PPG device (ECG and PPG) or Holter, which are created or purchased under a research project "Investigation of the application of new mathematical methods for the analysis of cardiac data" in which the authors of the paper participated. The implementation of the proposed procedure is implemented in the Microsoft Visual C++ software application. All steps of the procedure have been studied: EPE-based compression algorithm, performing a wavelet transform based on Daubechies, embedding a watermark in the wavelet coefficients obtained at the lowest level of reconstruction, and hybrid algorithm encryption. From the study of algorithmic methods with evaluation parameters, it can be concluded that cardio data (ECG, PPG, and Holter records) that is decrypted and transformed with inverse wavelet transform retain their diagnostic characteristics, having sufficient accuracy compared to the original data.
The proposed encryption procedure achieves a good degree of compression, ranging from 3.87 (PPG) to 4.98 (Holter). The Signal to Noise Ratio was examined after applying the encryption algorithm step. The SNR values ranged from 31.83 to 46.37, which is an indicator of the quality of the transmitted signal having been retained.
The integrated mathematical approach proposed and researched can be used in the implementation of the protection of the information base from real ECG, PPG, and Holter cardio records, obtained during the authors' work on the research project. The protection of medical signals and patients' personal data can be applied in the transmission of information via communication channels between medical institutions in which records of cardio data are kept and the center for processing and storage of the cardio database.
The encryption procedure proposed in this paper will be applied specifically in creating protection for the three types of ECG, PPG, and Holter signals. It involved the implementation of an archive that was processed and tested using mathematical analysis cardio signals obtained in the study of patients with various cardiovascular diseases and a healthy control group.

Institutional Review Board Statement:
The study was conducted in accordance with the Declaration of Helsinki, and approved by the Research Ethics Committee at Medical University-Varna, Bulgaria., Protocol/Decision No. 82, 28 March 2019.
Informed Consent Statement: All participants were informed in advance of the research that would be done to them. Informed consent was obtained from all subjects involved in the study.

Data Availability Statement:
The cardio data we processed for the research purposes of this paper were obtained from the Medical University of Varna, Bulgaria (available on http://hrvdata.vtlab.eu/, accessed on 7 December 2018).

Conflicts of Interest:
All authors declare no conflict of interest.