Secure Symmetric Block Cipher Design for Encrypting the Bitcoin Wallets in Cryptocurrencies Applications

: This paper proposes a new symmetric secret-key cipher for construction of block cipher model. This new approach is considered as a smart step that can be applied to the long process research of modern designing methods used in developing earlier symmetric algorithms. The present cipher can encrypt block lengths of 128-bit by employing Substitution-Permutation Network (SPN) structure. The present cipher uses three options of strong ciphering-key along with variable lengths of 192-bit for 12 rounds, 128-bit for 10 rounds and long ciphering key of 256-bit for 14 rounds similar to standard ciphers. The proposed algorithm has been designed to trust applications that are based on Bitcoin and crypto-currencies. The current algorithm intended to encrypt addresses of Bitcoin wallet that work quite similar to the e-mail address. The bitcoin wallet includes sensitive information like private secret keys and derived password that are highly confidential. The Advance Encryption Standard (AES) is employed to encrypt most of the bitcoin wallet database. The proposed cipher can act as a good substitute for the standard cipher that allows trusting the Bitcoin wallet database with high security and with a much more complex scheme. The key goal of the submitted algorithm is to build a new enhanced modern cipher with a secure and efficient applicable algorithm that can be used for crypto currencies applications employing a wide trail


Introduction
A humongous volume of financial transactions is carried out over the network on a daily basis that involves processing and transmitting of millions of dollars via cryptocurrency systems. Such systems need to maintain a high level of security to protect against frauds (Karame and Androulaki, 2016). The proposed cipher has been developed to be in par with the information revolution as well as rapid growth of internet services that use bitcoin. Thus, the design of robust cipher structure has been proposed to deal with modern attacks as well as provide high protection level against malicious attacks. The present algorithm involves a series of developments via long process research has been used by authors for several years, as its design idea as well as the internal structure rely on various block cipher models that have been historically developed and recently published, such as Euphrates cipher, Tigris Cipher and FAROQ cipher designed by (Dawood et al., 2015a;2015b;2015c). These symmetric ciphers have been proposed by the same author and published recently. The mentioned ciphers paved the way in front of design the current cipher and their work quite similar to the AES standard cipher. The introduced cipher includes all improvements in terms of design structure based on successive models. The key aim of the submitted algorithm is to develop a new modern cipher that employs a secure and efficient applicable algorithm in crypto-currencies applications employing the wide trail design strategy that explained by (Daemen and Rijmen, 2001). Many block ciphers models are available and a majority of these ciphers as well as their structures have been developed by considering confusion with permutation, diffusion and substitution layers. Completely known encryption/decryption processes have been employed for all these ciphers, while just keeping the ciphering key as secret as per the Kerckhoff's design principles (FRANCO, 2015). The developed algorithm includes three trusted layers: Non-linear layer characterised by the complement of close box C-Box, Super-Mixing (P-Box) of Linear layer with Zigzag-Shifting process in addition to Key addition layer.

