L07-IT-Handouts.Pdf

Total Page:16

File Type:pdf, Size:1020Kb

L07-IT-Handouts.Pdf Today’s Topics Information Theory • Source Coding Techniques • Huffman Code Mohamed Hamada • Two-pass Huffman Code Software Engineering Lab The University of Aizu • Lemple-Ziv Encoding Email: [email protected] • Lemple-Ziv Decoding URL: http://www.u-aizu.ac.jp/~hamada 1 2 Source Coding Techniques Source Coding Techniques 1. Huffman Code. 2. Two-pass Huffman Code. 3. Lemple-Ziv Code. Information 4. Fano code. User of 1. Huffman Code. Source 5. Shannon Code. Information 6. Arithmetic Code. 2. Two-pass Huffman Code. Source Source Encoder Decoder 3. Lemple-Ziv Code. Channel Channel Encoder Decoder 4. Fano code. 5. Shannon Code. Modulator De-Modulator Channel 6. Arithmetic Code. 3 4 Source Coding Techniques Source Coding Techniques 1. Huffman Code. 1. Huffman Code. 2. Two-path Huffman Code. With the Huffman code in the binary case the two least probable source output symbols are joined together, 3. Lemple-Ziv Code. resulting in a new message alphabet with one less symbol 1 take together smallest probabilites: P(i) + P(j) 4. Fano Code. 2 replace symbol i and j by new symbol 3 go to 1 - until end 5. Shannon Code . Application examples: JPEG, MPEG, MP3 6. Arithmetic Code. 5 6 1 1. Huffman Code. 1. Huffman Code. For COMPUTER DATA data reduction is ADVANTAGES: • uniquely decodable code lossless no errors at reproduction • smallest average codeword length universal effective for different types of data DISADVANTAGES: • LARGE tables give complexity Huffman is not universal! • sensitive to channel errors it is only valid for one particular type of source: If the source has no probability distribution Huffman code can not applied. 7 8 Huffman Coding: Example Solution A • Compute the Huffman Code for the source Source Symbol Source Stage I shown Symbol Probability Symbol sk p sk Note that: the entropy of S is k s 0.1 0 s2 0.4 1 s1 0.2 H04logS. 2 04. s1 0.2 s2 0.4 1 s3 0.2 s3 0.2 202log. 2 02. s4 0.1 s0 0.1 1 201log. 2 s4 0.1 01. 2.L 12193 9 10 Solution A Solution A Source Stage I Stage II Source Stage I Stage II Stage III Symbol Symbol sk sk s2 0.4 0.4 s2 0.4 0.4 0.4 s1 0.2 0.2 s1 0.2 0.2 0.4 s3 0.2 0.2 s3 0.2 0.2 0.2 s0 0.1 0.2 s0 0.1 0.2 s4 0.1 s4 0.1 11 12 2 Solution A Solution A Source Stage I Stage II Stage III Stage IV Source Stage I Stage II Stage III Stage IV Symbol Symbol sk sk 0 00 s2 0.4 0.4 0.4 0.6 s2 0.4 0.4 0.4 0.6 0 s 0.2 0.2 0.4 0.4 s 0.2 0.2 0.4 0.4 10 1 1 1 0 11 s 0.2 0.2 0.2 s 0.2 0.2 0.2 3 3 1 0 s 0.1 0.2 s 0.1 0.2 010 0 0 1 s 0.1 s 0.1 011 4 4 1 13 14 Solution A Solution A Cont’d Source Symbol Code Source Stage I Stage II Stage III Stage IV Code Symbol Probability word c HS. 2 12193 Symbol k s k pk sk 0 s0 0.1 010 s2 0.4 0.4 0.4 0.6 00 L.04 2 02 . 2 s1 0.2 10 0 02... 2 01 3 01 3 s 0.2 0.2 0.4 0.4 10 s 0.4 00 1 1 2 22. 0 s3 0.2 11 s3 0.2 0.2 0.2 11 1 s 0.1 011 0 4 s 0.1 0.2 010 HH1SL S 0 1 s4 0.1 011 1 THIS IS NOT THE ONLY SOLUTION! 15 16 Another Solution B Cont’d Another Solution B Source Symbol Code Source Stage I Stage II Stage III Stage IV Code Symbol Probability word c HS. 2 12193 Symbol k s k pk sk 0 s0 0.1 0010 s2 0.4 0.4 0.4 0.6 1 L.04 1 02 . 2 s1 0.2 01 0 02... 3 01 4 01 4 s 0.2 0.2 0.4 0.4 01 s 0.4 1 1 1 2 22. 0 s3 0.2 000 s3 0.2 0.2 0.2 000 1 s 0.1 0011 0 4 s 0.1 0.2 0010 HH1SL S 0 1 s 0.1 0011 4 1 17 18 3 What is the difference between Source Coding Techniques the two solutions? • They have the same average length 1. Huffman Code. • They differ in the variance of the average code length 2. Two-pass Huffman Code. K 1 2 2 plkk L 3. Lemple-Ziv Code. k 0 4. Fano Code. • Solution A 2 • σ =0.16 5. Shannon Code. • Solution B • σ2=1.36 6. Arithmetic Code. 19 20 Source Coding Techniques Source Coding Techniques 2. Two-pass Huffman Code. 2. Two-pass Huffman Code. Example This method is used when the probability of symbols in Consider the message: M=ABABABABABACADABACADABACADABACAD the information source is unknown. So we first can estimate this probability by calculating the number of L(M)=32 #(A)=16 p(A)=16/32=0.5 occurrence of the symbols in the given message then we #(B)=8 p(B)=8/32=0.25 can find the possible Huffman codes. This can be #(C)=4 p(C)=4/32=0.125 summarized by the following two passes. #(D)=4 p(D)=4/32=0.125 Pass 1 : Measure the occurrence possibility of each character in the message Pass 2 : Make possible Huffman codes 22 21 0 Source Coding Techniques Lempel-Ziv Coding • Huffman coding requires knowledge of a 1. Huffman Code. probabilistic model of the source 2. Two-path Huffman Code. • This is not necessarily always feasible • Lempel-Ziv code is an adaptive coding 3. Lemple-Ziv Code. technique that does not require prior 4. Fano Code. knowledge of symbol probabilities 5. Shannon Code. • Lempel-Ziv coding is the basis of well-known ZIP for data compression 6. Arithmetic Code. 23 24 4 Lempel-Ziv Coding History Lempel-Ziv Coding Example Input: 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… •Universal: effective for different types of data •Lossless: no errors at reproduction Codebook 123456789 Index Applications: GIF, TIFF, V.42bis modem compression standard, PostScript Level 2 Subsequence 0 1 History: Representation - 1977 published by Abraham Lempel and Jakob Ziv - 1984 LZ-Welch algorithm published in IEEE Computer - Sperry patent transferred to Unisys (1986) Encoding GIF file format Required use of LZW algorithm 25 26 Lempel-Ziv Coding Example Lempel-Ziv Coding Example 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… Codebook 12 3 4 5 6 7 8 9 Codebook 123456789 Index Index Subsequence 0 1 00 Subsequence 0 1 00 01 Representation Representation Encoding Encoding 27 28 Lempel-Ziv Coding Example Lempel-Ziv Coding Example 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… Codebook 12 3 4 5 6 7 8 9 Codebook 12 3 4 5 6 7 8 9 Index Index Subsequence 0 1 00 01 011 Subsequence 0 1 00 01 011 10 Representation Representation Encoding Encoding 29 30 5 Lempel-Ziv Coding Example Lempel-Ziv Coding Example 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… Codebook 12 3 4 5 6 7 8 9 Codebook 12 3 4 5 6 7 8 9 Index Index Subsequence 0 1 00 01 011 10 010 Subsequence 0 1 00 01 011 10 010 100 Representation Representation Encoding Encoding 31 32 Lempel-Ziv Coding Example Lempel-Ziv Coding Example 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… Codebook 12 3 4 5 6 7 8 9 Codebook 12 3 4 5 6 7 8 9 Index Index Subsequence 0 1 00 01 011 10 010 100 101 Subsequence 0 1 00 01 011 10 010 100 101 Representation Representation 1221112 Encoding Encoding 33 34 Lempel-Ziv Coding Example Lempel-Ziv Coding Example Decimal Binary 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… 1 001 2 010 4 100 Codebook 12 3 4 5 6 7 8 9 6 110 Index Codebook 12 3 4 5 6 7 8 9 Index Subsequence 0 1 00 01 011 10 010 100 101 Subsequence 0 1 00 01 011 10 010 100 101 Representation 11424661221112 Representation 11424661221112 Encoding Encoding 0110001 35 36 6 Lempel-Ziv Coding Example Lempel-Ziv Coding Example Decimal Binary Information bits 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1… 1 001 2 010 Source encoded bits 0010 0011 1001 0100 1000 1100 1101 4 100 6 110 Codebook 12 3 4 5 6 7 8 9 Index Codebook 12 3 4 5 6 7 8 9 Index Subsequence 0 1 00 01 011 10 010 100 101 Subsequence 0 1 00 01 011 10 010 100 101 Representation 11 12 42 21 41 61 62 Representation 11424661221112 Encoding Source Code 0010 0011 1001 0100 1000 1100 1101 0010110001 001 100 010 100 110 110 37 38 How Come this is Compression?! Encoding idea Lempel Ziv Welch-LZW • The hope is: Assume we have just read • If the bit sequence is long enough, a a segment w from the text.
Recommended publications
  • Data Compression: Dictionary-Based Coding 2 / 37 Dictionary-Based Coding Dictionary-Based Coding
    Dictionary-based Coding already coded not yet coded search buffer look-ahead buffer cursor (N symbols) (L symbols) We know the past but cannot control it. We control the future but... Last Lecture Last Lecture: Predictive Lossless Coding Predictive Lossless Coding Simple and effective way to exploit dependencies between neighboring symbols / samples Optimal predictor: Conditional mean (requires storage of large tables) Affine and Linear Prediction Simple structure, low-complex implementation possible Optimal prediction parameters are given by solution of Yule-Walker equations Works very well for real signals (e.g., audio, images, ...) Efficient Lossless Coding for Real-World Signals Affine/linear prediction (often: block-adaptive choice of prediction parameters) Entropy coding of prediction errors (e.g., arithmetic coding) Using marginal pmf often already yields good results Can be improved by using conditional pmfs (with simple conditions) Heiko Schwarz (Freie Universität Berlin) — Data Compression: Dictionary-based Coding 2 / 37 Dictionary-based Coding Dictionary-Based Coding Coding of Text Files Very high amount of dependencies Affine prediction does not work (requires linear dependencies) Higher-order conditional coding should work well, but is way to complex (memory) Alternative: Do not code single characters, but words or phrases Example: English Texts Oxford English Dictionary lists less than 230 000 words (including obsolete words) On average, a word contains about 6 characters Average codeword length per character would be limited by 1
    [Show full text]
  • XAPP616 "Huffman Coding" V1.0
    Product Obsolete/Under Obsolescence Application Note: Virtex Series R Huffman Coding Author: Latha Pillai XAPP616 (v1.0) April 22, 2003 Summary Huffman coding is used to code values statistically according to their probability of occurence. Short code words are assigned to highly probable values and long code words to less probable values. Huffman coding is used in MPEG-2 to further compress the bitstream. This application note describes how Huffman coding is done in MPEG-2 and its implementation. Introduction The output symbols from RLE are assigned binary code words depending on the statistics of the symbol. Frequently occurring symbols are assigned short code words whereas rarely occurring symbols are assigned long code words. The resulting code string can be uniquely decoded to get the original output of the run length encoder. The code assignment procedure developed by Huffman is used to get the optimum code word assignment for a set of input symbols. The procedure for Huffman coding involves the pairing of symbols. The input symbols are written out in the order of decreasing probability. The symbol with the highest probability is written at the top, the least probability is written down last. The least two probabilities are then paired and added. A new probability list is then formed with one entry as the previously added pair. The least symbols in the new list are then paired. This process is continued till the list consists of only one probability value. The values "0" and "1" are arbitrarily assigned to each element in each of the lists. Figure 1 shows the following symbols listed with a probability of occurrence where: A is 30%, B is 25%, C is 20%, D is 15%, and E = 10%.
    [Show full text]
  • Image Compression Through DCT and Huffman Coding Technique
    International Journal of Current Engineering and Technology E-ISSN 2277 – 4106, P-ISSN 2347 – 5161 ©2015 INPRESSCO®, All Rights Reserved Available at http://inpressco.com/category/ijcet Research Article Image Compression through DCT and Huffman Coding Technique Rahul Shukla†* and Narender Kumar Gupta† †Department of Computer Science and Engineering, SHIATS, Allahabad, India Accepted 31 May 2015, Available online 06 June 2015, Vol.5, No.3 (June 2015) Abstract Image compression is an art used to reduce the size of a particular image. The goal of image compression is to eliminate the redundancy in a file’s code in order to reduce its size. It is useful in reducing the image storage space and in reducing the time needed to transmit the image. Image compression is more significant for reducing data redundancy for save more memory and transmission bandwidth. An efficient compression technique has been proposed which combines DCT and Huffman coding technique. This technique proposed due to its Lossless property, means using this the probability of loss the information is lowest. Result shows that high compression rates are achieved and visually negligible difference between compressed images and original images. Keywords: Huffman coding, Huffman decoding, JPEG, TIFF, DCT, PSNR, MSE 1. Introduction that can compress almost any kind of data. These are the lossless methods they retain all the information of 1 Image compression is a technique in which large the compressed data. amount of disk space is required for the raw images However, they do not take advantage of the 2- which seems to be a very big disadvantage during dimensional nature of the image data.
    [Show full text]
  • The Strengths and Weaknesses of Different Image Compression Methods Samuel Teare and Brady Jacobson Lossy Vs Lossless
    The Strengths and Weaknesses of Different Image Compression Methods Samuel Teare and Brady Jacobson Lossy vs Lossless Lossy compression reduces a file size by permanently removing parts of the data that may be redundant or not as noticeable. Lossless compression guarantees the original data can be recovered or decompressed from the compressed file. PNG Compression PNG Compression consists of three parts: 1. Filtering 2. LZ77 Compression Deflate Compression 3. Huffman Coding Filtering Five types of Filters: 1. None - No filter 2. Sub - difference between this byte and the byte to its left a. Sub(x) = Original(x) - Original(x - bpp) 3. Up - difference between this byte and the byte above it a. Up(x) = Original(x) - Above(x) 4. Average - difference between this byte and the average of the byte to the left and the byte above. a. Avg(x) = Original(x) − (Original(x-bpp) + Above(x))/2 5. Paeth - Uses the byte to the left, above, and above left. a. The nearest of the left, above, or above left to the estimate is the Paeth Predictor b. Paeth(x) = Original(x) - Paeth Predictor(x) Paeth Algorithm Estimate = left + above - above left Distance to left = Absolute(estimate - left) Distance to above = Absolute(estimate - above) Distance to above left = Absolute(estimate - above left) The byte with the smallest distance is the Paeth Predictor LZ77 Compression LZ77 Compression looks for sequences in the data that are repeated. LZ77 uses a sliding window to keep track of previous bytes. This is then used to compress a group of bytes that exhibit the same sequence as previous bytes.
    [Show full text]
  • An Optimized Huffman's Coding by the Method of Grouping
    An Optimized Huffman’s Coding by the method of Grouping Gautam.R Dr. S Murali Department of Electronics and Communication Engineering, Professor, Department of Computer Science Engineering Maharaja Institute of Technology, Mysore Maharaja Institute of Technology, Mysore [email protected] [email protected] Abstract— Data compression has become a necessity not only the 3 depending on the size of the data. Huffman's coding basically in the field of communication but also in various scientific works on the principle of frequency of occurrence for each experiments. The data that is being received is more and the symbol or character in the input. For example we can know processing time required has also become more. A significant the number of times a letter has appeared in a text document by change in the algorithms will help to optimize the processing processing that particular document. After which we will speed. With the invention of Technologies like IoT and in assign a variable string to the letter that will represent the technologies like Machine Learning there is a need to compress character. Here the encoding take place in the form of tree data. For example training an Artificial Neural Network requires structure which will be explained in detail in the following a lot of data that should be processed and trained in small paragraph where encoding takes place in the form of binary interval of time for which compression will be very helpful. There tree. is a need to process the data faster and quicker. In this paper we present a method that reduces the data size.
    [Show full text]
  • Arithmetic Coding
    Arithmetic Coding Arithmetic coding is the most efficient method to code symbols according to the probability of their occurrence. The average code length corresponds exactly to the possible minimum given by information theory. Deviations which are caused by the bit-resolution of binary code trees do not exist. In contrast to a binary Huffman code tree the arithmetic coding offers a clearly better compression rate. Its implementation is more complex on the other hand. In arithmetic coding, a message is encoded as a real number in an interval from one to zero. Arithmetic coding typically has a better compression ratio than Huffman coding, as it produces a single symbol rather than several separate codewords. Arithmetic coding differs from other forms of entropy encoding such as Huffman coding in that rather than separating the input into component symbols and replacing each with a code, arithmetic coding encodes the entire message into a single number, a fraction n where (0.0 ≤ n < 1.0) Arithmetic coding is a lossless coding technique. There are a few disadvantages of arithmetic coding. One is that the whole codeword must be received to start decoding the symbols, and if there is a corrupt bit in the codeword, the entire message could become corrupt. Another is that there is a limit to the precision of the number which can be encoded, thus limiting the number of symbols to encode within a codeword. There also exist many patents upon arithmetic coding, so the use of some of the algorithms also call upon royalty fees. Arithmetic coding is part of the JPEG data format.
    [Show full text]
  • The Basic Principles of Data Compression
    The Basic Principles of Data Compression Author: Conrad Chung, 2BrightSparks Introduction Internet users who download or upload files from/to the web, or use email to send or receive attachments will most likely have encountered files in compressed format. In this topic we will cover how compression works, the advantages and disadvantages of compression, as well as types of compression. What is Compression? Compression is the process of encoding data more efficiently to achieve a reduction in file size. One type of compression available is referred to as lossless compression. This means the compressed file will be restored exactly to its original state with no loss of data during the decompression process. This is essential to data compression as the file would be corrupted and unusable should data be lost. Another compression category which will not be covered in this article is “lossy” compression often used in multimedia files for music and images and where data is discarded. Lossless compression algorithms use statistic modeling techniques to reduce repetitive information in a file. Some of the methods may include removal of spacing characters, representing a string of repeated characters with a single character or replacing recurring characters with smaller bit sequences. Advantages/Disadvantages of Compression Compression of files offer many advantages. When compressed, the quantity of bits used to store the information is reduced. Files that are smaller in size will result in shorter transmission times when they are transferred on the Internet. Compressed files also take up less storage space. File compression can zip up several small files into a single file for more convenient email transmission.
    [Show full text]
  • Lzw Compression and Decompression
    LZW COMPRESSION AND DECOMPRESSION December 4, 2015 1 Contents 1 INTRODUCTION 3 2 CONCEPT 3 3 COMPRESSION 3 4 DECOMPRESSION: 4 5 ADVANTAGES OF LZW: 6 6 DISADVANTAGES OF LZW: 6 2 1 INTRODUCTION LZW stands for Lempel-Ziv-Welch. This algorithm was created in 1984 by these people namely Abraham Lempel, Jacob Ziv, and Terry Welch. This algorithm is very simple to implement. In 1977, Lempel and Ziv published a paper on the \sliding-window" compression followed by the \dictionary" based compression which were named LZ77 and LZ78, respectively. later, Welch made a contri- bution to LZ78 algorithm, which was then renamed to be LZW Compression algorithm. 2 CONCEPT Many files in real time, especially text files, have certain set of strings that repeat very often, for example " The ","of","on"etc., . With the spaces, any string takes 5 bytes, or 40 bits to encode. But what if we need to add the whole string to the list of characters after the last one, at 256. Then every time we came across the string like" the ", we could send the code 256 instead of 32,116,104 etc.,. This would take 9 bits instead of 40bits. This is the algorithm of LZW compression. It starts with a "dictionary" of all the single character with indexes from 0 to 255. It then starts to expand the dictionary as information gets sent through. Pretty soon, all the strings will be encoded as a single bit, and compression would have occurred. LZW compression replaces strings of characters with single codes. It does not analyze the input text.
    [Show full text]
  • Image Compression Using Discrete Cosine Transform Method
    Qusay Kanaan Kadhim, International Journal of Computer Science and Mobile Computing, Vol.5 Issue.9, September- 2016, pg. 186-192 Available Online at www.ijcsmc.com International Journal of Computer Science and Mobile Computing A Monthly Journal of Computer Science and Information Technology ISSN 2320–088X IMPACT FACTOR: 5.258 IJCSMC, Vol. 5, Issue. 9, September 2016, pg.186 – 192 Image Compression Using Discrete Cosine Transform Method Qusay Kanaan Kadhim Al-Yarmook University College / Computer Science Department, Iraq [email protected] ABSTRACT: The processing of digital images took a wide importance in the knowledge field in the last decades ago due to the rapid development in the communication techniques and the need to find and develop methods assist in enhancing and exploiting the image information. The field of digital images compression becomes an important field of digital images processing fields due to the need to exploit the available storage space as much as possible and reduce the time required to transmit the image. Baseline JPEG Standard technique is used in compression of images with 8-bit color depth. Basically, this scheme consists of seven operations which are the sampling, the partitioning, the transform, the quantization, the entropy coding and Huffman coding. First, the sampling process is used to reduce the size of the image and the number bits required to represent it. Next, the partitioning process is applied to the image to get (8×8) image block. Then, the discrete cosine transform is used to transform the image block data from spatial domain to frequency domain to make the data easy to process.
    [Show full text]
  • Hybrid Compression Using DWT-DCT and Huffman Encoding Techniques for Biomedical Image and Video Applications
    Available Online at www.ijcsmc.com International Journal of Computer Science and Mobile Computing A Monthly Journal of Computer Science and Information Technology ISSN 2320–088X IJCSMC, Vol. 2, Issue. 5, May 2013, pg.255 – 261 RESEARCH ARTICLE Hybrid Compression Using DWT-DCT and Huffman Encoding Techniques for Biomedical Image and Video Applications K.N. Bharath 1, G. Padmajadevi 2, Kiran 3 1Department of E&C Engg, Malnad College of Engineering, VTU, India 2Associate Professor, Department of E&C Engg, Malnad College of Engineering, VTU, India 3Department of E&C Engg, Malnad College of Engineering, VTU, India 1 [email protected]; 2 [email protected]; 3 [email protected] Abstract— Digital image and video in their raw form require an enormous amount of storage capacity. Considering the important role played by digital imaging and video, it is necessary to develop a system that produces high degree of compression while preserving critical image/video information. There is various transformation techniques used for data compression. Discrete Cosine Transform (DCT) and Discrete Wavelet Transform (DWT) are the most commonly used transformation. DCT has high energy compaction property and requires less computational resources. On the other hand, DWT is multi resolution transformation. In this work, we propose a hybrid DWT-DCT, Huffman algorithm for image and video compression and reconstruction taking benefit from the advantages of both algorithms. The algorithm performs the Discrete Cosine Transform (DCT) on the Discrete Wavelet Transform (DWT) coefficients. Simulations have been conducted on several natural, benchmarks, medical and endoscopic images. Several high definition and endoscopic videos have also been used to demonstrate the advantage of the proposed scheme.
    [Show full text]
  • Randomized Lempel-Ziv Compression for Anti-Compression Side-Channel Attacks
    Randomized Lempel-Ziv Compression for Anti-Compression Side-Channel Attacks by Meng Yang A thesis presented to the University of Waterloo in fulfillment of the thesis requirement for the degree of Master of Applied Science in Electrical and Computer Engineering Waterloo, Ontario, Canada, 2018 c Meng Yang 2018 I hereby declare that I am the sole author of this thesis. This is a true copy of the thesis, including any required final revisions, as accepted by my examiners. I understand that my thesis may be made electronically available to the public. ii Abstract Security experts confront new attacks on TLS/SSL every year. Ever since the compres- sion side-channel attacks CRIME and BREACH were presented during security conferences in 2012 and 2013, online users connecting to HTTP servers that run TLS version 1.2 are susceptible of being impersonated. We set up three Randomized Lempel-Ziv Models, which are built on Lempel-Ziv77, to confront this attack. Our three models change the determin- istic characteristic of the compression algorithm: each compression with the same input gives output of different lengths. We implemented SSL/TLS protocol and the Lempel- Ziv77 compression algorithm, and used them as a base for our simulations of compression side-channel attack. After performing the simulations, all three models successfully pre- vented the attack. However, we demonstrate that our randomized models can still be broken by a stronger version of compression side-channel attack that we created. But this latter attack has a greater time complexity and is easily detectable. Finally, from the results, we conclude that our models couldn't compress as well as Lempel-Ziv77, but they can be used against compression side-channel attacks.
    [Show full text]
  • Implementation of a Fast Mpeg-2 Compliant Huffman Decoder
    IMPLEMENTATION OF A FAST MPEG-2 COMPLIANT HUFFMAN DECODER Mikael Karlsson Rudberg ([email protected]) and Lars Wanhammar ([email protected]) Department of Electrical Engineering, Linköping University, S-581 83 Linköping, Sweden Tel: +46 13 284059; fax: +46 13 139282 ABSTRACT 2. HUFFMAN DECODER In this paper a 100 Mbit/s Huffman decoder Huffman decoding can be performed in a numerous implementation is presented. A novel approach ways. One common principle is to decode the where a parallel decoding of data mixed with a incoming bit stream in parallel [3, 4]. The serial input has been used. The critical path has simplified decoding process is described below: been reduced and a significant increase in throughput is achieved. The decoder is aimed at 1. Feed a symbol decoder and a length the MPEG-2 Video decoding standard and has decoder with M bits, where M is the length therefore been designed to meet the required of the longest code word. performance. 2. The symbol decoder maps the input vector to the corresponding symbol. A length 1. INTRODUCTION decoder will at the same time find the length of the input vector. Huffman coding is a lossless compression 3. The information from the length decoder is technique often used in combination with other used in the input buffer to fill up the buffer lossy compression methods, in for instance digital again (with between one and M bits, figure video and audio applications. The Huffman coding 1). method uses codes with different lengths, where symbols with high probability are assigned shorter The problem with this solution is the long critical codes than symbols with lower probability.
    [Show full text]