1. Trang chủ
  2. » Giáo Dục - Đào Tạo

Algorithms and information theory mathem

446 6 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Algorithmic Information Theory Mathematics of Digital Information Processing
Tác giả Peter Seibt
Trường học Universitộ de la Mộditerranộe and Centre de Physique Thộorique
Thể loại thesis
Năm xuất bản 2006
Thành phố Marseille
Định dạng
Số trang 446
Dung lượng 3,71 MB

Cấu trúc

  • 1.1 Entropy Coding (12)
    • 1.1.1 Discrete Sources and Their Entropy (12)
    • 1.1.2 Towards Huffman Coding (17)
    • 1.1.3 Arithmetic Coding (39)
  • 1.2 Universal Codes: The Example LZW (50)
    • 1.2.1 LZW Coding (50)
    • 1.2.2 The LZW Decoder (52)
  • 2.1 The Data Encryption Standard (57)
    • 2.1.1 The DES Scheme (57)
    • 2.1.2 The Cipher DES in Detail (60)
  • 2.2 The Advanced Encryption Standard: The Cipher Rijndael (67)
    • 2.2.1 Some Elementary Arithmetic (67)
    • 2.2.2 Specification of Rijndael (84)
    • 2.2.3 The Key Schedule (93)
    • 2.2.4 Decryption with Rijndael (99)
  • 2.3 The Public Key Paradigm and the Cryptosystem RSA (100)
    • 2.3.1 Encryption and Decryption via Exponentiation (100)
    • 2.3.2 The Cryptosystem RSA (104)
  • 2.4 Digital Signatures (108)
    • 2.4.1 Message Digests via SHA-1 (108)
    • 2.4.2 DSA: Digital Signature Algorithm (119)
    • 2.4.3 Auxiliary Algorithms for DSA (123)
    • 2.4.4 The Signature Algorithm rDSA (129)
    • 2.4.5 ECDSA – Elliptic Curve Digital Signatures (132)
  • 3.1 The Discrete Fourier Transform (178)
    • 3.1.1 Basic Properties (178)
    • 3.1.2 The Fast Fourier Transform Algorithm (189)
  • 3.2 Trigonometric Interpolation (196)
    • 3.2.1 Trigonometric Polynomials (197)
    • 3.2.2 Sampling and Reconstruction (199)
  • 3.3 The Whittaker–Shannon Theorem (204)
    • 3.3.1 Fourier Series (204)
    • 3.3.2 The Whittaker–Shannon Theorem for Elementary (209)
    • 3.3.3 The (Continuous) Fourier Transform: A Sketch (215)
    • 3.3.4 The Sampling Theorem (220)
  • 4.1 The Reed–Solomon Codes (226)
    • 4.1.1 Preliminaries: Polynomial Codes (226)
    • 4.1.2 Reed–Solomon Codes (230)
  • 4.2 Convolutional Codes (244)
    • 4.2.1 Encoding: Digital Filtering in Binary Arithmetic (244)
    • 4.2.2 Decoding: The Viterbi Method (258)
  • 5.1 DFT, Passband Filtering and Digital Filtering (273)
  • 5.2 The Discrete Cosine Transform (279)
    • 5.2.1 Functional Description of the DCT (280)
    • 5.2.2 The 2D DCT (298)
    • 5.2.3 The Karhunen–Lo` eve Transform and the DCT (310)
  • 5.3 Filter Banks and Discrete Wavelet Transform (319)
    • 5.3.1 Two Channel Filter Banks (319)
    • 5.3.2 The Discrete Wavelet Transform (377)

Nội dung

Entropy Coding

Discrete Sources and Their Entropy

We shall consider memoryless discrete sources, producing words (strings of letters, of symbols, of characters) in an alphabet {a 0 , a 1 , , a N − 1 } of N symbols.

We shall call p j =p(a j )≡the probability of (the production of) the lettera j ,0≤j ≤

Notation p = (p 0 , p 1 , , p N−1 ) ≡ the probability distribution which de- scribes the production of our source.

– Regarding the alphabet: think of{0,1}(a binary source: for example, a bi- nary facsimile image) or of{00000000,00000001, ,11111111} (a source of 256 symbols, in 8-bit byte representation: for example, the ASCII char- acter code).

– Regarding the memoryless production: this is a condition of probabilistic modelling which isvery strong Namely:

For a word w = a j 1 a j 2 ã ã ãa j n of lengthn, the statistically independent pro- duction of its letters at any moment is expressed by the identity p(w) =p(a j 1)p(a j 2)ã ã ãp(a j n ).

This identity suggests that the likelihood of a word can be determined by multiplying the probabilities of its individual letters It likens the generation of our source to the repeated roll of a loaded die, where the die's faces represent the letters of the alphabet, and the probability distribution p outlines the results of this process.

This straightforward modeling approach has significant advantages beyond its simplicity; it effectively illustrates the worst-case scenario for data compression As the correlation in our data production increases, we can expect improvements in compression efficiency, aligning with the principles of a careful and minimalist design.

We now have a straightforward method for modeling that includes a "commutation rule," enabling us to determine what constitutes a letter, or an atom of our alphabet For instance, in the context of a binary source, we can analyze specific words.

The frequencies of the symbols 0 and 1 can vary significantly, indicating that the source cannot be classified as memoryless for the binary alphabet {0,1} However, a more detailed statistical analysis may reveal that it can be treated as a memoryless source when considering the alphabet of 8-bit bytes.

Entropy measures the average information content of a generic symbol produced by a discrete source, quantified in bits per symbol It serves as a scaling factor for the minimal bit representation, indicating that 1,000 symbols generated by the source correspond to 1,000 times the entropy in bits.

Prelude The information content of a message.

LetI(w) be the quantity of information contained in a wordw that is pro- duced by our source We search a definition for I(w) which satisfies the following two conditions:

(1) I(w) is inversely proportional to the probabilityp(w) of the production ofw (“the less it is frequent, the more it is interesting”).

Moreover, we want the information content of asureevent to bezero.

The information content of a word can be calculated as the sum of the information contents of its individual letters, reflecting our hypothesis of statistical independence in letter production.

Passing to the synthesis of (1) and (2), we arrive at the following condition:

1 p(w) where the real function F has to be strictly monotone (increasing) and must satisfy the identity F(xãy) =F(x) +F(y) as well as

Now, there is essentially only one (continuous) functionF which satisfies our conditions: thelogarithm.

Thus the following definition comes up naturally.

[ Recall : y = Log 2 x⇐⇒x= 2 y ⇐⇒x= e yLn 2 ⇐⇒y= Ln Ln 2 x ]

But why the logarithm to the base 2?

Answer We want the unity of the information content to be the bit. Let us make things clearer with two examples.

(a) Consider a source which produces a 0 = heads and a 1 = tails with the same probability ( p = (p 0 , p 1) = 1

That is logical: when tossing coins with equal chance, heads is naturally coded by 0 and tails is naturally coded by 1.

(b) Let us pursue this line of thought: now, our outcome will be the 256 in- tegers between 0 and 255 (rolling a very, very big dice with 256 faces), all of equal chance: p= (p 0 , p 1 , , p 255 ) = 1

I(a 0 ) I(a 1 ) =ã ã ã=I(a 255 ) =−Log 2 2 −8 = 8 Once more: no surprise; assuming equal chance, the information content of any of the integers 0,1, ,255 has to be 8 bits: they are 8-bit bytes!

Letp= (p 0 , p 1 , , p N−1 ) be the probability distribution which describes the (memoryless) production of the letters of our alphabet.

Definition of the entropyof the source:

H(p)≡theaverage quantity of informationper symbol (in bits per symbol)

(1) Compute the entropy of the source which produces the eight letters a 0 , a 1 , , a 7, according to the probability distributionp= (p 0 , p 1 , , p 7) with p 0= 1 2 , p 1= 1 4 , p 2=p 3= 16 1 , p 4=p 5=p 6=p 7= 32 1

(2) Let us consider a memoryless source which produces four letters a 0 , a 1 , a 2 , a 3, according to the probability distributionp= (p 0 , p 1 , p 2 , p 3).

Let us change our viewpoint Consider the source as a producer of the 16 symbols a 0 a 0 , a 0 a 1 , , a 3 a 2 , a 3 a 3, according to the product distribution p (2) = (p 00 , p 01 , , p 23 , p 33) withp ij =p i p j , 0≤i, j≤3.

Our situation: the alphabet{a 0 , a 1 , , a N −1 }will remain fixed; we shall vary the probability distributions .

(1) H(p) = 0 ⇐⇒ The source produces effectively only one letter

(for example the lettera 0),withp(a 0) = 1.

Recall: a sure event has information content zero.

Hence: the entropy will be minimal(will be zero) as a characteristic of a constant source production.

Thus, we extrapolate (and we are right):

In this case, we have H(p) = Log 2 N.

(1) A binary source produces a 0 = white and a 1 = black according to the probability distributionp= (p 0 , p 1 ).

Find the condition on the ratio white/black which characterizesH(p)< 1 2

Consider p= (p 0 , p 1 , , p N − 1) and q= (q 0 , q 1 , , q N − 1), two strictly positive probability distributions (no probability value is zero).

(a) Show that − N−1 j=0 p j Log 2 p j ≤ − N −1 j=0 p j Log 2 q j (b) Show that the inequality above is an equality ⇐⇒ p=q.

(c) Deduce from (b): every probability distributionp= (p 0 , p 1 , , p N − 1) satisfies H(p)≤Log 2 N with equality⇐⇒ p 0 =p 1 =ã ã ã=p N − 1 1

(a) Recall: Lnx≤x−1 for allx >0 with equality⇐⇒x= 1.

(b) You should get from (a) the following inequality

≤0, where all the terms of the sum are non-positive This is the clue.]

Consider a memoryless source which produces theNsymbolsa 0 , a 1 , , a N −1 , according to the probability distributionp= (p 0 , p 1 , , p N −1 ).

In Shannon's 1948 theory, each letter \( a_j \) is assigned a value of \( I(a_j) \) bits, where \( 0 \leq j \leq N-1 \) This concept leads to the idea of pairing the symbols of an alphabet with binary code words of variable lengths, ensuring that the length of each code word corresponds to the information content of the respective letter For simplicity, we initially assume that all probabilities are powers of 2, allowing the information contents to be represented as whole integers.

Let l j be the length (the number of bits) of the code word associated to the lettera j , 0≤j ≤N−1.

Let us look at the average lengthl of the code words: l=p 0 l 0 +p 1 l 1 +ã ã ã+p N−1 l N−1

Note thatl is ascaling factor: our encoder will transform 1,000 symbols pro- duced by the source (in conformity with the statistics used for the construction of the code) into 1,000×l bits.

But, since we were able to choose l j =I(a j ),0≤j ≤N−1, we shall get l=H(p).

Example Recall the source which produces the eight lettersa 0 , a 1 , , a 7, ac- cording to the probability distributionp= (p 0 , p 1 , , p 7) with p 0= 1 2 , p 1 1

In our chosen encoding scheme, we represent the letters as follows: a 0 is encoded as 0, a 1 as 10, a 2 as 1100, a 3 as 1101, a 4 as 11100, a 5 as 11101, a 6 as 11110, and a 7 as 11111 By using this code, we can encode the eight letters with an average length of l = H(p) = 2.125 bits, which is more efficient than the three bits required for each letter when assuming equal probability without statistics.

Without statistical evaluation, 10,000 source symbols require conversion into 30,000 bits However, by utilizing our encoder that leverages source statistics, we can efficiently transform those same 10,000 letters into just 21,250 bits, demonstrating a significant compression.

Important remark concerning the choice of the code words in the ex- ample above.

Our analysis of the eight code words reveals that none of them serves as a prefix for another, which indicates that we have established a binary prefix code This concept is crucial, as it ensures clear and unambiguous communication in various applications.

Let us try to decode 001010 We realize that there are three possibilities:

The decoding challenge arises from the fact that the code word for A serves as a prefix for the code word for B, leading to potential ambiguity However, in our example, decoding remains straightforward and uncomplicated.

McMillan (1956) demonstrated that any variable length binary code that allows for a unique decoding process is isomorphic to a prefix code This foundational principle underscores our commitment to prefix codes in the subsequent discussion.

Towards Huffman Coding

Between 1948 and 1952, the field of information theory experienced a surge of groundbreaking ideas, initiated by Claude Shannon, the theory's pioneer This period culminated in 1952 with the introduction of Huffman's algorithm, which exemplified the concept of elegance in information theory.

Do not forget that the theory we shall expose is built upon the rather restrictive hypothesis of amemoryless source 1

The Kraft Inequality and its Consequences

Let us consider a memoryless source producing N letters, a 0 , a 1 , , a N −1, according to the probability distributionp= (p 0 , p 1 , , p N −1 ).

Shannon’s coding paradigm Associate toa 0 , a 1 , , a N −1 words of a binary code, such that the lengthsl 0 , l 1 , , l N−1 , of the code words will correspond to the information contents of the encoded symbols.

We need to make precise the term “will correspond to the information contents of the encoded symbols”.

1 One can do better – but there are convincing practical arguments for simple modelling.

More precisely, we put l j =I(a j ) =−Log 2 p j , 0≤j≤N−1, where means rounding up to the next integer.

Our first problem will now be the following:

Shannon's program raises the question of whether a specified set of lengths, \( l_0, l_1, \ldots, l_{N-1} \), for a binary code can be effectively realized through a binary prefix code To ensure the existence of such a code, certain conditions must be met Additionally, when deriving lengths from a probability distribution in line with Shannon's principles, it is crucial to assess the soundness of this list The inquiry focuses on whether these lengths can consistently be represented by the words of a binary prefix code.

Let us write down most explicitly the Shannon-conditions: l j −1 l j ,0 ≤ j ≤ N − 1 Every word of length l j has

2 l − l j successors on the levell of the binary tree of all binary words The pre-

fix property implies that these level-l-successor sets are all mutually disjoint.

Comparing the cardinality of their union with the number of all words on levell, we get: N−1 j=0 2 l−l j ≤2 l , i.e N−1 j=0 2 −l j ≤1.

⇐=: Put l = max{l j : 0 ≤ j ≤ N −1}, and let n 1 , n 2 , , n l be the numbers of code words of length 1,2, , l that we would like to construct.

By our hypothesis we have: n 1 ã2 −1 +n 2 ã2 −2 +ã ã ã+n l ã2 −l ≤1, i.e. n 1 ã2 −1 ≤1 n 1 ≤2 n 1 ã2 − 1 +n 2 ã2 − 2 ≤1 n 2 ≤2 2 −n 1 ã2

The first inequality shows that we can make our choice on level 1 of the binary tree of all binary words The second inequality shows that the choice on level

2 is possible, after blockade of the n 1 ã2 successors of the choice on level 1. And so on .

The final inequality demonstrates that making a choice at level l is feasible, following the blockade of the n1 ã2 l − 1 successors from level 1, the n2 ã2 l − 2 successors from level 2, and so forth, down to the nl ã2 successors from level l−1 This concludes the proof of our proposition.

(1) You would like to construct a binary prefix code with four words of length

3, and six words of length 4 How many words of length 5 can you add?

(2) Consider an alphabet of four letters: N, E, S, W.

Does there exist a prefix code on this alphabet which consists of two words of length 1, four words of length 2, 10 words of length 3 and 16 words of length 4?

(3) A memoryless source produces eight letters A, B, C, D, E, F, G, H ac- cording to the probability distribution p= (p(A), p(B), , p(H)), with p(A) = 27 64 , p(B) =p(C) = 16 3 , p(D) = 16 1 , p(E) =p(F) = 64 3 , p(G) = 32 1 , p(H) = 64 1

(a) Determine the information content of every letter and compute the entropyH(p) of the source.

(b) Following Shannon’s coding paradigm, find a binary prefix code asso- ciated withp.

(c) Compute the average lengthlof the code words, and compare it with

Kraft’s inequality characterizes prefix codes, leading to a significant theorem: lossless compression cannot achieve efficiency below the entropy limit.

Theorem Consider a memoryless source which producesN lettersa 0 , a 1 , , a N −1 according to the probability distribution p= (p 0 , p 1 , , p N−1 ).

LetCbe some associated binary prefix code, and l N −1 j=0 p j l j , the average length of the code words (in bits per symbol).

Moreover, the binary prefix codes constructed according to Shannon’s idea satisfy the following inequality:l < H(p) + 1.

= Ln 2 1 ã N − 1 j=0 (2 − l j −p j ). But, due to Kraft’s inequality, we have: N − 1 j=0 (2 − l j −p j )≤0, and we are done.

(2) Recall: following Shannon’s idea, one gets for the lengths of the code words associated with our symbols: l j −1 0 This algorithm encodes sequences of symbols by recursively narrowing down an interval that represents the cumulative probability of the symbols, effectively translating the sequence into a single fractional value within that interval By leveraging the specified probability distribution, the algorithm ensures efficient encoding, allowing for optimal compression of data.

(5) The situation as in exercise (4) Suppose that all probabilities are powers of 1 2 :p j = 2 −l j , 0≤j ≤N−1.

Show that in this case the arithmetic code word of a source words 1 s 2 ã ã ãs n is equal to the Shannon code word (obtained by simple concatenation of the code words fors 1 , s 2 , , s n ).

(6) A memoryless source, producing theN lettersa 0 , a 1 , , a N − 1 according to the (“decreasing”) probability distributionp= (p 0 , p 1 , , p N − 1). Lets 1ands 2 be two source words such thatc(s 1) =c(s 2) (they have the samearithmetic code word).

Show that either s 1 is a prefix of s 2 ors 2 is a prefix ofs 1.

[ Solution s 1 points at [A m , B m [. s 2 points at [C n , D n [.

Our hypothesis: A m = 0ãα 1 α 2 ã ã ãα l ∗, C n = 0ãα 1 α 2 ã ã ãα l ∗, where l −Log 2 (B m −A m ) =−Log 2 (D n −C n )

We have only to show that [C n , D n [⊆[A m , B m [ (this inclusion implies that s 1 is a prefix ofs 2 ).

Hence,|C n −A m | ≥2 −l , i.e the binary notations ofA m and ofC n would already differ (at least) at the lth position after the comma But this is a contradiction to our hypothesis above ]

The arithmetic decoder reconstructs the source stream from the code stream by interpreting the encoding decisions conveyed within the code Each choice made by the encoder corresponds to identifying a source symbol, a process that the decoder must replicate accurately.

This is the occasion where our modelling in terms of (chains of) intervals will be helpful.

First, consider the situation from astaticviewpoint The decoder can take into account thecompletecode streamα 1 α 2 ã ã ãα L

This means that we face the code wordc(A n , B n ) of an interval

We search: the source stream s 1 s 2 ã ã ãs n , which points at this interval (in the Shannon partition tree whose structure comes from the lexicographic ordering of the pointers).

Let us look at the following.

Example A (memoryless) source producing the three lettersa,b,c according to the probability distributionpgiven byp(a) = 3 4 ,p(b) =p(c) = 1 8

Our terminal interval [A n , B n [ is described by

The decoding will consist of keeping track of theencoder’s decisions.

The logical main argumentfor decoding is the following: the hierarchy of the Shannon partition tree accepts onlychains of intervalsorempty intersec- tions.

Whenever a single point within an interval is positioned to the left or right of a division point, the entire interval will also be situated entirely to the left or right of that point.

Let us begin with the decoding.

A n andD 2have thesamebinary notation – until the masked part ofA n

Question How shall we continue?

Justification If we suppose thatA n =D 2 ands 5=c, then we have found a source word s=s 1 s 2 s 3 s 4 s 5 =abaac with the code word 10011011 (note that I(abaac) = 3×0.42 + 3 + 3 = 7.26).

In this analysis, we assume that only the letter 'a' is produced in the sequence, resulting in the left endpoint of the code interval being A5 = A6 = A7, and the sequence s1 s2 s3 s4 s5 s6 s7 equals 'abaacaa' The information content for this sequence is calculated as I(abaacaa) = 5×0.42 + 3 + 3 = 8.1 This source word generates a code word, and extending the sequence to s1 s2 s3 s4 s5 s6 s7 s8 results in 'abaacaaa' with an information content of I(s1 s2 s3 s4 s5 s6 s7 s8) = 8.52 Further extending to s1 s2 s3 s4 s5 s6 s7 s8 s9 gives 'abaacaaaa', yielding an information content of I(s1 s2 s3 s4 s5 s6 s7 s8 s9) = 8.94.

We obtain this way three source words s 1 s 2 s 3 s 4 s 5 s 6 s 7 , s 1 s 2 s 3 s 4 s 5 s 6 s 7 s 8 , s 1 s 2 s 3 s 4 s 5 s 6 s 7 s 8 s 9 , which produce the same code word 100110111.

Back to the question: why A n = 2,493 4,096 ?

Under this hypothesis, we achieve a coherent and logical decoding However, based on exercise (6) from the previous section, it is established that any string of source symbols corresponding to the code word 100110111 must be a prefix of abaacaaaa.

The conclusion of our decoding algorithm hinges on the necessity of a complete message; specifically, the received code bits must correspond to a valid code word within a defined interval.

In our example, the initial three bits of the code stream are 101, which does not correspond to a code word within the specified partition tree of the probability distribution To decode, we need to identify the first two source symbols The sequence 101 serves as the prefix for the binary representation of the greatest lower bound, A, of an interval [A, B[ encountered during the encoding process.

We note: A < 3 4 = D 1 ≡ the inferior division point of the first step of the encoder,

The division points of the second step (inside the interval [A 1 , B 1[0, 3 4

The case s 1 s 2=ac givesA 2= 0.10101, and this is ok.

The cases 1 s 2=abneeds a closer inspection of the possible continuations. And indeed: the code word of s 1 s 2 s 3 =abc is 1010010, since the second division pointD 2inside [A 2 , B 2[= 9

Universal Codes: The Example LZW

LZW Coding

Situation A source produces a stream of letters, taken from a finite alphabet.

The encoder creates a dictionary of characteristic strings from the source stream, implicitly generating statistics about the source production The compressed message consists of a series of pointers, which are numerical representations assigned to the strings in the dictionary This method of coding utilizes fixed-length code words.

Theprincipal aimof the encoding algorithm is the writing of a dictionary:

Strings of characters←→ Numbers for these strings

The production of the code stream (i.e of the sequence of pointers) is (logically) secondary.

The encoding algorithm works in three steps:

(1) Read the next characterx (arriving from the source).

(2) Complete acurrent string s(which is waiting in a buffer for admission to the dictionary) by concatenation:s−→sx.

To effectively manage the current string, write it into the dictionary as soon as it is deemed admissible and not already present If the string is known, revert to the previous step Additionally, send off the count of occurrences of 's' at the moment you add 'sx' to the dictionary, initializing the count as 'x'.

The enigmatic delay in the encoder's output occurs because the encoder generates the code word for 'sat' only when it writes 'sx' into the dictionary.

The decoder must reconstruct the dictionary using the received code stream, as the encoder's dictionary does not persist after compaction This process requires a delay between writing and production; without it, the decoder would be unable to reconstruct the dictionary effectively.

Let us recapitulate the encoding algorithm in a more formalized version.

STEP: read the next character x of the source stream.

If no characterx (end of message), then produce the code word (the pointer) of the current strings; end.

If the stringsx exists already in the table, then replaces by the new current stringsx; repeat STEP.

If the stringsx is not yet in the table, then writesx in the table, produce the code ofs and puts=x; repeat STEP.

Example Initialization of the dictionary: (1)a

Read Produce Write Current string

(3)c b b a (2) (4)ba a c (1) (5)ac c a (3) (6)ca a c ac a (5) (7)aca a b (1) (8)ab b a ba b (4) (9)bab b a ba b bab a (9) (10)baba a c ac a aca b (7) (11)acab b a ba

Look, once more, how the source stream is transformed into the code stream: b a c ac a ba bab aca ba

(1) The situation of the preceding example.

Encode now baba caba baca caba baba caba.

(3) (a) Give an example of an LZW encoding which produces a sequence of pointers of the type .( )( ) .(i.e with a pointer doubled). (b) Does there exist sequences of LZW code words of the type

The LZW Decoder

The primary objective of the decoder is to reconstruct the encoder's dictionary by accurately interpreting the stream of code words it receives This process involves the essential task of decoding, which includes identifying the code words effectively.

Thecurrent string s, candidate for admission to the dictionary, will still remain in the centre of the algorithm Let us begin immediately with an example.

Read Produce Write Current string

The initial two columns of data are derived from mechanical identification based on the decoder's input, while the final two columns result from a backward projection The encoder's role is to write into the dictionary by appending a single character to the current string, with each dictionary word accompanied by a "dispersed pyramid" of its prefixes During decoding, the encoder's non-writing steps are eliminated, allowing for writing at each stage.

At the start of each decoding step, the current string serves as the prefix for the next dictionary entry, and we add the first character of the decoded string.

At the conclusion of each decoding step, the current string matches the decoded string, as indicated by the identical entries in the "produce" and "current string" columns of our decoding model When a code word is identified, the demasked string is recorded in the encoder's journal, reflecting a slight output delay during the encoding process.

Example The situation is as in the first example Decode (2)(1)(4)(6).

Read Produce Write Current string

In our decoding scheme, we must identify a pointer that initially points to nothing in the dictionary, yet gains meaning at this stage It's essential to construct a string in the format of "bax" (current string plus a new character), which simultaneously serves as the decoded string Consequently, the character 'x' must be the first character of the decoded string, leading to the conclusion that 'x' equals 'b'.

(= the first character of the current string).

To identify a code word that is not yet in the dictionary, we follow a systematic approach similar to previous examples At the end of the last step, we encounter a fatal pointer By applying our decoding rules, we generate the output: sx write: ( ) : sxput:s = sx, where x represents an unknown character This character will be determined based on the rule that x equals the first character of the current string s.

The question remains: what is the encoding constellation which provokes the exceptional case of the decoder?

Exercise Show that the exceptional decoding case comes from the following encoding situation: the encoder sends off the last pointer available in the dictionary.

Let us sum up, in pseudo-program version, the functioning of our decoder:

To process the code stream, begin by reading the next pointer (n) If no such pointer exists, the process ends If the string associated with (n) is not found in the dictionary, generate a new entry using the first character of the current string, add it to the dictionary, and replace the current string with this new entry If the string at (n) is present in the dictionary, output that string, add a new entry based on the current string, and update the current string accordingly Continue this process until completion.

At its 76th decoding step the decoder encounters an exceptional case. What is the number of this pointer?

(a) What is the bitstream which is encoded in (0)(1)(2)(3)(4)(5)(6)(7)(8) (9)(10)(11)?

(b) Let us continue: we shall produce in this way all the integers, in natural order, from 0 to 65,535.

Let us write the pointers in 16 bits What will be the compressed bit-rate ρ= number of code bits number of source bits?

In this exercise, we analyze a binary source that generates a bitstream consisting of LZW codes ranging from 0 to 65,535 By modeling this source as a memoryless source with an alphabet of 256 unique 8-bit bytes, we can estimate the source statistics and calculate its entropy The entropy of this memoryless source reflects the average amount of information produced per byte, providing insight into the efficiency of the data representation.

Cryptography encompasses both the theoretical and practical elements of data security, focusing on the design and validation of algorithmic methods Its primary objectives are to ensure the integrity, authenticity, and confidentiality of data during transmission and storage.

The realm of cryptosystems is diverse, yet many established ciphers stem from fundamental concepts in elementary number theory This article focuses on key encryption algorithms, starting with the simple Data Encryption Standard (DES) and progressing to the more complex AES-Rijndael, which requires a deeper mathematical understanding We delve into core cryptosystems based on exponentiation in multiplicative groups, beginning with the widely recognized RSA system, which introduced elementary arithmetic to cryptography The discussion then expands to public key systems, including digital signature algorithms like DSA, which shares a mathematical foundation with RSA, and its variants rDSA and ECDSA, the latter utilizing elliptic curves to highlight the practical applications of advanced mathematics Lastly, we examine the SHA-1 hash algorithm, a unique twist on the traditional DES.

The Data Encryption Standard

The DES Scheme

The DES algorithm converts 64-bit plaintext blocks into 64-bit ciphertext blocks, utilizing user-defined cipher keys that are 56 bits long These keys are represented in a 64-bit format, which includes eight parity-check bits located at positions 8, 16, and so on.

24, 32, 40, 48, 56, 64 The same algorithm is used as well for encryption as for decryption 2

Global Structure of the Algorithm

The algorithm works in three principal steps:

1 The plaintext blockT =t 1 t 2 ã ã ãt 64is first treated by a fixedinitial permu- tation IP, which shuffles, in a highly regular manner, the binary positions of the eight 8-bit bytes.

2 Then follow 16 iterations (16 rounds) of a transformation which depends, at each round, on anotherround key, extracted from the cipher key of the user by an auxiliary algorithm (the key schedule).

3 The result of the 16 rounds has still to undergo the permutation IP − 1 , the inverse of the initial permutation, in order to become the ciphertext block.

1 Omitting all preliminary definitions and generalities, we shall consider DES as an introductory example for cryptographic language.

2 A strange statement – to be explained in a moment.

Scheme of the Algorithm DES plaintext

The Functioning of the 16 Iterations

LetT i be the result of theith iteration, 1≤i≤16.

R i =L i − 1 ⊕f(R i − 1 , K i ) 1≤i≤16 where ⊕means addition of vectors with 32 entries over the fieldF2={0,1} (in another language: we use 32 times the Boolean operation XOR) f is a

The "mixing function" takes two arguments: the right half of the current state, which is 32 bits, and the current round key, which is 48 bits The output of this function is a 32-bit value.

Attention The result of the last iteration isR 16 L 16, andIP − 1 will operate onR 16 L 16.

Remark We immediately see that the DES scheme is “generically”invertible.

More precisely: Every round is invertible – for any cipher key K and every possible choice of the “mixing” functionf You have only to write the round transformation scheme “upside down”:

This basic observation will give rise to an important construction in filter bank theory: The lifting structures We shall treat this subject in the last chapter of our book.

We consider a mini-DES of four rounds, which transforms 8-bit bytes x 1 x 2 ã ã ãx 8 into 8-bit bytes y 1 y 2 ã ã ãy 8 We shall make use of keys K u 1 u 2 ã ã ãu 8 of eight bits. x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8

(b) The algorithm which computes the four round keys: K = u 1 u 2 ã ã ãu 8 will give rise to

(c) The mixing function:f(r 1 r 2 r 3 r 4 , t 1 t 2 t 3 t 4) =z 1 z 2 z 3 z 4 , where z 1=r 1+t 2+r 3+t 4mod 2, z 2=r 2+t 2+r 3+t 3mod 2, z 3=r 1+t 1+r 4+t 4mod 2, z 4=r 2+t 1+r 4+t 3mod 2.

The Symmetry of the Scheme DES

To decrypt the data, we will employ the same algorithm used for encryption, but with the order of the round keys reversed Specifically, K16 will be used for the first iteration, K15 for the second, and this pattern continues until K1 is applied in the final iteration.

Let us show that, indeed,D K (E K (M)) =M for every plaintextM (where

E K andD K are the encryption and decryption transformations for the cipher keyK).

The symmetry of the DES scheme is independent of the plaintext block size, the number of rounds, the mixing function, and the key schedule, allowing for considerable variation in its implementation.

The Cipher DES in Detail

It is described by the following table:

63 55 47 39 31 23 15 7You have to read line by line: IP(t 1 t 2 ã ã ãt 63 t 64) =t 58 t 50 ã ã ãt 15 t 7.

IP systematically rearranges the bit positions of the eight 8-bit bytes that make up the 64-bit block T, ensuring that each new byte contains exactly one bit from each of the original bytes.

2 The function f and the S-boxes:

The first argument R of the function f is a 32-bit string, the second J has length 48, and the resultf(R, J) will have 32 bits The operations are orga- nized according to the following scheme:

The initial argument of the function f undergoes a transformation into a 48-bit string through an expansion process defined by the expansion table E This process organizes all bits of R in a natural sequence, resulting in 16 repetitions of each bit.

– E(R)⊕J is computed, and the result B is treated as a block of eight substrings made of six bits:B=B 1 B 2 B 3 B 4 B 5 B 6 B 7 B 8

– The following step makes use of eight S-boxes S 1 , S 2 , S 8 Every S j transforms its blockB j of six bits into a blockC j of four bits, 1≤j≤8.

– The stringC=C 1 C 2 C 3 C 4 C 5 C 6 C 7 C 8 of length 32 is reorganized according to a fixed permutation P The resultP(C) will be f(R, J).

The operation of expansionE is defined by the following table:

28 29 30 31 32 1 Read it line by line: E(r 1 r 2 r 3 ã ã ãr 32 ) =r 32 r 1 r 2 ã ã ãr 32 r 1

Before explaining the functioning of theS-boxes, we shall present them all:

The functioning of theS-boxes:

Consider a 6-bit stringB j =b 1 b 2 b 3 b 4 b 5 b 6 We shall compute a 4-bit string

The two bits b 1 b 6 are considered to be the binary notation of the indexr of one of the four lines ofS j , 0≤r≤3.

The four bitsb 2 b 3 b 4 b 5constitute the binary notation of the indexsof one of the 16 columns of the table, 0≤s≤15.

S j (B j ) will be the 4-bit notation of the entry S j (r, s).

Remark The known criteria (made public in 1976) for the design of the

0 Every line of anS-box is a permutation of the integers 0, 1, , 15.

1 NoS-box is an affine transformation.

2 The modification of a single input bit of anS-box causes the modification of at least two output bits.

3 For every S-box S and all B = b 1 b 2 b 3 b 4 b 5 b 6 , S(B) and S(B ⊕001100) differ in at least two bits.

4 For every S-box S and all B = b 1 b 2 b 3 b 4 b 5 b 6 we have S(B) S(B⊕11αβ00) forα, β∈ {0,1}.

5 For every S-box, if an input bit is kept constant and if we are only inter- ested in a fixed output position, the number of quintuples which produce

The number of quintuples yielding 0 and those producing 1 are closely aligned with the average, ranging from 13 to 19 Specifically, when the fixed bit is either b1 or b6, there are exactly 16 values that result in 0 and 16 values that result in 1, based on the established criterion.

Finally, the permutationP (which seems to be meant as a remedy to the local treatment of the data):

22 11 4 25 Read line by line: P(c 1 c 2 c 3 ã ã ãc 32) =c 16 c 7 c 20 ã ã ãc 4 c 25.

The cipher key K is a 64-bit string, with 56 bits serving as the actual key and 8 bits designated for parity-check The parity bits, located at positions 8, 16, , and 64, ensure that each 8-bit byte contains an odd number of ones, allowing for the detection of single-bit errors During the generation of round keys, the parity-check bits are disregarded.

1 Starting with the 64 bits of K, one skips first the parity-check bits, and permutes the key bits; the operationP C −1 ( permuted choice) finally givesC 0 D 0 =P C −1(K) where C 0 is the block of the 28 firsts bits of

P C−1(K) andD 0 the block of the remaining 28 bits.

The equation D i = LS i (D i − 1) and K i = P C−2(C i, D i) describes a process where LS i represents a cyclic left shift that varies in position based on the value of i; it shifts by one position for i values of 1, 2, 9, or 16, and by two positions otherwise Additionally, P C−2 is a permuted choice function that skips eight positions to ultimately generate 48-bit strings.

The two selective permutations P C−1 andP C−2, operating for the com- putation of the round keys, are:

(1) A mini-DES with four iterations, transforming 8-bit bytes into 8-bit bytes. The keys will have also eight bits.

(a) The initial permutation:IP(x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8) =x 8 x 5 x 2 x 7 x 4 x 1 x 6 x 3. (b) The key schedule: LetK=u 1 u 2 u 3 u 4 u 5 u 6 u 7 u 8, thenK 1=u 4 u 1 u 3 u 8 u 5 u 7,

Compute first the binary word b 1 b 2 b 3 b 4 b 5 b 6 from R i − 1 = r 1 r 2 r 3 r 4 and

(⊕: Boolean XOR, componentwise) Then, we shall use the following S- box:

3 6 11 13 8 1 4 10 7 9 5 0 15 14 2 3 12 b 1 b 2 b 3 b 4 b 5 b 6 points at a lineb 1 b 6 and at a column b 2 b 3 b 4 b 5 of theS-box. f(R i−1 , K i ) will be the 4-bit notation of the integer which occupies the entry.

(2) Now we deal with usual DES.

The plaintext:M ≡8af1ee80a6b7c385 Write down the fifth 8-bit byte of

(3) Let B = 0f e31e4f b0f0 (48 bits; you have to think in 8 times six bits). FindS(B) (32 bits – in hexadecimal notation).

The cipher key: 01 01 01 01 01 01 01 01 (56 zeros – the ones are the parity-check bits).

(5) Letc(.) denote the operation of complementation for binary words (p.ex.: c(0110) = 1001).

In the encryption process, let y represent the ciphertext derived from the plaintext block x and the cipher key K using the DES algorithm It can be demonstrated that the ciphertext of the complemented plaintext and key, denoted as c(y), is equal to the DES encryption of the complemented plaintext c(x) and the complemented key c(K) This illustrates that complementing both the plaintext and the key results in the complement of the ciphertext.

(6) The round keys may be obtained from the cipher key of the user by means of “selection tables” Find the selection table for K 6

(7) Let K = abababababababab (64 bits) be your cipher key Which is your sixth round key K 6 (48 bits, in hexadecimal notation)?

Notation The inputs: B,B ∗ , etc (six bits)

The outputs:C,C ∗ , etc (four bits).

(a) For an input modification B and an output variation C of (S 1 ) let support(B −→ C ) = {B : S 1 (B ⊕B ) ⊕S 1 (B) = C } Find support(110100−→0100) – a set of two elements.

(b) Observation: The first six bits of the round key K 1 are the bits k 10, k 51, k 34, k 60, k 49, k 17 of the cipher key Let R 0 = 00001ã ã ã0 and

We observe: The two outputs of theS 1-boxC andC ∗ ( coming fromR 0 and from R ∗ 0 ) differ only at the second position (C⊕C ∗ = 0100).Findk 17, k 34 andk 49(we shall make use of the result of (a)).

The Advanced Encryption Standard: The Cipher Rijndael

The Public Key Paradigm and the Cryptosystem RSA

Digital Signatures

The Discrete Fourier Transform

Trigonometric Interpolation

The Whittaker–Shannon Theorem

The Reed–Solomon Codes

Convolutional Codes

The Discrete Cosine Transform

Filter Banks and Discrete Wavelet Transform

Ngày đăng: 26/01/2022, 17:22

w