A probabilistic public key encryption switching scheme for secure cloud storage

The high demand for user-centric applications such as secure cloud storage laid the foundation for the development of user-centric security schemes with multiple security features in recent years. But, the current state-of-art techniques primarily emphasized only one type of security feature i.e., either homomorphism or non-malleability. To fill this gap and provide a common platform for both homomorphic and non-malleable cloud applications, we have introduced a new public key-based probabilistic encryption switching method. The proposed scheme generates O ( m +2 log N ) bits of ciphertext where m ∈ ℕ and m < n , n ∈ ℕ is the plaintext size, N is the RSA composite. The superior performance of the proposed scheme has been tested in comparison to existing methods and is reported in this paper.


Introduction
The invention of public key cryptography has shown a new direction to several asymmetric privacy-preserving techniques such as information-hiding, private information retrieval, oblivious transfer. The main goal of any public key cryptography is to achieve secure asymmetric communication without prior communication/sharing as contrary to symmetric key cryptography.

Motivation and background
It is evident from recent cloud storage and retrieval applications [14,18,29,30,32] that there is a need to extend security capabilities to accommodate both homomorphism and non-malleability under a single umbrella. Motivated by this, many security techniques such as Encryption Switching Protocol (ESP) have been proposed to provide unique solution to cover both homomorphism and non-malleability applications. In asymmetric key cryptography, the bijective trapdoor function mappings are basically used during the encryption process. To overcome the problem of the secretsharing over the insecure channel using symmetric encryption, the concept of asymmetric encryption was proposed using bijective trapdoor one-way function mappings. There are two notable drawbacks in such cryptosystems. First, the security of these cryptosystem completely depends on the underlying hardness assumption(s) (not on the underlying mapping function). Second, existing cryptosystems clearly failed to achieve efficient encryption switching between the homomorphic and the non-malleability properties without altering the underlying structure.
Generally, there are four major concerns in any asymmetric key constructions. (i) reasonable ciphertext expansion (i.e., the ratio of ciphertext size to plaintext size) (ii) possible operation on the ciphertexts (such as homomorphic property) (iii) possible selection of the type of plaintext and size of the plaintext space (iv) level of security (such as chosen ciphertext security). Although most of the existing number-theoretic asymmetric encryptions [10,15,22,27] naturally impose a restriction on the generation of small ciphertexts (less than the plaintext) due to the existence of number-theoretic modular operations (like addition or multiplication), such schemes enjoy very useful properties such as homomorphism (partial or full) and cover many useful privacy-preserving extensions such as oblivious transfer, private information retrieval, oblivious RAM etc.
In fact, the security of most of the number-theoretic state-of-art schemes (both deterministic and probabilistic) completely depends upon the underlying intractability assumption (such as integer factorization, quadratic residuosity, phi-hiding, composite residuosity etc.) instead of the underlying bijective functions. It is a fact that most of these schemes (except lattice-based schemes up to some extent) are not one-way functions; they are just trapdoor one-way functions. It is intuitive that the security of these trapdoor one-way function schemes relies on hiding the trapdoor information but not on the one-wayness of the underlying mapping function. This motivates us to find an alternative scheme that depends on the one-wayness of the underlying mapping function.
Although these existing schemes exhibit many useful properties they continue to use relatively weak trapdoor one-way functions. This move has naturally raise the following questions on some of the security properties (such as homomorphism) and mapping types (such as bijective and injective types) adopted.