Literature Survey
In this part, a review about some introduced works which are classified according to the most relevant of current study is done. Thus, on the one hand of confidentiality will explain the following studies: In (Bitcoin Wiki-BIP 0032, 2012). The BIP 0032 was announced a new technique about generating multiple private keys and as a result several of various Bitcoin addresses will be generated depending on certain seed. This type of wallet is denoted by Hierarchical Deterministic (HD) wallets that accept a specific deterministic derivation rule for retrieving the private keys from the seed. This technique also gives the user possibility to make a backup for the seed instead of doing that for all the private keys.
A secure symmetric algorithm employed for encrypting the wallet.dat file that utilized in Bitcoin client as explained in (Mike Caldwell-BIP 0038, 2012). The encryption process involves a standard cipher of AES with Cipher Block Chaining (CBC) (AES-256-CBC) for encrypting the private keys that are generated in a wallet on client demand. AES-256-CBC encrypts the master key that undertakes the responsibility of encrypting the private keys which derivate from the passphrase. CBC refers to the Cipher Block Chaining (CBC) operation mode for block cipher algorithm. Where the encryption process comprises each cipher text unit is encrypted under secret of ciphering key and applied to the whole block. CBC represents an additional layer of complexity for the encrypted plaintext combined with Initialization Vector (IV) of a specific length.
The client utilizes AES-256-CBC algorithm for encrypting Bitcoin wallet database. Most modern Bitcoin wallets give the client an option for encrypting user's private keys with the AES-256-CBC algorithm to introduce a trusted passphrase. The AES cipher encrypts the wallet database (Keys) and as a result the user must enter the passphrase to make the transaction and sending process. This step is to alleviate some practical attacks which are possible face the wallet.
The current studies of literature survey comprise the authentication and integrity aspects: Elliptic Curve Digital Signature Algorithm (ECDSA) has been proposed by (Gallagher and Romine, 2013). ECDSA acts one of the strongest security methods for Digital Signature Algorithm (DSA) that depends on (EC) and encounters the nonrepudiation phenomena. The signature process depends mainly on the secret keys generated from the (EC) cryptographic method. The ECDSA is a standard cipher for generating random private keys of 256-bit (32-byte) and signing the transactions as well as verifying from the signature.
BitcoinWiki (2016) Base58Check announced a novel technique of Base58Check coding method. The Base58Check coding is a developed method of binary to text encoding schema that similar to base64 except it does not involve predefined symbols. It consists of two terms the first one is "Base58" that used base58 character for encoding process. The second term is "Check" which points to a checksum that used for data integrity and error detection. Base58Check works to encode the byte arrays in Bitcoin into string of 58 recognizable characters.

Crypto-Currency and Bitcoin Concept
A robust and effective algorithm is needed for the current advances accompanying to digital currency as well as rapid progress in the super computer industry. It should also have the capability to face recent as well as future challenges. The modern active attacks and the progress of the internet as well as network communications along with parallel computing have greatly helped to defeat and break popular encryption algorithms (Szmigielski, 2016;Sagheer et al., 2011). Since crypto currency is categorised as a virtual currency, it relies on cryptographic foundations and encryption rules with regards to verifying, signing and confirmation are applicable.
It can be defined as a decentralized digital currency involved in the electronic payment system employing the cryptographic Proof-of-Work (PoW) process and the distributed consensus protocol in place of Third Trusted Parity (TTP). Cryptocurrencies include favourable features such as privacy, anonymity, confidentiality as well as transparency that allow each person on the network to monitor the account balance pertaining to all parties (Matthew et al., 2015) There are many kinds of cryptocurrencies like ethereum, bitcoin, dogecoin, ripple, titcoin, litecoin, monero, gridcoin and dash. The bitcoin is the most famous as well as the most extensively used cryptocurrency. It was introduced by Nakamoto (2008). It can be considered as the currency employed in the network, software and protocol altogether. Figure 1 shows the key scenario involved with Bitcoin. Bitcoin as a digital currency ecosystem gained much popularity amongst individuals and governments due to its considerable use in trusted electronic payment, saving, purchasing and investments. Blockchain is the Bitcoin ledger signifying a back linked list. It can also be regarded as a public ledger with registries of all bitcoin transactions in the network. Transaction by using bitcoin on the user's public key involves a series of irreversible cryptographic hashing that allows moving the bitcoin from one address to another (Melanie, 2015). When sending in the transaction process, transaction fees are always involved to make a request by the bitcoin's user, which allows the miner for bundling them into a block. The term block involves a set of transactions that have been signed with cryptographic hashing of the previous block and timestamps. The main blockchain is included in the linked list of these validated blocks in the network, which starts via genesis block. The user can generate multiple public keys for various addresses to facilitate exchanging amongst participants (Andreas, 2015). Linking of the imposed addresses could be done with one or more trusted bitcoin wallets. Bitcoin wallets are basically software that stores all addresses and acts as a backup for keeping the secret of ciphering keys. Instead of the username, the bitcoin addresses include a string of letters and numbers. There no fixed size for the Bitcoin wallet database since each wallet may contain several millions of addresses and transactions that depend mainly on client activity and type of wallet (Aljosha, 2017).
The bitcoin wallet also allows receiving, sending, storing the bitcoin as well as register the transferred coins along with the owners' details. There are different kinds of hardware and software wallets which can be categorised into hot and cold storage wallets. The cold storage wallets and real wallets share many similarities and so people can use them daily. The offline wallet is completely secure, allowing storing of small amounts of bitcoins similar to the hardware wallet: dedicated device wallet, USB drive and paper wallet. The online hot cryptocurrency wallet is connected to the internet and can keep many bitcoins such as mobile, cloud and desktop wallets. The most extensively utilised bitcoin wallets are Trezer, Leger, Electrum, Mycelium, Exodus and Jaxx, etc. (Miraje, 2016).
AES-256-CBC is employed to encrypt most of the wallets where the stored sensitive database (password and private keys) are encrypted in the wallet. Two elementary reasons can be described to summarise the key motivations to the design of the proposed cipher: the recent concerns pertaining to the expiry date of AES cipher's life time and the security concerns with the advance techniques involved in cryptanalysis attacks. Furthermore; the world become in urgent need for an extended cipher algorithm with larger block and key size to satisfy the applications that require an extra processing speed. The Big Data field, Cloud computing, Cryptocurrencies applications and several of other modern applications that require a bulk of encrypted data have been emerged recently (David and Chuen, 2015;Dawood et al., 2018).

