Abstract
Bit-string generator (BSG) is based on the hardness of known number theoretical problems, such as the discrete logarithm problem with the elliptic curve (ECDLP). Such type of generators will have good randomness and unpredictability properties as it is challenged to find a solution regarding this mathematical dilemma. Hash functions in turn play a remarkable role in many cryptographic tasks to accomplish different security levels. Hash-enhanced elliptic curve bit-string generator (HEECBSG) mechanism is proposed in this study based on the ECDLP and secure hash function. The cryptographic hash function is used to achieve integrity and security of the obtained bit-strings for highly sensitive plain data. The main contribution of the proposed HEECBSG is transforming the x-coordinate of the elliptic curve points using a hash function H to generate bit-strings of any desirable length. The obtained pseudo-random bits are tested by the NIST test suite to analyze and verify its statistical and randomness properties. The resulted bit-string is utilized here for encrypting various medical images of the vital organs, i.e. the brain, bone, fetuses, and lungs. Then, extensive evaluation metrics have been applied to analyze the successful performance of the cipherimage, including key-space analysis, histogram analysis, correlation analysis, entropy analysis and sensitivity analysis. The results demonstrated that our proposed HEECBSG mechanism is feasible for achieving security and privacy purposes of the medical image transmission over unsecure communication networks.
Keywords
Introduction
A pseudo-random bit generator (PRBG) is an algorithm for producing a string of random bits to represent almost similar properties of bit-strings produced from a truly random bit generator. The obtained bit series from the PRBG is estimated by a comparative set of known initial values, called the PRBG’s
In 1985, elliptic curve cryptography (ECC) were introduced by Neal Koblitz [2] and Victor Miller [3]. By substituting the subgroup of the multiplicative group
Security schemes of medical imaging are needed to achieve high levels of protection to different attack modes without compromising the diagnostic quality of these images [6]. Changes made to the images during processing may lead to irreversible false diagnostic consequences [7]. Therefore, the algorithms of medical image encryption are not always suitable for certain types of images because of some intrinsic features including high redundancy, large data capacity and high neighboring pixels correlations [8]. Accordingly, EC-based encryption schemes have recently been widely suggested as presented in [9–11].
In this study, we propose a hash-enhanced elliptic curve bit-string generator (HEECBSG) method for generating strings of binary bits of any length quickly. The proposed HEECBSG is based on an elliptic curve points operations over finite fields (
The remainder of this article is divided into the following sections. The preliminaries of EC and cryptographic hash function are introduced in Section 2. In Section 3, the related work is presented. In Section 4, the HEECBSG mechanism is proposed. Experimental and NIST test results are given in Section 5. In Section 6, an encryption of medical images with various security analysis is discussed and finally conclusions are given in Section 7.
Preliminaries
This section presents a detailed description of EC over
Elliptic curves over
Consider an elliptic curve; namely E; over finite prime field
The addition operation of two elliptic curve points P and Q results a third point R on the same curve, using the chord-and-tangent rule. With this addition operation, the set of all points of

Description of two EC-points addition: P + Q = R.

Description of one EC-point doubling: P + P = 2P = R.
Consider the point P = (x1, y1), doubling of P point which is calculated via 2P = R = (x3, y3), is obtained as following. The tangent line with EC at point P is drawn firstly. The mentioned line is intersected with the EC itself in another point. As a result, the R point is considered as the reflection of this operation on the x-axis as shown in Figure 2. Sum of two points operation and also doubling of one point is deduced from algebraic description as the following: Note that P + O = O + P all of For point Addition of two points P = (x1, y1) and Q = (x2, y2) both belong to Doubling of point
EC-operation of the two points P and Q in
Recently, pseudo-random bit generators can be established based on a non-invertible or one-way hash function. To achieve different security levels, a suitable hash function is utilized, and sufficient entropy is gained for the seed value. In general, for any hash function H with X input data, the hash value h of X is defined by:
Calculation of H (X) is considered computationally fast operation and not possible to reverse the obtained hash value h, i.e. the hash function acts as one-way function [13]. The proposed HEECBSG method is flexible and designed to allow the use of any suitable secure hash function, as defined in Eq.(4).
EC-based generators have been widely applied in the authentication and encryption operations of medical images. Mustapha et al. [9] showed a comparative analysis between chaos and ECC-based encryption schemes. The comparison confirmed that both techniques have good security features. Yin et al. [10] analyzed the traditional ECC districts and modified them by combining the homomorphic encryption for the application of medical images. Their experimental results showed that the key space of the modified algorithm is improved with better encryption effect and higher key sensitivity. Singh et al. [11] achieved a new finding in the ElGamal encryption scheme, such that a separate computation is removed for encoding plain message to elliptic curve coordinate. The enhanced algorithm is designed to encrypt medical images where the problem of data expansion is solved, and the execution time is decreased. A hybrid, multi-layered EMOTE encryption system for managing medical images has been also suggested based on binary curves [14]. It is a stable machine-friendly binary system. Password authentication accompanied by multimodal biometric fusion using finger vein and finger knuckle to ensure the user security to access the database [15]. Additionally, authentication is reinforced by encrypting the fused image. Jinasena et al. [16] proposed a technique for implementing a dynamic and flexible access control mechanism to ensure the access rights of sensitive medical data in a collaborative mobile-based clinical discussion. A secure electronic medical record (EMR) service system, named the ECC-based secure EMR system is proposed by Tsai et al. in [17]. The system employs a smart card, a cloud database, an ECC integration unit, and portable devices to support users with a safe environment for EMR transmission. A secure scheme is designed based on Rives–Shami–Adleman (RSA) encryption and Shamir’s secret sharing schemes [18]. It can effectively ensure the data confidentiality and check the integrity of data. A new mathematical scheme is proposed in [19] to encrypt and decrypt grayscale and colored images. It combined the utilization of RSA algorithm elements and projective transformations. Two encryption algorithms are used item-by-element and two-elements. Reasonable results had been obtained in both cases. An implementation for encryption/decryption based on the RSA cryptosystem is tested on images in the medical field [20]. However, the RSA protocol software remains slow because the medical images are large, and the key sizes are within the range of (1024 - 2048) bits and tend to increase in the future. The proposed scheme in [21] presented the encryption and authentication of well-known format of medical images; called digital imaging and communications in medicine (DICOM) using RSA and advanced encryption standard (AES) algorithms. It showed that AES algorithm has more security capabilities than RSA algorithm, but the AES algorithm requires secure cipher key transmission. A new encryption-decryption approach for grayscale and color images was proposed using a simple RSA algorithm and additional use of binary bitwise operations [22].

HEECBSG generator mechanism.

HEECBSG backtracking resistance.
The ECDLP hardness based on a finite field is a major key to the security of all cryptographic elliptic curve schemes [23]. Therefore, the HEECBSG scheme is based mainly on the hardness of ECDLP. The problem assumed that for a given two points P and Q on an EC of order n, it is considered intractable to get a value such that Q = aP. The main steps of proposed HEECBSG are depicted in Figure 3.
The instantiation stage of the HEECBSG mechanism involves selecting a suitable EC and a secret point P on that curve for the desired level of security. The seed value is used to locate the initial value (s0) of the HEECBSG, including enough bits of entropy with adequate security length. In the initial state, the value of t is accounted for the seedlen-bit number, so let’s consider that t = s0 in that case. The HEECBSG offers security level according to the security strength of the desired used curve. The main key point for using the H hash function is to ensure that the entropy is distributed in the extracted bits if it is verifiably random. Backtracking resistance in this mechanism is deep-seated, even in the case that the internal state is vulnerable to exposure as shown in Figure 4.
The HEECBSG generates a seed value for each step as represented by Eqs.(1) and (2).
where
The HEECBSG generates pseudo-random bit-string through extracting bits from obtained hash values h. The internal state of the HEECBSG is a secret value s0 that represents the x-coordinate of a secret point P on the used EC. Output bits are produced by first computing s to be the x-coordinate of the point multiplication operation [s] P, and then extracting low order bits from the hashcode output h of the computed values of H (s).
The implementation of the HEECBSG mechanism should include an approved curve. Once the designer chooses the security level required by a given application, he can then start the implementation of an EC that most NIST SP 800-90A [1] appropriately meets this requirement.
Implementation example
The HEECBSG algorithm allows an exhaustion application to instantiate using a prime curve. In accordance security key strengths of 112, 128, 192 and 256-bits may then be required. In this experiment, the implementation process used the following EC equation:
Test results for 1048576 bit-strings

HEECBSG based image encryption schema.
The NIST [24] test suite is a statistical package that consisting of up to 15 tests. It is developed for testing the randomness of bit-strings obtained by either hardware or software based cryptographic pseudo-random and random bit generators. The 15 tests focused on a variety of different non-randomness types that could exist in bit-strings. The proposed mechanism produces a very random bit-strings as reflected by the high p-values of 1048576 bit-string length as shown in Table1.
Encryption and security analysis
The security of digital images need pseudo-random bit-string that have pretty good randomness properties and also high periodicity. Recently, several EC-based works for classical and medical images encryption have been presented in the literature such as [14, 26]. In this study, the obtained bit-string from the HEECBSG method is used as a key-stream for the encryption of five 256 × 256 grayscale medical images which are bone, brain, echo, front and top test images. For each pixel has a 8-bit value of between 0 and 255 of that images and each plainimage block is divided into 128-bit sub-blocks. Each sub-block is scrambled by bit-permutation operation to hide image pixels information with the encryption algorithm. The pseudo-random bit-string in turn divided into sub-blocks of 128-bit each. Next, bitwise XOR operation is carried on every bit of the 128-bit sub-blocks. The resulted bit blocks then grouped together to obtain the cipherimage, as shown in Figure 5. The decryption process is done vice-versa and the following security analysis is carried out.

Histogram of different medical images and the corresponding cipherimages with the HEECBSG mechanism.
The key space includes different keys that can participate in the encryption process. The key space is usually expected to be greater than 2100 as mentioned in [27]. The initial values of the HEECBSG proposed method are obtained by choosing a proved curve with a prime p of length at least 192-bit. In case of using hash function SHA-256 for integrity, the key space is equals to 2192 × 2256 = 2448. In this case, the total key space is greater than 2100, which is sufficient to withstand exhaustive attack.
Histogram analysis
The histograms for the five plain medical images and their corresponding cipherimages are estimated. All plain medical images histograms contain large spikes while the histogram of their corresponding cipherimages is almost flat and uniform as depicted in Figure 6. It denotes equal probability of occurrence of each pixel. Histogram of the cipherimages is remarkably different from the respective plainimages. Therefore, no evidence to classify established statistical attacks on the image encryption process is provided [28].
Entropy analysis
The entropy H (m) of a message source m is calculated from the equation:
where P (m k ) represents the probability of message m k [28]. The various entropy values for the five medical plainimages and the encrypted images (see Figure 6) are illustrated in Table 2. The entropy of the encrypted images is very closed to the theoretical value of 8. Obviously, all pixels in the encrypted five images occur with approximately equal probability. Therefore, the proposed HEECBSG is secure against the entropy-based attack and the information leakage is negligible.
Peak signal-to-noise ratio (PSNR) is mainly used in image processing area as a consistent image quality metric [29] and the greater PSNR, the better the output image quality as given by Eq.(9).
Entropy of five test medical images and their cipherimages
Evaluation metrics test results
NPCR and UACI test results
Correlation analysis test results for five medical images
Also, structural similarity (SSIM) measures the similarity between plainimages and cipherimages [30]. The SSIM is derived from Eq.(11):
The performance of the resulted encrypted images is estimated on the basis of PSNR and SSIM. Table 3 illustrates the obtained test values of these two measures. These values clearly showed that the HEECBSG mechanism is well suited for many types of image encryption operations.
The significant difference between the cipherimage and corresponding plainimage can be measured by mean absolute error (MAE) [28]. MAE values are calculated by using the following equation:
where parameters W and H are the width and height of the considered image. P ij and Ci,j are the gray level of the pixel in the plainimage and cipherimage, respectively. In Table 3, the MAE test demonstrated high values which then guarantee the resistance of the HEECBSG mechanism against differential attacks.

Correlation test of Bone, Brain, Echo and Front images and the cipherimages with the HEECBSG method.

Correlation test of Top image and its cipherimage with the HEECBSG method.
The correlation coefficient maximum value is 1 and the minimum value is 0 as mentioned in [32]. Horizontal, vertical and diagonal directions values are obtained as given in Table 5 and also shown in Figures 7 and 8 for the five plain medical images and corresponding ciphered images. The results indicated that there is a marginal correlation in the cipherimage between the two adjacent pixels, verifying that the HEECBSG scheme can strongly defense against statistical attacks.
Sensitivity analysis
Two joint measures are used to assure sensitivity properties: Number of Pixels Change Rate (NPCR) and Unified Average Changing Intensity (UACI) [31]. These are used to evaluate the strength of images encryption cipher with respect to differential attacks. They are defined by the following two equations:
The two test results shown in Table 4 demonstrated that the average percentage values of pixels in cipherimage changed to be greater than 37.72% for UACI and 99.63% for NPCR for the pseudo-random bit-string generator. It means that the HEECBSG approach works completely and precisely in relation to minor changes in the plainimage pixels. Consequently, the known-plaintext attack loses its efficacy and becomes essentially useless.
Comparison of correlation coefficients with other methods
Comparative execution times for encryption and decryption of 256 × 256 grayscale images
Comparison of several tests with other methods
A comparison of results is done between the proposed HEECBSG and previous studies. The comparison is for medical image encryption schemes provided in [9–11, 33]. The performance assessment of our proposed mechanism by performing multiple tests focused on image quality and other criteria for evaluation. Comparison of correlation coefficient values with other methods are shown in Table 6 while comparison of entropy, PSNR, SSIM, NPCR and UACI are listed in Table 8. For real-time encryption and decryption, execution times were estimated for grayscale medical images of size 256 × 256, as illustrated in Table 7. As a result, the proposed HEECBSG scheme outperforms many existing methods and it is definitely a dependable option to encrypt and decrypt classical and medical images.
Conclusion
This paper presented a new HEECBSG mechanism for generating pseudo-random bit-string. The HEECBSG scheme is based mainly on two mathematical algorithms; which are elliptic curve cryptography and hash function; to achieve high data integrity and security levels. Moreover, medical image encryption application based on cipher bit-string stream was examined and various evaluation metrics of the cipherimages are reported. The performance analysis and security results showed that the obtained bit-string have high periodicity and good randomness properties. Therefore, it is suitable for security and privacy purposes and usage in medical image transmission. Based on the performance results, it should be noted that the proposed mechanism can be applied to any images for the purpose of privacy and security issues.
Future studies will be conducted towards the use of the proposed scheme in a cloud storage system. In addition, the crypto-stability of the HEECBSG and improving its running time over different platforms are going to be further evaluated.
Compliance with ethical standards
All the authors declare that they have no conflict of interest.
Acknowledgments
We would like to thank the editors and anonymous reviewers for their valuable comments and suggestions to improve the readability of the manuscript.