A new composite function-based encryption model
This paper proposes a new surjective and/or bijective composite function-based encryption model to answer the following question: "Can we have a probabilistic public key-based encryption switching scheme that can efficiently switch between homomorphism and non-malleability using the surjective and/or bijective composite functions ?" To find out an efficient answer to the above question, we have proposed the following composite trapdoor functions as shown in Fig. 1.
Surjective and Freeman et al. [13] function combinations: For all I ∈ {0, 1} 2 and for all X ∈ ℤ +1 N , the quadratic residuosity-based surjective function is f ∶ (I, X) → Y where Y ∈ ℤ +1 N . For any two i 1 , i 2 ∈ I , and for any x ∈ X there exists y ∈ Y such that f ∶ (i 1 , X) → y and f ∶ (i 2 , X) → y . Therefore, the function f is surjective.
For all Y ∈ ℤ +1 N , the modified quadratic residuositybased function of Freeman et al. is g ∶ Y → Z where Z ∈ Q R . For all y ∈ ℤ +1 N , g ∶ y → z is defined as g(y) = y 2 . The mapping g(y) looses the position (i.e., [1, N 2 ] or [ N 2 + 1 ,N − 1 ]) of the input y in the ciphertext.
In this paper, we have introduced a new probabilistic public key-based encryption switching scheme (i.e., switch between homomorphism and non-malleability during enryption phase without changing the underlying structure) in which the encryption receives the message and the switchable public key (either homomorphic public key or nonmalleable public key) and outputs the respective ciphertext as shown in Fig. 2. By carefully selecting the appropriate combination of public key and the proposed composite functions, the proposed model exhibits encryption switching from homomorphic property scheme to/from non-malleability property scheme. The proposed encryption switching model has the following notable features.
• Novel tricks: The proposed model involves novel crypto (i.e., the proposed composite functions) and non-crypto PK H =Homomorphic public key ∀M ∈ {0, 1} n , n ∈ N PK N =Non-malleable public key C H =Homomorphic cipher SK=Private key C N =Non-malleable cipher Fig. 2 The encryption switching mechanism of the proposed scheme techniques to overcome several security drawbacks of the existing systems. • Probabilistic encryption: The proposed model essentially involves the probabilistic encryption in which every ciphertext generated is always a result of the randomized operations of its plaintext. • One-wayness of the encryption functions: As contrary to the existing systems, the one-wayness of the proposed model partially dependents on the underlying intractability assumption whereas the remaining dependency is on the underlying composite functions. But, every ciphertext will be uniquely decrypted to the intended plaintext. • Semantic security: The proposed model is semantically secure if the underlying quadratic residuosity assumption is semantically secure. • Encryption switching: Along with the semantic security, the proposed model supports encryption switching i.e., at the given instance, the model can behave either as the probabilistic homomorphic encryption or the probabilistic non-malleable encryption.
-Homomorphic property: The probabilistic homomorphic encryption version of the proposed model supports the homomorphic multiplication operations on the ciphertexts. -Non-malleability property: The probabilistic nonmalleable encryption version of the proposed model supports the non-malleability support on the ciphertexts.
• Efficiency: Compared with the most practical encryptions, the proposed model is almost comparable with respect to the ciphertext expansion and the running time.
The encryption and key generation times of the proposed model are better than the number-theoretic encryptions such as RSA whereas the decryption time is slower than the existing encryptions. For any k bit plaintext, the proposed model generates around k+2 log N bits ciphertexts where k ∈ {0, 1} * , N is the RSA composite. • Security parameter independent plaintext space: The proposed model involves any n-bit binary string as a plaintext. Therefore, the plaintext space is totally independent of the security parameter (Note: plaintext size n ≤ log N in case of RSA encryption where N is the RSA composite number).

