90 likes | 230 Views
Chapter 3 Section 1 Number Representation. Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation of Numbers Ordinary numbers that we see each day are represented as base 10. The numbers are a sum of powers of 10.
E N D
Chapter 3 Section 1 Number Representation • Modern cryptographic methods, unlike the classical methods we just learned, are computer based. • Representation of Numbers • Ordinary numbers that we see each day are represented as base 10. • The numbers are a sum of powers of 10. • Example 1: Write 12341 as sum of powers of 10…
Representation of Numbers • Binary Numbers • Binary Numbers are base 2 numbers. • They are represented by just two digits: 0, and 1. • Examples of binary numbers • Definition of a binary number • Example 2: Find decimal equivalent of the binary number 100. • Example 3: Find decimal equivalent of the binary number 1011000 • Example 4: Find the decimal equivalent of the binary number 1110001011…
Representation of Numbers • To convert a decimal (base 10) number to binary, we divide the number by 2, getting a quotient and remainder. This process repeats itself until the quotient is zero. Reading the resulting remainders from last to the first gives the binary representation of the number. • Example 5: Convert 77 to binary • Example 6: Convert 320 to binary • Example 7: Convert 687 to binary…
Approximating the Size of Binary Numbers • Many times the strength of a cryptographic method is expressed in terms of the size of a particular parameter. • Many times this parameter is expressed by the number of binary digits the number has. • Base 10 Number Size Binary Bound Estimate • Example 8: 32 bit number bound estimate • Definition: Given a real number x, we say that ceil(x) is the smallest integer greater than x. • Example: ceil(29.6) = 30. • Estimate of the number of binary digits required to express a base 10 decimal number. • Example 9: Approximate how many binary digits are used to represent the number 430121…
Conversion to Numbers Involving Other Bases • Definition: A number of any given base. • Example 10: Convert the numeral 5476 from base 8 to base 10. • For bases that are larger than 10 we need additional digits. We use letters for these digits: A, B, C, D, etc. • Digits For Base 12 & 16 • Example 11: Convert EA3 base 16 to base 10…
Converting From Base 10 Numbers to an Arbitrary Base • To convert a decimal (base 10) number to an arbitrary base a, we divide the number by a, getting a quotient and remainder. The quotient is then divided by a, obtaining a new quotient and remainder. This process repeats itself until the quotient is zero. Reading the resulting remainders from the last to the first gives the base a representation of the number. • Example 12: Convert 689 to base 5. • Example 13: Convert 45134 to Hexadecimal…
Converting From Binary to Hexadecimal • The Binary to Hexadecimal Table. • Write the binary number in blocks of 4 digits. If there are not enough fill in on the left with 0’s. • Using the table, convert each four digit binary block to its hexadecimal equivalent. • Example 14: Convert 1100111101 to hexadecimal. • Example 15: Convert 1011110111100111 to hexadecimal. • Example 16: Convert A61F0 to binary. • Example 17: Convert 72E1C5 to binary…
Binary XOR Operation • The binary XOR operation has the following properties: • If two things are true (value of 1) then the result of the xor operation is false (value of 0). • If two things are false (value of 0) then the result of the xor operation is false • If exactly one of the two is true, and therefore the other is false, then the result of the xor operation is true. • Example 18: Compute xor of two numbers • Example 19: Compute xor of two numbers …
ASCII Codes for Characters • So far we have used MOD 26 alphabet assignment table to assign numerical values to each letter. Computers normally use the ASCII (American Standard Code for Information Interchange) for obtaining numerical representation of characters. • Example 20: Find numerical ASCII representation. • Example 21: Decode ASCII number message…!