Circulation in Computer Science Vol2, No6, pp: (25-30), July 2017 https://doiorg/1022632/ccs-2017-252-33 Improved Lempel-Ziv-Welch s Error Detection and Correction Scheme using Redundant Residue Number System (RRNS) Alhassan Abdul-Barik University for Development Studies Faculty of Applied Sciences Department of Computer Science Navrongo, Ghana Mohammed Ibrahim Daabo University for Development Studies Faculty of Applied Sciences Department of Computer Science Navrongo, Ghana Stephen Akobre University for Development Studies Faculty of Applied Sciences Department of Computer Science Navrongo, Ghana ABSTRACT The greatest difficulty of compressing data is the assurance of the security, integrity, and accuracy of the data in storage in volatile media or transmission in network communication channels Various methods have been proposed for dealing with the accuracy and consistency of compressed and encrypted data using error detection and correction mechanisms The Redundant Residue Number System (RRNS) which is a trait of Residue Number System (RNS) is one of the available methods for detecting and correcting errors which involves the addition of extra moduli called redundant moduli In this paper, Residue Number System (RNS) is efficiently applied to the Lempel-Ziv-Welch (LZW) compression algorithm resulting in new LZW-RNS compression scheme using the traditional moduli set, and two redundant moduli added resulting in the moduli set 1, 2, 2 +1, 22 3, 22 +1 for the purposes of error detection and correction This is done by constraining the data or information within the legitimate range of the dynamic range provided by the non-redundant moduli Simulation with MatLab shows the efficiency and fault tolerance of the proposed scheme than the traditional LZW compression method and other related known state of the art schemes Keywords Compression, Correction, Detection, Error, LZW, RNS 1 INTRODUCTION Residue Number System (RNS) and its usage is becoming widespread given that a great deal of computing now takes place in embedded processors including those found in mobile devices Computer chips are also now dense that full testing is impossible or complex, necessitating the need for fault tolerance and the general area of computational integrity [7-9], [12] Data compression is the process of converting an input data stream into another data stream that has a smaller size [1] There exist a number of compression algorithms for compressing different types of file formats including text, image, sound, video or a combination of these which are classified as either lossy or lossless, dictionary or nondictionary based depending on the nature of the output for a specific input [1-6] RNS has been extensively used in various forms for enhancement of data compression algorithms In [12], the fault tolerance and security of information in networks using multi-level RRNS is investigated It states that, RRNS is a trait of RNS which provides reliable communication in networks and can detect and correct errors, and also used in the area of cryptography because of its fast computations Somayyeh et al in [13] also researched on high speed implementation of moduli where they combined RNS, Multi-Level RNS, and One-Hot RNS resulting in Multiple- Valued Logic high speed implementation for moduli This enabled the use of low power design with minimal use of transistors to give a high performing scheme In [14], a cyclic permutation networks modulo arithmetic processor which combines the features of cyclic permutation networks and unidirectional error detecting codes is introduced, which detects any faulty moduli without redundant moduli and also achieves less cost for added fault tolerance Similar research is done in [15] where they presented a multiple error detection and correction scheme based on RRNS which uses Chinese Remainder Theorem (CRT) and novel algorithm that sufficiently simplifies error correcting process for integers and also a reduction of computational complexity In this scheme, the residues are used to compute the erroneous integer using CRT The error value is then computed using either continuous fractions or integer programming There exist a lot of literature on improving the Lempel-Ziv- Welch s (LZW) compression algorithm Alhassan et al [16] also applied computer arithmetic using the traditional moduli set to propose the LZW-RNS (3-Moduli) scheme which shows better performance than the traditional lossless dictionary based LZW algorithm in terms of improved compression efficiency, security, and speed of execution Software implementations of the LZW algorithm are often not fast enough particularly in transmitting through high-speed media The research for hardware implementation of binary data compression of the LZW is therefore presented in [3] In [4] a comparative study of text compression algorithms is done where the LZW is found to be the least performing in terms of bits per compression The LZW is modified by Kaur and Verma [17] as content based addressable memory (CAM) array which utilizes less bits than its ASCII code Parthasarathy et al [18] in their research to determine the existence of secrete information hidden within an image, used Copyright 2017 Alhassan Abdul-Barik et al This is an open-access article distributed under the terms of the Creative Commons Attribution License 40, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
LZW to manipulate 128 input using flipping, substitution, and permutation to achieve encryption and decryption This research therefore applies RNS using the moduli set to the LZW algorithm resulting in new efficient LZW-RNS scheme Two redundant moduli, and are added to detect and correct errors in encrypted and compressed data as applied in RRNS 2 MATERIALS AND METHODS Generally, compression algorithms are categorised into dictionary or non-dictionary based, and lossy or lossless Lossless compression algorithms allow for decoding back the original data whiles lossy allows for an approximation of the original data [1-2], [4-6] 21 The LZW Compression Algorithm In 1984, Terry Welch presented the lossless dictionary based LZW compression algorithm as an improved implementation of the LZ78 algorithm that was created by Jacob Ziv and Abraham Lempel This compression algorithm is simple to implement, and has the potential for very high throughput in hardware implementations [1-2] 22 Residue Number System (RNS) It utilizes remainders to represent numbers Using this method, any information or data symbol to be stored or transmitted, can be uniquely and unambiguously represented as a set of residues: with respect to a set of moduli, where is the remainder of with respect to for All of the moduli should be pair wise relatively prime The product of all moduli is called dynamic range, given by, and determines the maximum number of bits possible in a symbol These residues are mapped into a set of orthogonal sequences and are stored or transmitted in parallel The operations on individual residue channels are mutually independent An n-tuple integer represented by ( ) in RNS where the residue for and is defined as Using CRT, an integer can be calculated from its residue digits ) as follows; M and the interval [M, ) is called the illegitimate range The error detection and correction demands that we constrain the information within the legitimate range [8-9], [11], [14-15] 24 The Conversion Process Convertors are used to change from one number representation to the other A forward convertor converts from Decimal to RNS, and the reverse convertor converts from RNS to Decimal representation respectively [8-9] 241 The Forward Conversion Process The Encoder is designed using the forward convertor to convert from decimal to residue as follows; Given the moduli set,, and, where Let, and be redundant moduli for the purpose of detecting and correcting errors if they exist in the decoding process as well as securing data This results in the moduli set with a corresponding residue set For the given moduli set, any binary number is represented as a number for the original moduli set as in (3) and a number for an inclusion of the redundant moduli as in (4) (3) (4) Since,, the are computed as follows: Which is the least significant bit (LSB) of any number In order to compute the remaining s, the number is partitioned into four blocks,, and where; (5) Where,, and is the multiplicative inverse of with respect to [7-9] 23 Redundant Residue Number System (RRNS) RNS is primarily used for high-speed digital signal processing due to the modular carry free arithmetic operations It is defined by a set of relatively prime integers called non-redundant moduli Error detection and correction properties are introduced by inserting few redundant moduli Thus RRNS is defined by the moduli set Both the non-redundant and redundant moduli should be relatively prime and should satisfy the condition The total dynamic range of RRNS is given by This total range [0, ] is divided into two adjacent intervals in the ranges defined by the non-redundant and redundant moduli The interval [0, M) is called the legitimate range where The first block (ie ) becomes necessary only when the redundant moduli is used, otherwise the first three blocks are sufficient for the computation Which implies; Therefore, and, And in a similar manner the redundant residues and will be computed as follows: (7) (8) (9) (10) 26
and 2411 Implementation (11) Equations (10) (11) can further be simplified as (12) and, (13) Where; Add 1 OPPU Add 2 s c s c Add 3 Add 4 and, (14) Figure 1 Forward Convertor for the Moduli Set OPPU Concatenati C Concatenati D (15) 2412 Architecture The architecture for the computation of the residues is realised through (7) (9) and (12) (15) It begins with an Operands Preparation Unit (OPPU) which prepares the operands by simply manipulating the routing of the bits of the number into the four blocks Equations (14) and (15) involve the joining of bits which do not require any hardware The computation of does not also require any hardware since it is the least significant bit of the number The rest of the process requires regular Carry Save Adders (CSAs) and regular Carry Propagate Adders (CPAs) which takes inputs from the CSAs CSAs take in three inputs whilst the CPAs take in two inputs The schematic diagrams for the proposed forward converter is as follows; Figure 1 Forward Convertor for the LZW-RNS 3-Moduli Set Scheme s c s c Figure 2 Forward Convertor for the Redundant Moduli Set 27
242 The Reverse Conversion Process The Decoder is designed using the reverse convertor to convert from residues to decimal using the CRT according to equation (1) as follows; Given any RNS number with a three residue combination, corresponding to any moduli, then the and the can be computed accordingly and then substituted into the CRT in equation (1) in order to get in binary Example 2: Given that the RNS number respect to the moduli set respectively, we have; ; ; and And the multiplicative inverses are as follows: with in the order (16) } (17) Given the residue set corresponding to the selected first three moduli for and substituting (16) and (17) into (1), according to the CRT will be computed as; 243 Error Handling Mechanism By employing the two redundant moduli and, any error in the residue set during transmission or archiving can be recovered In RRNS, a number represented with an original moduli set (with m number of moduli) can still be represented with the original chosen moduli and redundant moduli ((q-m) number of redundant moduli) The redundancy in the system allows for the reconstruction of that number by using any v combinations of the moduli at the receiver and such RRNS (q, m) code has capability of simultaneously detecting s residue digit errors and correcting t random residue digit errors, if and only if t+s (q-m) [8-9], [11-12], [15] Example 3: The following example illustrates how a single error in the received residue digits is detected and corrected by employing the two redundant moduli For, the two redundant moduli will become and 17; therefore, take Assume that the digit is in error, ie (2, 2, 2, 11, 16) According to CRT, the integer in the range (0, 60) can be recovered by invoking any three moduli and their corresponding residue digits, if no errors occurred in the received RNS representation Let us now attempt to recover the integer represented as (2, 2, 2, 11, 16) by considering all possible cases Once all the possible combinations of three out of five residue digits are retained, it results in: where represents the recovered result by using moduli as well as their corresponding residue digits From these results, we observe that,,, and are all illegitimate numbers, since their values are out of the legitimate range [0, 59] In the remaining five cases, all the results are same and equal to 50, except for Moreover, all these results were recovered from three moduli without including, that is from,,, and which are equal to 50 Hence, we can conclude that the correct result is 50 and there was an error in, which can be corrected by computing 3 RESULTS AND DISCUSSION This scheme consists of a modified encoder and decoder pair with enhanced security, speed, and compression ratio RNS is applied to the ASCII character with decimal representation X which is used in the compression and encryption process using the LZW-RNS proposed scheme The encoder and decoder are then modified to detect and correct errors if they exist using RRNS 31 Performance Analysis of the LZW and Proposed LZW-RNS 3-Moduli Error Scheme The performance analysis of the LZW and proposed RNS- LZW algorithm is done on compression efficiency, security, execution speed, and fault tolerance 32 MatLab Implementation of the Proposed Error Detection and Correction Scheme The error detection and correction performance analysis is done using MatLab Given the non-redundant moduli set and two redundant moduli resulting in the moduli set 28
to be used for the purposes of error detection and correction Example 4 illustrates how the error will be detected and corrected using MatLab Simulation Consider the word Encoding to be encoded and decoded using the LZW-RNS (3-moduli) scheme, and then detect and correct errors using RRNS as follows; For n=3, we have the respective moduli {7, 8, 9, 61, 65}, resulting in respective residues for the word Encoding ; res1 = ([6, 5, 1, 6, 2, 0, 5, 5]); res2 = ([5, 6, 3, 7, 4, 1, 6, 7]); res3 = ([6, 2, 0, 3, 1, 6, 2, 5]); res4 = ([8, 49, 38, 50, 39, 44, 49, 42]); res5 = ([4, 45, 34, 46, 35, 40, 45, 38]);Any possible combinations/permutations encoded and decoded using the LZW-RNS (3-Moduli set) results in the following; Table 1 Encoded and Decoded Results for Error Detection and Correction Iteration Word to Encode, Decode and Check Errors Decoded Word E n C o d i n g 123 69 110 99 111 100 105 110 383 Encodin 124 69 110 99 111 100 105 110 103 Encoding 125 69 110 99 111 100 105 110 103 Encoding 134 69 110 99 111 100 105 110 3092 Encodin 135 69 110 99 111 100 105 110 1013 Encodin 145 69 110 99 111 100 105 110 103 Encoding 234 69 110 99 111 100 105 110 2543 Encodin 235 69 110 99 111 100 105 110 2183 Encodin 345 69 110 99 111 100 105 110 8033 Encodin From Table 1, notice that 103 corresponding to possible combinations ({1, 2, 4}, {1, 2, 5}, and {1, 4, 5}) appears most, within the [0, 210) legitimate dynamic range, and 256 ASCII character range Then, the missing moduli in the combination giving the most appearing message corresponding to position three (3) is modulo nine ( ) Hence, we find the residue of =4 We substitute the residue {4} into the last residue position of res3 as ([6, 2, 0, 3, 1, 6, 2, 4]) instead of ([6, 2, 0, 3, 1, 6, 2, 5]) The message can thus be decoded correctly using the combination without the redundant moduli Finally, the correct recovered word is Encoding 33 Security and Efficiency of the Proposed Scheme The purpose of data compression is to reduce data size, enhance speed of transmission, enhance security as well as fault tolerance The gain in this research in terms of security and efficiency include; the fast residue arithmetic computations, the challenge of having to know the moduli set before data can be hacked, and also having to have assess to the entire network before data can be decoded since data is either stored or transmitted in three bit stream secret order The residual and compartmental transmission of data also enhances the data transfer speed 4 CONCLUSIONS In this paper, Residue Number System (RNS) has been applied to the Lempel-Ziv-Welch s (LZW) algorithm using the moduli set which results in an encoder and decoder pair The decimal representations of the ASCII codes are converted to its residues in a process known as forward conversion and used in the encoding process The encoded message is then transmitted in a three bit stream channels in a secret order The decoder pair receives, reorganise the secret order sent bit stream message and converts it back to the decimal representations through a process known as reverse conversion The process continues with the proposed LZW- RNS scheme until the original message is acquired back Two redundant moduli has been added resulting in the moduli set for the purposes of error detection and correction Finally, the research has led to the development of new efficient compression scheme as well as fault tolerant scheme using RNS and Redundant Residue Number System (RRNS) which performs efficiently than the traditional LZW compression algorithm and other related known state of the art schemes 5 FUTURE RESEARCH WORK The proposed system is efficient in terms of security, compression efficiency, and speed of execution, as well as fault tolerance than the traditional LZW compression algorithm Further research is necessary to investigate the impact of moduli choice on the Lempel-Ziv-Welch s (LZW) algorithm in terms of security, and error detection and correction capabilities 6 REFERENCES [1] Amit, J Comparative Study of Dictionary Based Compression Algorithms on Text Data International Journal of Computer Engineering and Applications, Vol I, Issue II, Pg1-11, India, 2001 [2] Jane, J Trivedi, A Survey on Different Compression Techniques Algorithm for Data Compression, International Journal of Advanced Research in Computer Science and Technology, Volume II, Issue III, Pg1-5, 2014 29
[3] Arif Sobhan, Md, Mamun, Md, Ahmad Ashrif, A B, and Hafizah, H (2013) Hardware Approach of Lempel- Ziv-Welch Algorithm for Binary Data Compression, World Applied Sciences Journal, Vol 22(1), Pp 133-139 [4] Shammugasundaram, S, and Lourdusamy, R, (2012) A Comparative Study of Text Compression Algorithm, International Journal of Wisdom Based Computing, Vol 1(3), India, Pp 68-76 [5] Massachusetts Institute of Technology (MIT), OpenCourseWare; Lecture, LZW [6] Ziv, J, and Lempel, A (1977) A Universal Algorithm for Sequential Data Compression, IEEE Transactions on Information Theory, Vol 23, No 3, Pp 337-343 [7] Gbolagade, K A (2010) Effective Reverse Conversion in Residue Number System Processors, PhD thesis, Delft University of Technology (TU-Delft), The Netherlands, Pp 1-187 [8] Omondi, A and Pumkumar, B (2007) Residue Number Systems: Theory and Implementation, Imperial College Press, 57 Shelton street, Covent Garden, London WC2H 9HE, Pp 5-900 [9] Pahami, B (2007) Computer Arithmetic Algorithms and Hardware Design, Department of Electrical and Computer Engineering, University of California, Santa Barabara, Oxford University Press, New York, Pp 2-200 [10] Mohan, P V A and Preemkumar, A B (2007): RNS-to- Binary Converter for Four-Moduli Set 1, 2, 2 +1, 2 +1 1, IEEE Transaction Circuits Systems, Reg Papers, Vol 54, pp 1245 1254 [11] Yang, L-L and Hanzo, L (2001) Redundant residue number system based error correction codes, Vehicular Technology Conference, VTC 2001 Fall, pp 1472-1476, vol3 [12] Pazahr, A, Mizanian, K, Safi, S M, Taghipour, E S, and Razaei, M (2014) Fault-Tolerant and Information Security in Networks using Multi-level Redundant Residue Number System, Research Journal of Recent Sciences, Volume3(3), pp 89-92 [13] Somayyeh, J J, Mehdi, H, Omid, H, and Keivan, N (2008) High Speed Implementation of moduli, World Applied Sciences Journal, Volume 4(3), pp 332-337 [14] Yavuz Oruc, A, and Lin, M, (1994) A Fault Tolerant Permutation Network Modulo Arithmetic Processor, IEEE Transaction on VLSI Systems, Volume 2(3), pp 312-319 [15] Vik, T G and Mohammad, U S (2008) Multiple Error Detection and Correction Based on Redundant Residue Number Systems, IEEE Transactions on Communications, Volume 56(3), pp 325-330 [16] Alhassan, A, Gbolagade, K A, and Bankas, E K (2015) A Novel and Efficient LZW-RNS Scheme for Enhanced Information Compression and Security, International Journal of Advanced Research in Computer Engineering and Technology (IJARCET), Vol4 (11) ISSN: 2278-1323 Pp 4015-4019 [17] Kaur, S and Verma, S (2012) Design and Implementation of LZW Data Compression Algorithm, International Journal of Information Sciences and Techniques (IJIST), Vol 2(4), Pp 71-81 [18] Parthasaraty, C, Kalpana, G, and Gnanachandran, V (2012) LZW Data Compression for ISP Algorithm, International Journal of Advanced Information Technology, Vol 2(5), Pp 25-36 CCS 2017 ISSN 2456-3692 Published by: CSL Press, USA 30