The Advantages of Bitcoin Currency
The are several advantages of Bitcoin use over the electronic traditional payment systems that can be listed as follows (Bunjaku, 2017): 1. Bitcoin currency is not subject to the limitations or permission from any part and transcends the borders 2. It is safe to seizure no one can take your Bitcoin since you possess it, it's not belongs to any national bank or organization 3. Bitcoin is control safe that depends on difficult computational notation called Proof-of-Work (PoW) which means nobody can prevent your exchanges 4. Decentralized Bitcoin feature means achieving the transactions over millions of nodes with the absence of trusted third party 5. Bitcoin is scalable because it is an open source where anyone can participate in developing the Bitcoin software 6. Bitcoin has a restricted supply that will just ever be 21 million bitcoins made and are created at an anticipated rate 7. It is peer-to-peer currency with less transaction cost than the traditional centralized networks payment such as master card and visa card and etc 8. Bitcoin currency cannot be refund when you transform amount of money to someone there is no chance to reverse the transaction and back it to your account 9. The Bitcoin can be used as a real currency in buying different things from the internet 10. Bitcoin is untraceable that can be defined as anonymous, since the use of Bitcoin need no identifying information 11. Bitcoin introduces freedom financial transactions around the world without any restrictions 12. It is Simple and easy to create a Bitcoin account compared with the procedure involved with banking account

The Disadvantages of Bitcoin Currency
After mention the above advantages the Bitcoin disadvantages can be stated below according to the author (Ivaschenko, 2016): 1. Strong financial market volatility-the rise and fall down Bitcoin value effected directly on the declared policies adopted by some countries represents a main problem in cryptocurrency sector 2. The large risks surrounding investment in cryptocurrency and the cyberspace attacks are considered the main threats

The Proposed Algorithm
The proposed cipher can be defined as an iterated cipher that has been developed based on the standard guidelines pertaining to the symmetric algorithms. Three layers are involved in the round transformation of the put developed model. Close-Box (C-Box) is the first one, where for each byte of the state array, substitution is done along with the complement clue. This stage is known as non-linear or substitution layer. In the second part, the transposition clue is employed to derive the diffusion layer stage, which also confers diffusion characteristics, followed by the Super-Mixing layer's P-Box stage that confers diffusion and confusion characteristics along with constant Maximum Distance Separable (MDS) of linear equations. MDS matrices act linear code which essential circulant matrices for constructing most symmetric blocks cipher algorithms that undertake the generating of diffusion functionality. MDS matric can be described as n×n matrix with a circulant feature that involves its rows are generated by previous cyclic shifts of its first row to reuse the multiplication circuit recursively and to reduce the implementation cost. In recent years, several studies look for generating and implementing MDS matrices in the context of hardware design with small logical integrated circuit.
In the final part, a key generation method is introduced via key expansion procedures that allow employing the AddRoundKey or key addition layer.
The key addition stage functions along with the symmetry characteristic, pertaining to the round transformation across multiple rounds. Figure 2 shows the general structure of the proposed algorithm with the main operations in the round transformation.

