You are on page 1of 7

Proceedings of the 2nd International Conference on Inventive Communication and Computational Technologies (ICICCT 2018)

IEEE Xplore Compliant - Part Number: CFP18BAC-ART; ISBN:978-1-5386-1974-2

VLSI IMPLEMENTATION OF SMS4 CIPHER


FOR OPTIMIZED UTILIZATION OF FPGA
G.Sai Manoj B.Sravanthi
Department of ECE Department of ECE
Vaagdevi College of Engineering Vaagdevi College of Engineering
Warangal, India Warangal, India
manojgadapa@gmail.com sravanthibsy1997@gmail.com

G.Thirumal Sudheer Raja Venishetty


Department of ECE Department of ECE
Vaagdevi College of Engineering Vaagdevi College of Engineering
Warangal, India Warangal, India
thirumalreddy1503@gmail.com sudheerrajav@yahoo.com

Abstract—SMS4 is a symmetric encryption algorithm, specif- controlling the physical environment of networked terminals
ically a block cipher, designed for data encryption which is and servers, restricting access to data, and maintaining rigor-
used in WAPI(Wide authentication and privacy infrastructure). ous authentication practices. Another method to ensure data
In this paper we evaluate SMS4 encryption algorithm based
on S box circuit architecture . The SMS4 block cipher has integrity is hashing the data received and comparing it with
been implemented in Xilinx Vivado on FPGA Virtex -ultra scale the hash of original message. Cryptography plays a key role
Family. Achieved area is compared with other devices in virtex in ensuring the data integrity.
ultra scale family and Xcvu125-flvb2104-1-i is chosen for its
best performance. The simulation results revealed optimization C. To Ensure Availability
in area.
Index Terms—S box, SMS4 Cipher ,VLSI design, Target device The main concept of availability is data has to be available
FPGA,SMS4 Encryption ,VIRTEX for authorized persons at the right time. It can be ensured by
maintaining all hardware, making hardware repairs immedi-
I. I NTRODUCTION ately and maintaining a perfect functioning operating system
Network Security is vital component in information security environment. Regular backup must be taken, for information
because it is responsible for securing all information passed services that are highly critical .Another appropriate method
through networked computers. It covers large variety of com- to ensure availability is redundancy .
puter networks, in public and private sectors, that are used D. Access Control
in everyday jobs conducting transactions and communications
among businesses, government agencies and individuals. Net- It is the process of preventing an unauthorized use of
work security is involved in organizations and enterprises. resources. If one can access, under which restrictions and con-
Private Networks, are within a company, and others which ditions the access can be occurred, and what is the permission
might be open to public access. In order to achieve fullest level of a given access. [1]
potential of a business and protection from risks and threats Cryptography Network Security is a concept to protect data
we need network security. The following factors are considered transmission over wireless network. Over unreliable network
for developing a secured network. data Security is the main aspect. Cryptography has its origin
in the ancient world.Cryptography is an emerging technology,
A. Confidentiality which is essential for network security.It plays vital role in
The authorized individuals or parties must access and read todays communications and computer networks, protecting ev-
the data. Confidentiality can be compared with privacy. Con- erything from important bank transactions to e-mail and inter-
fidentiality can be protected using few methods such as data net shopping.While classical and modern cryptography employ
encryption, passwords, biometric verification ,user identities . various mathematical techniques to avoid eavesdroppers from
This provides protection for personal information. learning the contents of encrypted messages.Few computer
systems and networks store data, and transfer valuable in-
B. Maintain of Integrity formation which require protection against such unauthorised
The main concept of integrity is assurance or guarantee of access. Suitable communication protocols and cryptography
data received by the receiver without any modification after provide a high degree of protection in communications against
post transmission.To ensure integrity measures to be taken are intruder attacks [2]

978-1-5386-1974-2/18/$31.00 ©2018 IEEE 1225


Proceedings of the 2nd International Conference on Inventive Communication and Computational Technologies (ICICCT 2018)
IEEE Xplore Compliant - Part Number: CFP18BAC-ART; ISBN:978-1-5386-1974-2