Related work
To overcome the secret-sharing over the insecure channel in symmetric encryption, the concept of asymmetric encryption has been formally discussed by Diffie and Hellman [10]. The seminal work of Diffie and Hellman [10] using discrete-log-problem (DLP) has been fulfilled the thirst of sharing the secure data over the insecure channel using the trapdoor-based one-way function. Various improvements including ElGamal McCurley [12,19] on [10] have been achieved several cryptographic milestones to make the asymmetric mode of encryption more realistic and application friendly. But this family of schemes suffer from two major drawbacks. First, the plaintext space is restricted to a specific type and size. Second, the homomorphic property of these schemes is not a suitable candidate for high security applications since there exists a variety of adversaries to attack such systems.
The first success of practical result for efficient asymmetric encryption is constructed by Rivest et al. [27] popularly known as RSA. The generalized version of RSA has been constructed by Rabin [26] using the square root modulo composite number problem. Further, comprehensive research [17,28,33] has been carried out on these schemes to find more practical and secure systems. This class of systems has successfully achieved ciphertext size equal to plaintext size but fundamentally suffer from malleablity attacks.
To withstand against line tapper, Goldwasser-Micali [15] systematically presented the first probabilistic bit-level security with the relaxed notion of security called "semantic security" using quadratic residuosity as the underlying primitive. But, this scheme has no support to achieve a reasonable ciphertext expansion factor and also no support for non-malleability [2] feature. Several research efforts including Park and Won [23], Vanstone [31], Benaloh [3], Naccache and Stern [20], Okamoto [21] have been carried out to reduce the communication cost in these type of encryption. Notably, Blum-Goldwasser [4] have almost achieved the efficient communication cost for all large plaintext still no support has been provided for a non-malleability feature.
One more class of probabilistic asymmetric encryption has been introduced by Paillier [22] using composite residuosity problem. The ciphertext size of this scheme is twice the size of the plaintext. Several cryptographers including Cramer and Shoup [8], Damgard-Jurik [9] have put their efforts to provide communication efficient and secure schemes. Unfortunately, these class of encryptions has also failed to provide efficient encryption switching.
To construct homomorphic and CCA secure encryptions, many cryptographers [1,5,6,16,24,25] have constructed almost optimal results using a variety of cryptographic primitives. But, the fundamental design requires multiple structures to provide homomorphism and CCA security.
To the best of our knowledge, no existing probabilistic schemes show (at the basic construction) the reasonable expansion factor with the efficient encryption switching capabilities. In fact, many secure Cloud storage and retrieval efforts have been proposed [14,18,32] using existing security techniques. But, today's cloud technologies looking towards an encryption switching scheme that supports both homomorphism and non-malleability at the scheme level with a minimum computational overhead. Though there exists some encryption switching schemes such as encryption switching scheme presented by Couteau et al. [7], there are several notable drawbacks as mentioned below.
• The encryption switching developed in [7] depends upon several security assumptions such as decisional composite residuosity, decisional Diffie-Hellman, and quadratic residuosity whereas our proposed scheme depends upon a single quadratic residuosity assumption. • In [7], plaintext space is limited to a multiplicative group ℤ * N whereas plaintext space in our proposed scheme free from ℤ * N . • Most importantly, in [7], the encryption switching happens between two different cryptosystems whereas in our proposed scheme encryption switching happens within the same cryptosystem without altering the fundamental design.

Preliminaries and notations
This section describes all the necessary notations and background required for the proposed scheme.

Notations
is the process of selecting all the elements from i to j iteratively. Let N ∈ {0, 1} k be the RSA composite modulus with large distinct prime factors p ≡ q ≡ 3 (mod 4) and Q R denotes the quadratic residue modulo N set with Jacobi Symbol ( JS ) 1 and Q R denotes the quadratic non-residue modulo N set with Jacobi symbol −1 . Let ℤ +1 N =(Q R ∪ Q R ) be a set of all the elements modulo N with Jacobi symbol 1 and ℤ −1 N be a set of all the elements modulo N with Jacobi symbol −1 . Let LS be a Lagendre Symbol. Let the plaintext be M ∈ {0, 1} n where n = {2i ∶ i ∈ ℕ} is the plaintext size. Let the notation < A, B > denote the ciphertext set in which A ∈ ℤ +1 N and B ∈ {0, 1} l where l < n . Let p QR be the quadratic residuosity assumption probability and p R be the single fair coin toss probability. Let r, s, t, w be the public key components.

Quadratic residuosity predicate ( PR)
For all x ∈ ℤ * N , PR is a function to return a boolean value (0 or 1) to indicate whether "

Quadratic residuosity assumption (QRA)
Decision of the quadratic residuosity of a number modulo N is intractable in polynomial time. That is, for all probabilistic polynomial time algorithm G , there exists a negligible func- is in Q R and ℙ is the probability finding function.

QRA-based trapdoor function of Freeman et al. [13] (TF)
For all random input x ∈ ℤ * N and the public key components s ∈ Q R with Jacobi Symbol −1 and t ∈ Q R , the quadratic residuosity-based function described in [13] is Probabilistic Encryption: For all given random x ∈ ℤ +1 N and random r ∈ Q R , for all random ∈ {0, 1} , the modified probabilistic trapdoor function of Eq. (2) is and the respective inverse function is defined as is the quadratic root finding function under modulo N, " ⋅ " is the modular multiplication operator, " r − when =1" is the modular inverse modulo N.