Non-Linear Complement-Based C-Box
A nonlinear stage is signified by the complement box or Close-Box (C-Box), which facilitates data transformation in the introduced cipher and each block is modified via replacement of the C-Box table. The C-Box stage relies on a novel idea for building C-Box that chooses a unique new affine matrix that is multiplied by its inverse to provide the complement of identity matrix. Development of the C-Box is based on choosing a new irreducible polynomial of x 8 +x 5 +x 3 +x 2 +1 as well as a new affine transform that possesses a modern idea associates with the complement property. Three steps define the development of forward C-Box. In the first step, multiplicative inverse to the entire values in the tables is considered, after which the new complementaffine transform is applied while the value (75) is XORed as constant vector. The C-Box's resultant table includes 256 hexa-values that were segmented into two groups, represented by (black and dyed in yellow) of 128-values for every group. This was followed by the function of C-Box; intersection of the entry value was done based on the values in the C-Box table.
Thus, the projection would be represented either in yellow colour or with black values. With regards to black values, these are direct and the desired value can be found with the intersection of the table's ith row and jth column to provide the output value. On the other hand, the group with highlighted yellow colour values will require an extra step that allows addressing the complement process regarding to the yellow value to be compatible with its inverse for the backward operation.
E.x: If a row/column index of (08) is taken in forward C-Box, the intersection result is a highlighted value with yellow colour of (42); when a value (42) or (01000010) in binary notation for the complement process is taken, then the result of (BD) or (10111101) is chieved.

Inverse Complement-Based C-Box
The construction of the inverse for the C-box is done by adopting the inverse of the affine matrix after which computation is carried out for the multiplicative inverse to each value in Galois Field GF(2 8 ) as well as the resultant XORed to the constant vector characterized by the value (FB).
E.x: In the case of backward C-Box, the row/column index of (BD) from an earlier example is taken. It would provide the highlighted yellow value of (08) and when in forward C-Box, the row/column index pertaining to the highlighted yellow value of (08) is taken, a value of (42) is obtained. In this paper, we have explained how this occurs as well as the key idea beyond the complement C-Box.
The secret behind the C-Box is signified by multiplying the forward affine matrix by the backward affine matrix, which yields the identity matrix's complement.
The complement identity matrix signifies that the values to the key diagonal of the matrix are zeroes, while the others yield one value. This also suggests that when the forward is multiplied by backward affine equations, no identity matrix is yielded and alternatively a complement matrix is yielded. This kind of matrix yields the complement identity matrix, which is a key point in the building of the C-Box, which has been seen to be stern and complex against the most effective attacks. To reverse the steps, there is no fixed easy point and has been considered to be insurmountable against the analysis. The forward and backward C_Box tables can be shown in Table 1 and 2.

Transposition Diffusion Layer
The functioning of the transposition diffusion layer is similar to rearrange the byte positions, where it essentially acts as a transposition cipher wherein only the positions of the elements are rearranged without altering their identities in the encryption process. This stage is a transposition method that responsible for generating the diffusion property. It is a new mechanism for rearranging the elements of state array in a zigzag way as shown in Fig. 3. These values are permutated in simple steps to distribute each entry input byte to various output byte. Thus, the cryptographic cipher with high diffusion scheme considers a more secure cipher. This method is optimum to achieve an optimal diffusion on hardware cost-effectively and allow rapid implementation along with protection against saturation and truncated differential attacks.