Fig. 2. Asymmetric Encryption


Fig. 1. Symmetric Encryption

encryption and decryption in DES.The block size of DES for


Cryptography is the art of concealing information from encryption is of 64-bit [8]. The DES algorithm is widely used
eavesdroppers by means of a secret,that is only known to in military, commercial, and security of communication system
the communicating parties.In cryptography original text or applications[9][10].
unencrypted data is called as ’plaintext’ it is turned into 2) Advanced Encryption Standard (AES): The advance-
a coded equivalent called as ’ciphertext’ using encryption ment of 3DES algorithm is AES [11]. It was introduced in
algorithm.The plain text can be obtained by decrypting the 1997 by the National Institute of Standards and Technol-
ciphertext at receving end. Cipher is the algorithm used to ogy(NIST). AES is based on the Rijndael cipher developed by
transform orginal text or plaintext to cipher text, in other two cryptographers, Joan Daemen and Vincent Rijmen. AES
words, it’s a mechanism of converting understandable data into differ from DES and 3DES due to variables key sizes such as
”meaningless” data.[3] 128, 192, and 256 bits. AES performs encryption on message
blocks of size 128-bit. AES algorithm is used in small devices
E. Encryption
for encrypting a message and also in monetary transaction and
The process of encoding a message or information in such security applications [12].
a way that only authorized parties can access it and those
who are not authorized cannot is known as encryption. The H. Asymmetric Cryptography
encrypted message is an apparently random stream of data.In The public-key cryptography or Asymmetric cryptography
an encryption scheme, the intended information or message, is in which a pair of keys is used to encrypt and decrypt a
referred to as plaintext, is encrypted using an encryption message it arrives securely .The public key is openly accessible
algorithm a cipher generating ciphertext that can be read to everyone in the cryptosystem and the secret key is kept
only if decrypted. secret by authorized person. [13]. Figure 2 Illustrates the
simplified process of Asymmetric Cryptography
F. Decryption Different types of asymmetric cryptography algorithms are.
The reverse operation of encryption is known as decryption. i)RSA (Rivest, Shamir and Adleman) ii)ElGamal iii)ECC
In this process, the receiver end should know both the key 1) RSA (Rivest, Shamir and Adleman): Rivest, Shamir
that was selected by sender during encryption and encrypted and Adleman introduced the RSA algorithm in 1977 [14].
message for decryption. The decryption process needs the RSA is part of asymmetric cryptographic algorithm [15]
correct key and it is impossible without using correct key used for encryption and decryption of the message. Over
very.[4] Most of the successful algorithms perform encryption an insecure channel RSA is widely used in transferring of
and decryption using a key The key-based cryptographic keys.RSA provides authenticity , integrity, confidentiality, and
algorithms can be classified into two , they are symmetric- nonrepudiation of data [16 ]. RSA is employed in online
key cryptography and asymmetric cryptography or publickey money transfer applications[17].
cryptography [5]. 2) ElGamal: ElGamal algorithm was introduced by Taher
ElGamal in 1985 [18]. It is an asymmetric key encryption
G. Symmetric Cryptography algorithm which is based on the Diffie-Helman key exchange
Symmetric-key cryptography refers to encryption methods an alternative to RSA for public key encryption. ElGamal is
in which both the sender and receiver share the same key. most commonly used in digital signature generation algorithm
Symmetric key cryptography is also known as private-key called ElGamal signature scheme [19].
cryptography [6].Simplified process of syymmetric encrytpion 3) ECC (Elliptic Curve Cryptography): ECC is known as
is shown in Figure 1. Elliptic Curve Cryptography. It is introduced in 1985 by Neal
Various symmetric cryptography schemes are. i) DES(Data Koblitz and Victor S. Miller. ECC belongs to the category
Encryption Standard) ii) AES(Advanced Encryption Standard) of asymmetric scheme based on elliptic curves. ECC is most
1) Data Encryption Standard (DES): i)Data Encryption widely used in encryption, digital signatures and pseudo-
Standard (DES) introduced in early 1970 at IBM. The design random generators [20].
and structure of DES is based on Horst Feistel structure. DES Block ciphers are fundamental building block of modern
is used for encryption and decryption of message [7]. The key cryptography.Here we are using SMS4 block cipher which
size used in DES is 56-bit.Same secret key is used for both is symmetric encryption algorithm designed for data