A new algebraic framework
This section describes the algebraic frameworks used in the proposed scheme.

QRA-based single bit encryption (SBE)
Let a bit b ∈ {0, 1} . For all random input x, y ∈ ℤ +1 N and random public key components r, s ∈ ℤ +1 N with PR(r) ≠ PR(s) , x, y, r, s, w) is given as The inputs x,y ∈ ℤ +1 N consist of their respective j,h values as described in Eq. (1). Therefore, there are four j,h possible combinations (listed in the first column of Eq. (4) for any x, y ∈ ℤ +1 N when j = 0 . Encryption of b is done using the correct pair of equations. For instance, if j x = 0, h x = 0 and j y = 0, h y = 1 , bit b = 0 is encrypted using the pair of equations defined in second row and second column of Eq. (4). Similarly, bit b = 1 is encrypted using second row and third column of Eq. (4).
The decryption of E s to get back bit b involves the identification of the respective quadratic residuosity properties of the ciphertexts c 1 and c 2 as follows. • Step-1: Find quadratic residuosity properties of the ciphertexts c 1 and c 2 as PR(c 1 ) and PR(c 2 ). Based on the quadratic residuosity properties of the ciphertexts, output b and (j,h) combinations of x, y. • Step-2: Multiply respective public key inverses to the ciphertexts to get back x 2 , y 2 . Then, given x 2 and ( j x , h x ) values, find unique x as described in Eq. (2). Similarly, given y 2 and ( j y , h y ) values, find unique y as described in Eq. (2).

QRA-based bit pair encryption (BPE)
Let (a, b) be a bit-pair where a, b ∈ {0, 1} (in which a is the first bit and b is the second bit). For all random input x ∈ ℤ +1 N and random public key components r, s ∈ ℤ +1 N with PR(r) ≠ PR(s) , random t ∈ Q R , the probabilistic encryption E((a, b), N, x, r, s, t) of the bit pair is For any x ∈ ℤ +1 N , the unique combinations of r, s ∈ ℤ +1 N and t ∈ Q R are given in Table 1. Since there is no pre-agreement in public key encryptions, fix any one of the combinations given in Table 1 for encryption. For convenience, let r ∈ Q R , x, s ∈ Q R , and the first combination of the above table is used for the encryption of the bit-pair.
Decryption: Given the ciphertext y, the second bit b ( assume that the second bit b has been received by some other function) and the private key p,q, the decryption function outputs first bit a and input x as • Step-1: Find the quadratic residuosity of the ciphertext y as PR(y). • Step-2: Given PR(y) and second bit b, find the first bit a and input x as

Contiguous chain bit pair encryption (CC-BPE)
Let l bit plaintext be P = {b 1 , b 2 , … , b l } . For all random input x ∈ ℤ +1 N and random public key components r, s ∈ ℤ +1 N with PR(r) ≠ PR(s) and random t ∈ Q R , the contiguous chain encryption E con (P, N, x, r, s, t) as shown in Fig. 3 is (5), TD(⋅) is the injective function described in Eq. (2) and < y 1 , y 2 > is the ciphertext set where y 1 ∈ {0, 1} k , , is the intermediate ciphertext coming out of each E and each h u j is the "h" value of it. The respective decryption (i.e., E −1 con ) of is given as

Discrete chain bit pair encryption (DC-BPE)
Let l bit plaintext be P is the BPE encryption as described in Eq. (5), TD(⋅) is the modified trapdoor function described in Eq. (2) and < y 3 , y 4 > is the ciphertext set where , is the intermediate ciphertext coming out of each E and each h v j is the "h" value of it. The respective decryption (i.e., E −1 dis ) of DC-BPE requires an additional aid from other CC-BPE or DC-BPE chains. For instance, con-

Dependent/independent decryption
We call the decryption of DC-BPE chain as "dependent decryption" since every second bit of each BPE used in DC-BPE can be obtained (during decryption) from the corresponding CC-BPE or DC-BPE. We call the decryption of CC-BPE chain as "independent decryption" since every second bit of each succeeding BPE of CC-BPE is obtained (during decryption) by the preceding BPE of the same CC-BPE (Refer Table 2). Note that DC-BPE alone does not have the capability to get the second bits of its component BPEs whereas CC-BPE alone has the capability to get the second bits of its component BPEs. . In addition, a single subset M 7 can also be used to encrypt the given plaintext (using contiguous chain bit-pair encryption). We use one of the pairs ( M 1 ,M 3 ) throughout this paper to explain the proposed scheme.

Decryption dependent ciphers
We call y 1 , y 2 of CC-BPE or y 3 , y 4 of DC-BPE as "dependent ciphers" since they are completely dependent on each other during decryption.

Definition 1 A Probabilistic
Public Key Cryptosystem is a 3-tuple ( , , ) scheme consists of two probabilistic (7)  polynomial time (PPT) algorithms , and a deterministic algorithm described as follows.
• Key Generation ( ): Given a random security parameter k, algorithm generates a randomized public and private key pair ( PK, SK). • Encryption ( ): Chooses a public key PK R ← � � � � � � ℤ * N with certain quadratic residuosity property, a message M ∈ and generates a ciphertext C = (PK, M). • Decryption ( ): Given the secret key SK and ciphertext C , algorithm generates the same message M as M = (SK, C).
Indistinguishable Property: We say the ciphertexts are indistinguishable if any two ciphertexts C 1 = (PK 1 , M) and C 2 = (PK 2 , M) generated from are computationally indistinguishable under the standard QRA proposed in [15]. That is, for all PPT adversary A , there exists a negligible function F such that | ℙ[A(PR(PK 1 ),N) where k is the security parameter, PR is the quadratic residuosity predicate function and ℙ is the probability finding function.
Correctness: We say that PKE satisfies correctness if for all ( PK, SK) where the randomness is taken over the internal coin tosses of algorithm ).

Definition 2
The public-key encryption scheme described in Definition 1 is said to be semantically secure if for any PPT distinguisher A and any pair of messages M 0 , M 1 , given the public key PK , the advantage for distinguishing C 0 = (PK , M 0 ) and C 1 = (PK , M 1 ) is negligible in security parameter. In other words, the above said scheme is semantically secure until underlying quadratic residuosity assumption is semantically secure. Definition 3 Let ( G 1 , ⋅ ), ( G 2 ,*) be groups. Let be the probabilistic encryption algorithm and be the decryption algorithm of an encryption scheme with plaintext set G 1 and ciphertext set G 2 . The encryption scheme defined in Definition 1 is said to be group homomorphic if the encryption map ∶ G 1 → G 2 has the following property:

New probabilistic single structure encryption switching scheme (ESwiS)
In this section, we propose quadratic residuosity-based asymmetric encryptions as defined in Definition 1. Let the plaintext M = {b 1 , b 2 , … , b n } . We use the subset ( M 1 ,M 3 ) of Table 3 to explain the proposed scheme and all the remaining subset pairs can also be encrypted in a similar fashion using their respective chains. The overall encryption process consists of two steps. In the first step, encrypt the subset M 1 using CC-BPE chain and encrypt the subset M 3 using DC-BPE chain.
In the second step, encrypt the last bit b n using the ciphertexts obtained from the first step as inputs to SBE function. The detailed description is as follows.
• Key Generation ( ): Given the security parameter k, select the RSA composite modulus N ∈ {0, 1} k with the large distinct prime factors p and q with p ≡ q ≡ 3 (mod 4). Choose the random numbers r,s ∈ ℤ +1 N with PR(r) ≠ PR(s) and choose a random t ∈ Q R and choose a random w ∈ ℤ −1 N . Also, choose a random input x ∈ ℤ +1 N . The public key is (N,x,r,s,t,w) and the private key is (p,q). • Encryption ( ): For all plaintext M and the public key (N,x,r,s,t,w), the encryption (M) is given as Therefore, the final ciphertexts are The pictorial representation of the encryption process is given in Fig. 4.
• Decryption ( ): Given the ciphertexts ( C 3 , C 4 ) and the private key (p,q), the decryption (C 3 , C 4 , p, q) is given as and the pictorial representation of the decryption process is given in Fig. 5.

Independent decryption scheme using CC-BPE method
It is evident that no subset alone can be decrypted to generate all the plaintext bits except the subset M 5 (refer Eq. (7)). Therefore, to reduce the dependency among the subsets, the single subset M 5 can be encrypted as E con (M 5 , N, x, r, s, t) using the CC-BPE encryption technique described in Eq. (3.3) as

Probabilistic single structure encryption switching signature scheme (ESwiS-Sig)
The proposed scheme of Sect. 4 can also be used for generating the digital signatures. The detailed description is as follows.
• Key Generation ( ): Given security parameter k, select the RSA composite modulus N ∈ {0, 1} k with the large b1 b2 Plaintext Ciphertext DC-BPE chain CC-BPE chain  Step-1 Step-2 prime factors p and q. Choose random quadratic residue r ∈ Q R and random quadratic non-residue s ∈ Q R . Also, choose random input x ∈ ℤ +1 N . The public key is (N,x,r,s) and the private key is (p,q). • Signature Creation ( ) For any non-negative integer n,

Level of security
Since the proposed scheme uses quadratic residuosity properties, to reveal the plaintext M , the adversary has to following (i) find the properties of x, r, s (ii) find the last bit from Eq. (4) (iii) find the remaining bits from each BPE with p QR probability and each TF with p QR probability. The proposed scheme is secure until the underlying quadratic residuosity assumption is secure.
In addition to basic security, the proposed scheme also provides additional benefit to reduce the plaintext revealing probability of the adversary further which is most suitable for secure cloud storage applications.

Performance evaluation of the proposed scheme
This section describes the performance of the proposed scheme.

Expansion factor
The generic expansion factor which is applicable for all the subset pairs mentioned in Eq. (7) is defined as {=(m+d log N)/n where m < n and d is the total number of ciphertexts generated from encryption process. In the proposed scheme, if the security parameter k = log N = 512 and the plaintext size n = 512 then m = (| Y 1 | + | Y 3 |) = 509 Step-2 Step-1 and d ⋅ log N = 2 ⋅ log N . Therefore, the ciphertext expansion factor f = (509 + 2 ⋅ log N) = 2.99 (as shown in Table 6). Similarly, if k = 512, n = 1024 then m = 1021 and f = 1.99 . Also, if k = 1024 , n = 2048 then m = 2045 and f = 1.99 . Therefore, for all n = 2k, f = 1.99 . Similarly, for all n = 3k, f = 1.66 . For all n = 4k, f = 1.49 . In general, for all n ≥ 20k, f ≤ 1 . Even though the ciphertext size of the proposed scheme is little higher than the existing schemes (refer Table 6), it can reach the ciphertext size as k for all large message with n ≥ 20k.

Execution time
Since there are (n − 1) BPE functions involved in the encryption process of the proposed scheme and each BPE involves maximum of two modular multiplications, there are 2 (n − 1) multiplications. Along with BPE functions, there are (n − 3) TF functions are also involved in the encryption process proposed scheme and each TF function involves one modular squaring. Also, there is one SBE function used in the encryption process proposed scheme and it has four modular multiplications. Therefore, in total,there are 2(n − 1) + (n − 3) + 4 = (3n − 1) modular multiplications involved in each encryption and decryption process. Since Table 6 Performance comparison for all n ∈ ℕ bit plaintext schemes and k ∈ ℕ bit plaintext schemes Note: m < n and * Encryption Switching⇒ Exhibits both the properties but one at a time. Also, ( ‡ H⇒ Homomorphism)/ ( ‡ Non-M⇒Non-malleability) here implies that the scheme which support these properties at their basic constructions  Table 7 Performance of the proposed scheme when n = k SBE involves constant number of multiplications (i.e., four), just ignore that. Each bit thus involves (3n − 5)∕n number of modular multiplications during encryption and decryption process. Each encryption and decryption process of the proposed scheme involves (3n − 5)∕n number of modular multiplications plus (n − 3) number of PR functions. Refer Table 7 for further details. The performance of other subset pairs are tabulated in Table 8. The communication complexity is almost similar in all subset pairs. But, there is a difference in the capability of parallel execution. All the subset pairs except M 5 can be encrypted independently (with separate chains) in encryption whereas the subset pair (

Tamper proof facility
Due to the existence of the injective mapping, for all given plaintext M and public key (N, x, r, s, t, w), the encryption always produces a unique property ciphers C 3 , C 4 . Similarly, given the ciphers and private key (p, q), the decryption always produces unique plaintext M and input x as described in Eq. (9). Even a single bit change in C 3 , C 4 does not produce unique plaintext M and input x. This great feature suits well for secure cloud storage applications where the user can verify the tampering in the stored data. Hence, the proposed scheme certainly provides inbuilt tamper proof feature to the decrypting party about the change in the stored ciphertexts.

Encryption switching
One of the useful feature of the proposed scheme is the ability to shift from homomorphism (in tern malleable) to/from non-malleability. This switching capacity will cover both homomorphic to non-malleable applications. As the best of our knowledge, no existing probabilistic encryption schemes (at their basic construction) provide this kind of switching feature without altering the underlying security structure.
The proposed scheme uses the injective function of Eq. (2). Suppose, if TF from Eq. (3) is chosen, then the adversarial probability can be further reduced. By carefully observing the quadratic residuosity properties of input and public key components, it is clear from Table 1 that there is a change to opt the random combination during encryption process and hence the adversarial probability can be further reduced if the combinations is chosen randomly during encryption process. But, adversarial probability cannot be reduced in the proposed scheme since it uses the fixed combination. Also, there is a possibility to choose any subset pair during encryption process. If the subset pair is selected uniformly at random during encryption, the adversary probability can be reduced further. There are 256 unique combinations of the equations of E s that can be used to encrypt the last bit of the plaintext. If the purpose of the proposed scheme is to provide asymmetric encryption using the public key of other party then any one of 256 combinations can be used. But, if the purpose of the proposed scheme is to provide asymmetric encryption for secure user data storage on insecure cloud, then any one of the combinations can be selected at random. This random selection creates additional effort for the adversary to reveal the information.

Security extension by pre-storing ciphertext bits
The greatest advantage of the proposed scheme in secure cloud applications is to keep some of the ciphertext bits before storing on the insecure cloud. This additional feature greatly reduces the change of revealing the plaintext since the size of the ciphertext would be partially known and the locations of these bits are unknown to the cloud. In fact, this feature is unavailable in the existing encryption schemes.

Implementation and results
Since the encryption process of the proposed scheme supports multi-threaded execution of encryption and decryption, the implementation of the encryption involves the multithreaded execution of some of its parts. In fact, this multithreading feature helps in reducing the overall execution time. Since E con and E dis are independent encryption chains used in encryption process (as shown in Fig. 4), these are executed with two concurrent threads. Further, each encryption chain ( E con or E dis ) is executed in two steps. In the first step, given the plaintext bits, all the public key component multiplications (i.e., ( r ⋅ r ) or ( r ⋅ s ) or ( s ⋅ s )) for each bit pair are calculated in a single unit of time (please note that the unit time is the time required for a single multiplication). In particular, ( n − 1 ) multiplications from E dis and ( n − 3 ) multiplications from E con are concurrently executed in a single unit of time. In the second step, the remaining ((n − 3) + 2) modular multiplications are calculated sequentially. Therefore, the total time required to complete the encryption process is 1 unit from first step plus ( n − 3+2) units from second step = n units. However, decryption process involves very less multi-threading facility compared to encryption. Also, the decryption chains are completely depend on each other and they cannot be executed in parallel. In any given unit of time, only two bit-pair decryptions (each from each chain) can be executed in parallel. Also, the major time consuming part in decryption is the calculation of the quadratic residuosity property and quadratic square roots for each bit pair. Since the whole decryption process involves ( n 2 + 2 ) inverse multiplications, ( n 2 + 2 ) quadratic residuosity property calculations and ( n 2 − 1 ) quadratic square root calculations, the total unit time required to get back the plaintext is ( n 2 + 2 ) inverse multiplication time plus ( n 2 − 1 ) quadratic square root calculation time. Therefore, decryption process comparatively takes more time than the encryption. We have implemented the proposed scheme of Sect. 4 on the following hardware configurations: Intel Core i5-8265U CPU with 1.60GHz * 8 processor, 64-bit Ubuntu operating system, 8GB RAM and software configurations: Java programming language on eclipse IDE, BigInteger package for large number generation. The running time performance of the proposed scheme in key generation, encryption and decryption processes are tabulated in Tables 9, 10 and 11. The pictorial representation of key generation, encryption  The performance comparison of the proposed scheme with the existing security schemes as shown in Fig. 9 clearly shows that both key generation and encryption running times of the proposed scheme are better than RSA and ECC. The only time consuming part is the decryption. This slow running part is very much helpful for user-centric secure storage applications such as Healthcare record storage on untrusted Cloud. In fact, cloud has to invest huge amount of computation to reveal the information of the user data because of this slow running process. Therefore, the overall performance of the proposed scheme is reasonably well compared to the existing public key schemes.

A tamper evident secure storage and retrieval method on insecure cloud
It is intuitive that the proposed scheme provides a tamper evidence to the stored data when it is used to store the information securely over the untrusted cloud. Consider a scenario where there are only two entities namely Alice (client) and Cloud (server) in which Alice wants to store her private information securely over the curious and untrusted cloud as shown in Fig. 10. The proposed scheme effectively provides the solution to this scenario with highest security by choosing the non-malleable version (refer DDN [11] for Non-malleability definition) of the proposed scheme. Let Alice selects her private message M . Let Alice generates the (public,private) key pair and encrypts the message with her public key as (M) and produces the ciphertexts ). Second, even a bit change in the ciphers Y 2 , Y 4 will intimate Alice due to the existence of tamper proof support. This method also reduces the space overhead problem to Alice since | Y 2 | + | Y 4 |≈| M | and | Z 1 |=| Z 2 |= k where k is the security parameter. To reveal the private message of Alice, the Cloud has the negligible probability due to the existence of several random functions and inability to access other dependent ciphers Z 1 , Z 2 .
Consider one more scenario where there are three participating entities namely, Alice, Bob and Cloud where Alice encrypts his private message using Bob's public key using Eq. (8) and stores the dependent ciphers (i.e., Y 2 , Y 4 ) on the untrusted Cloud and sends the remaining dependent ciphers (i.e., Z 1 , Z 2 ) to Bob as shown in Fig. 11. Finally, Bob downloads Y 2 , Y 4 and decrypts Alice's message M using Eq. (9). PK Bob ⇒ Bob's Public Key SK Bob ⇒ Bob's Private Key

Fig. 11
A secure-sharing using cloud storage

Patient-cloud-doctor Application
The above scenario is analogous to patient, doctor, cloud in which patient wants to send his private health record to his doctor using cloud as a storage media.

Author-cloud-editor Application
Using the above three party communication setting, assume a scenario where Author (Alice) wants to send his research paper to the Editor-in-Chief (Bob) for anonymous review by securely storing his paper at a common access point (Cloud). In this case, the author creates a hash of the author(s) details using the existing hashing algorithm. Then, using editor's public key, author encrypts his paper using Eq. (8) of the proposed scheme and stores the dependent ciphers (i.e., Y 2 , Y 4 ) securely at a common access point (Cloud) and sends other dependent ciphers (i.e., Z 1 , Z 2 ) to the editor as explained in the above scenario. The Editor, downloads the ciphertext from Cloud and decrypts the paper using Eq. (9) of the proposed scheme and initiate the review process in an anonymous way (Because, neither the paper contains author details nor cloud stores complete ciphertext. Only the hash contains that). When the paper is accepted, the author sends the author details to the editor and the editor generates a fresh hash of the received author details and verifies with the received hash. This method successfully hides author(s) details on both editor as well as cloud side and stores the data securely on the untrusted cloud.

Conclusion and future work
We have successfully presented the quadratic residuositybased probabilistic encryption switching scheme along with some of its suitable secure storage applications. The overall performance of the proposed scheme including the bandwidth, encryption switching property are comparable with the existing schemes. Further, investigation is required on the extension of number of plaintext subsets of the plaintext and their effect on the overall performance. In addition, investigating per bit multiplication reduction and the chosen ciphertext security support is the future direction.
Funding Open access funding provided by Manipal Academy of Higher Education, Manipal.
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:// creat iveco mmons. org/ licen ses/ by/4. 0/.