Linear of Mixing Layer
The third stage involves linear diffusion layers of Mixing notation that are denoted as a matrix multiplication of Y = MX, which can be described by super-mixing transformation. Although the put forward MDS matrix has no role in decreasing the correlation of a linear characteristic, it allows increasing the diffusion property. Implementing large MDS matrices could be a costly affair for hardware and would need additional overhead processing. The super-mixing transformation can be defined as the state array multiplied by certain MDS matrix of order four. Addressing of the MDS matrices could be done by multiplying a polynomial over GF(2 8 ). Altering any one entry incoming byte would result in impacting all the outcome bytes, as demonstrated in the following equations: A linear equation called the super-mixing operation offers added diffusion and confusion, which makes analysis of the ciphertext more challenging. The selection of super-mixing matrices is based on the obtained best linear equations. This allows decreasing the gap in terms of difference in the encryption/decryption processes as well as maintaining a balance in the internal operations.
The generator matrix pertaining to a linear code (m*m) over GF(q) can be defined as a series of expanded algebraic forms that give: G = [C0, C1, C2,…, Cp-1].
The linear diffusion arrays can be defined as the matrix multiplication arranged in a 4*4 square array of bytes, which have been moved via cyclic shifting to the left for the successive row as per the equation order. The implementation of entry values multiplied by the linear equation is similar to the constant circular matrix multiplied by the vector of entry values Y= MDS*V.
The identity matrix is obtained through the forward MDS matrix multiplied by the backward MDS matrix. As stated below, a modulo of reducible polynomial (x 4 +1) is employed to transform the multiplication of the 4-byte column over GF(2 8 ): To implement the inverse super-mixing stage, the state array is multiplied by the backward MDS matrix as the matrix has been deemed invertible. When compared with the encryption implementation, the decryption.

Key Generation Layer
For each round, the key addition process is regarded as the main lock since adding the ciphering key results in termination of all the round transformations. The attacker needs to analyze the XORed operation to perform cryptanalyses with any cipher algorithm, as a majority of the algorithms function is based on the whitening concept of Kerckhoff's principle where XORed is the cipher key at both the end and the start of the algorithm.
The key addition process signifies simplification of the bitwise XORed operation between the cipher key array and the state array, column by column and bit by bit. Both decryption and encryption processes employ the same key addition process as the XORed operation is deemed self-inverse operation.

Proposed Key Generation Process
In both decryption and encryption operations, the ciphering key forms the core algorithm to generate subkeys that need to be kept secret. The ciphering key is a one-way algorithm that allows expanding the initial ciphering key to numerous sub-ciphering keys in a bid to encompass all the rounds. Two complex functions (F and g) were employed to establish the generated cipher key and these functions almost similarly with few minor differences as presented in Fig. 4.
State array of 4*4 byte was received by Function (F), which implemented certain operations on the last word (4-byte). Three simple operations are involved with function (F): subbyte based on the C-Box table, then consider the word's 1st complement and lastly XORed with constant vector1 (b7e15163) as the base natural logarithm. For the Function (g): subbyte based on the C-Box table, rotate towards the right along with cyclic shifting pertaining to the word, XORed with constant vector2 (b7e15163) as a golden ratio.
The two constant vectors were employed, while concatenation of the golden ratio and base natural logarithm vectors were done with forward & backward operations. The key expansion algorithm totally relies on the complex functions to remove weak and semiweak keys and completing the symmetric loop pertaining to the key generation process.
The complex functions are aimed at avoiding the steps in the reverse internal algebraic operations and establish an intractable procedure that would allow analyzing the internally correlated ciphertext. Identical state array of 4*4 byte is received by Function (g) but includes a vertical orientation as well as implementation of certain simple operations on the first word (4-byte). State array of 4*4 for the generated sub-keys of function (F) are twisted and exchange the columns in different order for the state array of Function (g). The exchanging of column order for the state array increase the randomness and the diffusion property for the whole ciphering keys along all rounds.