978-1-5386-1974-2/18/$31.00 ©2018 IEEE 1226


Proceedings of the 2nd International Conference on Inventive Communication and Computational Technologies (ICICCT 2018)
IEEE Xplore Compliant - Part Number: CFP18BAC-ART; ISBN:978-1-5386-1974-2

encryption.SMS4 block cipher was invented by professor


LU Shu-wang ,first published in 2003 then published
independently by OSCCA(Organization of State Commercial
Administration of China). Finally it is standardized in 2016 as
a Chinese National Standard.It is used for protecting wireless
networks , and is mandatory to use in the Chinese National
Standard for Wireless LAN WAPI (Wired Authentication
and Privacy Infrastructure) standard in order to provide data
confidentiality. SMS4 block cipher need128 bit data and 128
bit key.It uses 8 bit s-box(substitution box). Encryption or
decryption of one block of data is composed of 32 rounds.It
uses non linear key schedule to produce round keys.It is
competetor of AES. Operations used in Sms4 are XOR,
32-bit circular shifts and S-Box applications.The Chinese
WLAN industry widely uses WAPI, and it is supported by
many international organizations like SONY in the relevant
products. SMS4 has prevalent hardware implementations like
Fig. 3. SMS4 Encryption process
(SM4-FPGA) and(SM4-VLSI). [21][22][23].

The rest of this paper is organized as follows.Introduction C. Transformations included


to SMS4 block cipher is described in section II.In section III
Transformation (T) is a reversible substitution function that
expansion of SMS4 algorithm is explained in detail Section
outputs 32 bits from an input of 32 bits.It consists of a non-
IV gives the details about tools used for implementation of
linear transform () and linear transformation, L.
algorithm and presents the Simulation and Synthesis results
of sms4 cipher. Finally, the conclusions are drawn in Section 1) Non linear transformation () : τ is composed of four
V. parallel S-boxes.

II. SMS4 BLOCK CIPHER For a 32-bit input of A, where each ai is a 8-bit string:
A = (a0 , a1 , a2 , a3 )
SMS4 block cipher is a 32 round iterative algorithm, and in
each round one word is modified by adding it to other three The output is a 32-bit B, where eachbi is a 8-bit string:
words with a keyed function. The input data,output data and B = (b0 , b1 , b2 , b3 )
key size is of 128 bits each. It accepts two 128 bit data input
i.e input data and input key .The input given to the data is B can be calculated as follows:(b0 , b1 , b2 , b3 ) = τ (A)
divided into four 32 bit words in which total makes 128 bit
data . The internal iterations in SMS4 operate on former states τ (A) = (Sbox(a0 ), Sbox(a1 ), Sbox(a2 ), Sbox(a3 ))
to generate new states .The output obtained is 128 bit cipher
data after completion of 32 round encryption.General SMS4 For example:
encryption process using Feistel structure is shown in figure The input F0 will produce an output which is read from
3. the S-box table row 9 and column A, results in Sbox(F0) = 18
A. S BOX (substitution box) 2) Linear Substitution L: Whereas output obtained in
The S BOX (substitutionbox) function produces 8-bit output non-linear transformation function τ is used as input to linear
from 8-bit input, represented as Sbox(.) transformation function L. Given B, a 32-bit input
The official depiction of SMS4 S-box is given as a lookup L produces a 32-bit output C
table (LUT) with 16×16 entries where total 256 entries. The C = L(B)
S-box is commonly implemented with the ROM lookup table L(B) = B xor(Bhhh2)xor(B hh10)xor(B hhh18)xor(B hhh24)
where the pre-computed values are stored.Fig 4 depicts the
look up table for S BOX. III. E XPANSION OF SMS4 A LGORITHM
SMS4 algorithm is a block cipher with 128-bit block
B. Operations included size.It includes input data , input key(MK), data out(cipher
LThe major operations used in this SMS4 algorithm are: data)which are of 128 -bit block size and roundkey rki of
, Bitwise exclusive-OR operation of two 32-bit vectors. 32 bit block size. The data output 128-bit cipher is obtained
after 32round encryption.Each encryption round needs a round
<<< n, Left cyclic shift by n bits. key rki ,which is generated with original inputkey(MK) using
Algorithm I.