Analysis and Security Investigation
The key concept behind the put forward design is to establish high confidentiality level as well as effective implementation even when there are constrained resources of hardware that work on different platforms and meet both the present and future needs. To deal with malicious attacks, the put forward cipher employs a coherent internal structure that includes a solid algebraic expression. For each stage, the round transformation is constructed precisely to provide robust encryption layers.
In the first stage, C-Box is built by accounting for high algebraic complexity as well as non-linearity to safeguard against linear and differential attacks. The non-linear stage or the subbyte layer define the strength of any cipher design and is regarded crucial for any algorithm. The design of C-Box is based on the maximum output and input correlation as well as ensuring that the maximum difference propagation probability is kept as small as possible. The put forward C-Box stage employs the polynomial of GF(2 8 ) that is regarded as polynomials possessing a degree that is smaller than eight of coefficients GF(2).
The construction of C-Box is done as a series of compact affine transformations that have a complicated algebraic notation. In backward and forward affine transformations, the two constant vectors and value 00 do not map onto their own value. This suggests that mounting of interpolation attacks is not possible since these do not impact the non-linearity characteristics.
The algorithm that has been recommended constitutes of a strong, robust and satisfactorily long ciphering key, which can withstand most of the commonly known practical attacks. The propagation trail Step F S of the algorithm generally cannot be exploited due to the presence of the internal complex (F) functions, as is the case with algorithms with less number of rounds that get impacted by attacks like the square attack. With due consideration of the practical and theoretical attacks, the proposed C-Box is adopted to be a solid wall since it impacts the entire structure of the algorithm. Table 3, 4 and Fig. 5 show consequences of the implementation time for the AES and the proposed cipher according to several metrics. The proposed algorithm tested with Windows-10 Pro 64-bit, Intel (R) Core-i7 Tm, with HD graphics 5500-CPU, 2.40 GHz, NVIDIA GEFORCE 820m and with the Visual Studio 2013, C# programming language.
The second phase is dependent on the symmetry of the Zigzag-shifting steps that decrease the cost of the Gate Equivalent (GE). It also improves the diffusion property in order to overcome the saturation attacks. The third phase constitutes of the P-Box or Super-Mixing operation that is an MDS form based linear equation, which renders additional confusion and diffusion to the ciphertext, making it even more incomprehensible.
The selection of the suggested MDS matrices is made from the best linear equations of order four. The main objective for selecting MDS was to develop a balance in the internal operations of the linear and non-linear layers and minimize the disparities in the encryption and decryption processes. The last phase involves the inclusion of the secret key to the ciphertext for every round that balances the key expansion or the key scheduling function. To counter the slide attack and to hold sufficient working memory, the key generation algorithm obtains the cipher key using the symmetry round transform. The constant vector and certain simple operations support the key expansion that is necessary to eradicate the probability of the occurrence of weak and semi-weak keys.
The inadequacies of the suggested cipher are that there is involved a certain amount of delay in time implementation in the decryption process. Additionally, in the encryption and decryption processes using the same algorithm, there is no existence of any involutional symmetric structure. The symmetry operation comprises the involutional phases in backward and forward operations that use the same code and implementation. A number of arbitrary statistical tests are executed for the suggested cipher and a realistic result is obtained without any deviation during the course of the testing procedure. An accurate and thorough analysis is required for the suggested cipher structure parts, along with critical scrutiny from designers and analysts to assess the hidden vulnerabilities and disseminate the practical attack. I would be grateful for accepting the advantages and disadvantages resulting from evaluation of the proposed cipher and I would be pleased to accept any scientific criticism which helps improve the work.

Conclusion
A new symmetric algorithm with a robust mathematical composition and an elegant structure has been introduced in this paper. The suggested symmetric cipher model is made up of a new block cipher design where the data block of 128-bit is encrypted with three variable robust ciphering keys. An efficient implementation of the recommended cipher design constitutes of a high-margin of security and is in line with the conventional design.
The proposed cipher is developed securely in order to meet the encryption requirements for the Bitcoin wallets database and the cryptocurrencies applications. This cipher is a byte-oriented cipher that is constructed for general-purpose algorithms and is also suitable for largescale applications. To counter most modern practical attacks, the design of the cipher is improved using an iterated complex round transformation that supports strong ciphering key and solid algebraic construction.