978-1-5386-1974-2/18/$31.00 ©2018 IEEE 1227


Proceedings of the 2nd International Conference on Inventive Communication and Computational Technologies (ICICCT 2018)
IEEE Xplore Compliant - Part Number: CFP18BAC-ART; ISBN:978-1-5386-1974-2

Fig. 4. SMS4 S-box Look up table

L L
A. Algorithm I Step5: L‘(B) = B (B <<< 13) (B <<< 23)Linear
transformation
Key Input: M K = (M K0 , M K1 , M K2 , M K3 )
L
Step6: ki L‘(B) gives rki (round key)which is 32 bit data
Here MK is key supplied by user. Flowchart for algorithm I
is depicted in Figure 5. Output : rki (round key)
Step1: L
(K0 , K1 , K2 , KL
L 3 ) = (M K0 F K0 , M K1
L
F K1 , M K2 F K2 , M K3 F K3 ) B. Algorithm II
Here FK is 32-bit system parameters defined in hexadecimal
F K0 = (A3B1BAC6) F K1 = (56AA3350) F K2 = Input: X = (X0 , X1 , X2 , X3 ) 128 bits.X is user supplied
(677D9197)3 = (B27022DC) data i.e plain text. Figure 6. illustrates the flow chart for
Algorithm II.
Step2: L L L L
L L L L Xi+4 = Xi T (Xi+1 Xi+2 Xi+3 rki )where
rki = ki+4 = ki T ki+1 Ki+2 Ki+3 CKi )where
i=(0,1,2,3..31)
i=(0,1,2,3,31)
*The value of rki (round key) is obtained in Algorithm I
Step3:
CKi,j = (4 ∗ i + j) ∗ 7(mod256) where i=(0,1,2,3..31) and Let L A L be L data obtained from
j=(0,1,2,3) (Xi+1 Xi+2 Xi+3 rki ) 32 bits data
L L L
Let T(ki+1 ki+2 ki+3 Cki ) be A-key Input: A= (a0 , a1 , a2 , a3 )

Input: AKEY = (a0 , a1 , a2 , a3 ) which is of 32 bit data Step7: B = (b0 , b1 , b2 , b3 ) =


(Sbox(a0 ), Sbox(a1 ), Sbox(a2 ), Sbox(a3 ) 32 bit data(non
Step4: BKEY = (b0 , b1 , b2 , b3 ) = linear transformation)
(Sbox(a0 ), Sbox(a1 ), Sbox(a2 ), Sbox(a3 )) L L
Non linear transformation Step8:
L L(B) = LB (B <<< 2) (B <<<
10) (B <<< 18) (B <<< 24) 32 bit data(linear

978-1-5386-1974-2/18/$31.00 ©2018 IEEE 1228


Proceedings of the 2nd International Conference on Inventive Communication and Computational Technologies (ICICCT 2018)
IEEE Xplore Compliant - Part Number: CFP18BAC-ART; ISBN:978-1-5386-1974-2

Fig. 7. Encryption results of sms4 cipher

Fig. 5. Flow chart for Algorithm I

Fig. 8. Obtained encrypted output data from sms4 cipher encryption

Fig. 6. Flow chart for Algorithm II


simulated employing Verilog using vivado design suite as
workstation.Synthesised using Virtex-ultra scale family de-
vices.Figure 11 and Figure 12. illustrates the RTL View
transformation) and Technology Schematic when implemented over selected
FPGA.
L
Step9: Xi L(B) gives Xi+4 which is 32 bit data

Output: Y = (Y0 , Y1 , Y2 , Y3 ) = ((X35 , X34 , X33 , X32 )) for


i=0 to 31.Y is Cipher text obtained after 32 rounds.

*Decryption can be easily implemented using exactly the


same algorithm with encryption,but the reverse order of round
keys.

IV. SIMULATION AND SYNTHESIS


In this section we presented the simulation and synthesis
results when these are implemented on FPGA Virtex -ultra
scale Family Xcvu125-flvb2104-1-i device. Figure 7. and
Figure8.depicts the encryption results while Figure 9.,Figure
10. shows decryption results . The SMS4 cipher have been Fig. 9. Decryption results of sms4 cipher

978-1-5386-1974-2/18/$31.00 ©2018 IEEE 1229


Proceedings of the 2nd International Conference on Inventive Communication and Computational Technologies (ICICCT 2018)
IEEE Xplore Compliant - Part Number: CFP18BAC-ART; ISBN:978-1-5386-1974-2

Fig. 10. Obtained decrypted output data from sms4 cipher decryption
Fig. 13. overview of sms4 cipher on target device (FPGA Virtex-Ultra scale
Family - Xcvu125-flvb2104-1-i)

Fig. 14. Utilization graph on a target device (FPGA Virtex -ultra scale Family
Fig. 11. RTL view of SMS4 Cipher xcvu440-flga2892-1-c)

A. Performance Analysis
Table I indicates the FPGA resource utilization and also
presents the performance analysis when implemented on
FPGA device. The choosen FPGA device utilizes less percent
of LUTs,Flip flops ,IO,BUFG which boost up the operation
of the device.

B. Comparision
The Table I shows the comparision of area on various FPGA
devices of Virtex Ultra Scale family .It is found that FPGA
Xcvu125-flvb2104-1-i uses less area as compared with other
devices.

V. CONCLUSION
Utilization of area plays a vital role in design of an
electronic circuit.The results presented in this work shows
the optimization of the above factor.When SMS4 cipher is
Fig. 12. Technology schematic of sms4 cipher implemented on Xcvu125-flvb2104-1-i device .Which can
provide high operation speed due to presence of 2520 BRAMs

TABLE I
FPGA R ESOURCE U TILIZATION TABLE II
VARIOUS FPGA R ESOURCE U TILIZATION C OMPARISION
Resource Utilization Available Utilization%
LUT’s 641 716160 0.09 Device LUT’S FF IO BUFG
FF 265 1432320 0.02 Xcvu125-flvb2104-1-i 0.09 0.02 74.36 0.08
IOB 522 702 74.36 Xcvu440-flga2892-1-c 0.03 0.01 35.85 0.07
BUFG 1 1200 0.08 Xcvu125-flva2104-1H-e 0.09 0.02 62.74 0.08
Xcvu440-flgb2377-1-c 0.03 0.01 40.15 0.07

978-1-5386-1974-2/18/$31.00 ©2018 IEEE 1230


Proceedings of the 2nd International Conference on Inventive Communication and Computational Technologies (ICICCT 2018)
IEEE Xplore Compliant - Part Number: CFP18BAC-ART; ISBN:978-1-5386-1974-2

and it use less power and area which can enhance the operation
of the device.
R EFERENCES
[1] IJARCCE Vol. 5, Issue 3, March 2016 Harish Singh Network Security, A
Challenge Department of Computer Applications DOI 10.17148/IJAR-
CCE.2016.5317
[2] IJCSMC, Vol. 4, Issue. 1, January 2015, pg.201 204 Network Security
with Cryptography Prof. Mukund R. Joshi, Renuka Avinash Karkade
[3] Sarita Kumari A research Paper on Cryptography Encryption and
Compression Techniques Volume 6 Issue 4 April 2017, Page
No. 20915-20919 Index Copernicus value (2015): 58.10 DOI:
10.18535/ijecs/v6i4.20
[4] Rahman MM*, Akter T and Rahman A Development of Cryptography-
Based Secure Messaging System DOI: 10.4172/2167-0919.1000142
Department of Computer Science and Engineering, Jatiya Kabi Kazi
Nazrul Islam University, Bangladesh
[5] Diffie W, Hellma M (1976) New Directions in Cryptography. IEEE
Transactions on Information Theory 22.
[6] Ayushi A Symmetric Key Cryptographic Algorithm 2010 International
Journal of Computer Applications (0975 - 8887) Volume 1 No. 15
[7] D. Sukhija, Performance Evaluation of Cryptographic Algorithms: AES
and DES, vol. 3, no. 9, pp. 582585, 2014.
[8] S. S. and K. Annapoorna Shetty, A Review on Asymmetric Cryptogra-
phy RSA and ElGamal Algorithm, Int. J. Innov. Res. Comput. Commun.
Eng., vol. 2, no. Special issue 5, p. 98, 2014.
[9] R. Tripathi and S. Agrawal, Comparative Study of Symmetric and Asym-
metric Cryptography Techniques, Int. J. Adv. Found. Res. Comput., vol.
1, no. 6, pp. 6876, 2014.
[10] E. Barker, A. Roginsky, G. Locke, and P. Gallagher, Transitions:
Recommendation for Transitioning the Use of Cryptographic Algorithms
and Key Lengths, NIST Spec. Publ., no. January, pp. 800 131, 2011.
[11] H. O. Alanazi, B. B. Zaidan, a. a. Zaidan, H. a. Jalab, M. Shabbir, and
Y. Al-Nabhani, New Comparative Study Between DES, 3DES and AES
within Nine Factors, J. Comput., vol. 2, no. 3, pp. 21519617, 2010.
[12] A. Sterbenz and P. Lipp, Performance of the AES Candidate Algorithms
in Java, Third Advanced Encryption Stand. Candidate Conf. April 13–
14, 2000, New York, NY, USA, pp. 161168, 2000.
[13] David Pointcheval Asymmetric Cryptography and Practical Security
Journal of Telecommunications and Information Technology. Vol-
ume4/2002.Pages 4156
[14] R. L. Rivest, A. Shamir, and L. Adleman A Method for Obtaining
Digital Signatures and Public- Key Cryptosystems. Communications of
the ACM, vol. 26, no. 1, pp. 9699, 1983.
[15] A. Al Hasib and A. A. M. M. Haque, A comparative study of the
performance and security issues of AES and RSA cryptography, Proc.
- 3rd Int. Conf. Converg. Hybrid Inf. Technol. ICCIT 2008, vol. 2, no.
November 2001, pp. 505510, 2008.
[16] M. E. Student, Algorithms for Secure Cloud, vol. 3, no. 6, pp. 19, 2014.
[17] G. Bernab and N. Clarke Study of RSA Performance in Java Cards,
2013 .
[18] P. Nalwaya, V. P. Saxena, and P. Nalwaya, A cryptographic approach
based on integrating running key in feedback mode of elgamal system,
Proc. - 2014 6th Int. Conf. Comput. Intell. Commun. Networks, CICN
2014, pp. 719724, 2014.
[19] X. Li, X. Shen, and H. Chen, ElGamal digital signature algorithm of
adding a random number, J. Networks, vol. 6, no. 5, pp. 774782, 2011.
[20] M. S. Anoop, Elliptic Curve Cryptography, Infosecwriters, pp. 111,
2015.
[21] Xuefei Bai Li Guo Lu Huang Yanhua Xu A Fast VLSI Design of SMS4
Cipher Based on Twisted BDD S-box Architecture Publisher: IEEE DOI:
10.1109/NSWCTC.2009.114 05 May 2009
[22] https://en.wikipedia.org/wiki/SM4a lgorithm
[23] Whitfield Diffie, George Ledin SMS4 Encryption Algorithm for Wireless
Networks Published 2008 in IACR Cryptology.

978-1-5386-1974-2/18/$31.00 ©2018 IEEE 1231

You might also like