Misplaced Pages

Checksum

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage . By themselves, checksums are often used to verify data integrity but are not relied upon to verify data authenticity .

#570429

42-405: The procedure which generates this checksum is called a checksum function or checksum algorithm . Depending on its design goals, a good checksum algorithm usually outputs a significantly different value, even for small changes made to the input. This is especially true of cryptographic hash functions , which may be used to detect many data corruption errors and verify overall data integrity ; if

84-595: A binary search algorithm (with cost ⁠ O ( log ⁡ n ) {\displaystyle O(\log n)} ⁠ ) outperforms a sequential search (cost ⁠ O ( n ) {\displaystyle O(n)} ⁠ ) when used for table lookups on sorted lists or arrays. The analysis, and study of algorithms is a discipline of computer science . Algorithms are often studied abstractly, without referencing any specific programming language or implementation. Algorithm analysis resembles other mathematical disciplines as it focuses on

126-468: A flowchart offers a way to describe and document an algorithm (and a computer program corresponding to it). It has four primary symbols: arrows showing program flow, rectangles (SEQUENCE, GOTO), diamonds (IF-THEN-ELSE), and dots (OR-tie). Sub-structures can "nest" in rectangles, but only if a single exit occurs from the superstructure. It is often important to know how much time, storage, or other cost an algorithm may require. Methods have been developed for

168-745: A function . Starting from an initial state and initial input (perhaps empty ), the instructions describe a computation that, when executed , proceeds through a finite number of well-defined successive states, eventually producing "output" and terminating at a final ending state. The transition from one state to the next is not necessarily deterministic ; some algorithms, known as randomized algorithms , incorporate random input. Around 825 AD, Persian scientist and polymath Muḥammad ibn Mūsā al-Khwārizmī wrote kitāb al-ḥisāb al-hindī ("Book of Indian computation") and kitab al-jam' wa'l-tafriq al-ḥisāb al-hindī ("Addition and subtraction in Indian arithmetic"). In

210-435: A heuristic is an approach to solving problems that do not have well-defined correct or optimal results. For example, although social media recommender systems are commonly called "algorithms", they actually rely on heuristics as there is no truly "correct" recommendation. As an effective method , an algorithm can be expressed within a finite amount of space and time and in a well-defined formal language for calculating

252-422: A "fuzzy checksum" reduces the body text to its characteristic minimum, then generates a checksum in the usual manner. This greatly increases the chances of slightly different spam emails producing the same checksum. The ISP spam detection software, such as SpamAssassin , of co-operating ISPs, submits checksums of all emails to the centralised service such as DCC . If the count of a submitted fuzzy checksum exceeds

294-405: A certain threshold, the database notes that this probably indicates spam. ISP service users similarly generate a fuzzy checksum on each of their emails and request the service for a spam likelihood. A message that is m bits long can be viewed as a corner of the m -dimensional hypercube . The effect of a checksum algorithm that yields an n -bit checksum is to map each m -bit message to

336-680: A computer-executable form, but are also used to define or document algorithms. There are many possible representations and Turing machine programs can be expressed as a sequence of machine tables (see finite-state machine , state-transition table , and control table for more), as flowcharts and drakon-charts (see state diagram for more), as a form of rudimentary machine code or assembly code called "sets of quadruples", and more. Algorithm representations can also be classified into three accepted levels of Turing machine description: high-level description, implementation description, and formal description. A high-level description describes qualities of

378-719: A computing machine or a human who could only carry out specific elementary operations on symbols . Most algorithms are intended to be implemented as computer programs . However, algorithms are also implemented by other means, such as in a biological neural network (for example, the human brain performing arithmetic or an insect looking for food), in an electrical circuit , or a mechanical device. Step-by-step procedures for solving mathematical problems have been recorded since antiquity. This includes in Babylonian mathematics (around 2500 BC), Egyptian mathematics (around 1550 BC), Indian mathematics (around 800 BC and later),

420-452: A corner of a larger hypercube, with dimension m + n . The 2 corners of this hypercube represent all possible received messages. The valid received messages (those that have the correct checksum) comprise a smaller set, with only 2 corners. A single-bit transmission error then corresponds to a displacement from a valid corner (the correct message and checksum) to one of the m adjacent corners. An error which affects k bits moves

462-614: A function returning the start of a string can provide a hash appropriate for some applications but will never be a suitable checksum. Checksums are used as cryptographic primitives in larger authentication algorithms. For cryptographic systems with these two specific design goals, see HMAC . Check digits and parity bits are special cases of checksums, appropriate for small blocks of data (such as Social Security numbers , bank account numbers, computer words , single bytes , etc.). Some error-correcting codes are based on special checksums which not only detect common errors but also allow

SECTION 10

#1732780392571

504-696: A message, the receiver adds all the words in the same manner, including the checksum; if the result is not a word full of zeros, an error must have occurred. This variant, too, detects any single-bit error, but the pro modular sum is used in SAE J1708 . The simple checksums described above fail to detect some common errors which affect many bits at once, such as changing the order of data words, or inserting or deleting words with all bits set to zero. The checksum algorithms most used in practice, such as Fletcher's checksum , Adler-32 , and cyclic redundancy checks (CRCs), address these weaknesses by considering not only

546-525: A programmer can write structured programs using only these instructions; on the other hand "it is also possible, and not too hard, to write badly structured programs in a structured language". Tausworthe augments the three Böhm-Jacopini canonical structures : SEQUENCE, IF-THEN-ELSE, and WHILE-DO, with two more: DO-WHILE and CASE. An additional benefit of a structured program is that it lends itself to proofs of correctness using mathematical induction . By themselves, algorithms are not usually patentable. In

588-477: A sequence of operations", which would include all computer programs (including programs that do not perform numeric calculations), and any prescribed bureaucratic procedure or cook-book recipe . In general, a program is an algorithm only if it stops eventually —even though infinite loops may sometimes prove desirable. Boolos, Jeffrey & 1974, 1999 define an algorithm to be an explicit set of instructions for determining an output, that can be followed by

630-472: Is a finite sequence of mathematically rigorous instructions, typically used to solve a class of specific problems or to perform a computation . Algorithms are used as specifications for performing calculations and data processing . More advanced algorithms can use conditionals to divert the code execution through various routes (referred to as automated decision-making ) and deduce valid inferences (referred to as automated reasoning ). In contrast,

672-416: Is a method or mathematical process for problem-solving and engineering algorithms. The design of algorithms is part of many solution theories, such as divide-and-conquer or dynamic programming within operation research . Techniques for designing and implementing algorithm designs are also called algorithm design patterns, with examples including the template method pattern and the decorator pattern. One of

714-581: Is a more specific classification of algorithms; an algorithm for such problems may fall into one or more of the general categories described above as well as into one of the following: One of the simplest algorithms finds the largest number in a list of numbers of random order. Finding the solution requires looking at every number in the list. From this follows a simple algorithm, which can be described in plain English as: High-level description: (Quasi-)formal description: Written in prose but much closer to

756-495: Is an even number of '1's. To check the integrity of a message, the receiver computes the bitwise exclusive or of all its words, including the checksum; if the result is not a word consisting of n zeros, the receiver knows a transmission error occurred. With this checksum, any transmission error which flips a single bit of the message, or an odd number of bits, will be detected as an incorrect checksum. However, an error that affects two bits will not be detected if those bits lie at

798-453: Is useful for uncovering unexpected interactions that affect performance. Benchmarks may be used to compare before/after potential improvements to an algorithm after program optimization. Empirical tests cannot replace formal analysis, though, and are non-trivial to perform fairly. To illustrate the potential improvements possible even in well-established algorithms, a recent significant innovation, relating to FFT algorithms (used heavily in

840-1107: The Entscheidungsproblem (decision problem) posed by David Hilbert . Later formalizations were framed as attempts to define " effective calculability " or "effective method". Those formalizations included the Gödel – Herbrand – Kleene recursive functions of 1930, 1934 and 1935, Alonzo Church 's lambda calculus of 1936, Emil Post 's Formulation 1 of 1936, and Alan Turing 's Turing machines of 1936–37 and 1939. Algorithms can be expressed in many kinds of notation, including natural languages , pseudocode , flowcharts , drakon-charts , programming languages or control tables (processed by interpreters ). Natural language expressions of algorithms tend to be verbose and ambiguous and are rarely used for complex or technical algorithms. Pseudocode, flowcharts, drakon-charts, and control tables are structured expressions of algorithms that avoid common ambiguities of natural language. Programming languages are primarily for expressing algorithms in

882-629: The Jacquard loom , a precursor to Hollerith cards (punch cards), and "telephone switching technologies" led to the development of the first computers. By the mid-19th century, the telegraph , the precursor of the telephone, was in use throughout the world. By the late 19th century, the ticker tape ( c.  1870s ) was in use, as were Hollerith cards (c. 1890). Then came the teleprinter ( c.  1910 ) with its punched-paper use of Baudot code on tape. Telephone-switching networks of electromechanical relays were invented in 1835. These led to

SECTION 20

#1732780392571

924-792: The Ifa Oracle (around 500 BC), Greek mathematics (around 240 BC), and Arabic mathematics (around 800 AD). The earliest evidence of algorithms is found in ancient Mesopotamian mathematics. A Sumerian clay tablet found in Shuruppak near Baghdad and dated to c.  2500 BC describes the earliest division algorithm . During the Hammurabi dynasty c.  1800  – c.  1600 BC , Babylonian clay tablets described algorithms for computing formulas. Algorithms were also used in Babylonian astronomy . Babylonian clay tablets describe and employ algorithmic procedures to compute

966-596: The United States, a claim consisting solely of simple manipulations of abstract concepts, numbers, or signals does not constitute "processes" (USPTO 2006), so algorithms are not patentable (as in Gottschalk v. Benson ). However practical applications of algorithms are sometimes patentable. For example, in Diamond v. Diehr , the application of a simple feedback algorithm to aid in the curing of synthetic rubber

1008-454: The algorithm itself, ignoring how it is implemented on the Turing machine. An implementation description describes the general manner in which the machine moves its head and stores data in order to carry out the algorithm, but does not give exact states. In the most detail, a formal description gives the exact state table and list of transitions of the Turing machine. The graphical aid called

1050-588: The algorithm's properties, not implementation. Pseudocode is typical for analysis as it is a simple and general representation. Most algorithms are implemented on particular hardware/software platforms and their algorithmic efficiency is tested using real code. The efficiency of a particular algorithm may be insignificant for many "one-off" problems but it may be critical for algorithms designed for fast interactive, commercial or long life scientific usage. Scaling from small n to large n frequently exposes inefficient algorithms that are otherwise benign. Empirical testing

1092-403: The analysis of algorithms to obtain such quantitative answers (estimates); for example, an algorithm that adds up the elements of a list of n numbers would have a time requirement of ⁠ O ( n ) {\displaystyle O(n)} ⁠ , using big O notation . The algorithm only needs to remember two values: the sum of all the elements so far, and its current position in

1134-443: The computed checksum for the current data input matches the stored value of a previously computed checksum, there is a very high probability the data has not been accidentally altered or corrupted. Checksum functions are related to hash functions , fingerprints , randomization functions , and cryptographic hash functions . However, each of those concepts has different applications and therefore different design goals. For instance,

1176-521: The earliest codebreaking algorithm. Bolter credits the invention of the weight-driven clock as "the key invention [of Europe in the Middle Ages ]," specifically the verge escapement mechanism producing the tick and tock of a mechanical clock. "The accurate automatic machine" led immediately to "mechanical automata " in the 13th century and "computational machines"—the difference and analytical engines of Charles Babbage and Ada Lovelace in

1218-523: The early 12th century, Latin translations of said al-Khwarizmi texts involving the Hindu–Arabic numeral system and arithmetic appeared, for example Liber Alghoarismi de practica arismetrice , attributed to John of Seville , and Liber Algorismi de numero Indorum , attributed to Adelard of Bath . Hereby, alghoarismi or algorismi is the Latinization of Al-Khwarizmi's name; the text starts with

1260-427: The field of image processing), can decrease processing time up to 1,000 times for applications like medical imaging. In general, speed improvements depend on special properties of the problem, which are very common in practical applications. Speedups of this magnitude enable computing devices that make extensive use of image processing (like digital cameras and medical equipment) to consume less power. Algorithm design

1302-450: The input list. If the space required to store the input numbers is not counted, it has a space requirement of ⁠ O ( 1 ) {\displaystyle O(1)} ⁠ , otherwise ⁠ O ( n ) {\displaystyle O(n)} ⁠ is required. Different algorithms may complete the same task with a different set of instructions in less or more time, space, or ' effort ' than others. For example,

Checksum - Misplaced Pages Continue

1344-490: The invention of the digital adding device by George Stibitz in 1937. While working in Bell Laboratories, he observed the "burdensome" use of mechanical calculators with gears. "He went home one evening in 1937 intending to test his idea... When the tinkering was over, Stibitz had constructed a binary adding device". In 1928, a partial formalization of the modern concept of algorithms began with attempts to solve

1386-503: The message to a corner which is k steps removed from its correct corner. The goal of a good checksum algorithm is to spread the valid corners as far from each other as possible, to increase the likelihood "typical" transmission errors will end up in an invalid corner. General topic Error correction Hash functions File systems Related concepts Algorithm In mathematics and computer science , an algorithm ( / ˈ æ l ɡ ə r ɪ ð əm / )

1428-429: The mid-19th century. Lovelace designed the first algorithm intended for processing on a computer, Babbage's analytical engine, which is the first device considered a real Turing-complete computer instead of just a calculator . Although a full implementation of Babbage's second device was not realized for decades after her lifetime, Lovelace has been called "history's first programmer". Bell and Newell (1971) write that

1470-627: The most important aspects of algorithm design is resource (run-time, memory usage) efficiency; the big O notation is used to describe e.g., an algorithm's run-time growth as the size of its input increases. Per the Church–Turing thesis , any algorithm can be computed by any Turing complete model. Turing completeness only requires four instruction types—conditional GOTO, unconditional GOTO, assignment, HALT. However, Kemeny and Kurtz observe that, while "undisciplined" use of unconditional GOTOs and conditional IF-THEN GOTOs can result in " spaghetti code ",

1512-435: The original data to be recovered in certain cases. The simplest checksum algorithm is the so-called longitudinal parity check , which breaks the data into "words" with a fixed number n of bits, and then computes the bitwise exclusive or (XOR) of all those words. The result is appended to the message as an extra word. In simpler terms, for n =1 this means adding a bit to the end of the data bits to guarantee that there

1554-564: The phrase Dixit Algorismi , or "Thus spoke Al-Khwarizmi". Around 1230, the English word algorism is attested and then by Chaucer in 1391, English adopted the French term. In the 15th century, under the influence of the Greek word ἀριθμός ( arithmos , "number"; cf. "arithmetic"), the Latin word was altered to algorithmus . One informal definition is "a set of rules that precisely defines

1596-418: The same position in two distinct words. Also swapping of two or more words will not be detected. If the affected bits are independently chosen at random, the probability of a two-bit error being undetected is 1/ n . A variant of the previous algorithm is to add all the "words" as unsigned binary numbers, discarding any overflow bits, and append the two's complement of the total as the checksum. To validate

1638-675: The time and place of significant astronomical events. Algorithms for arithmetic are also found in ancient Egyptian mathematics , dating back to the Rhind Mathematical Papyrus c.  1550 BC . Algorithms were later used in ancient Hellenistic mathematics . Two examples are the Sieve of Eratosthenes , which was described in the Introduction to Arithmetic by Nicomachus , and the Euclidean algorithm , which

1680-416: The value of each word but also its position in the sequence. This feature generally increases the cost of computing the checksum. The idea of fuzzy checksum was developed for detection of email spam by building up cooperative databases from multiple ISPs of email suspected to be spam. The content of such spam may often vary in its details, which would render normal checksumming ineffective. By contrast,

1722-449: Was deemed patentable. The patenting of software is controversial, and there are criticized patents involving algorithms, especially data compression algorithms, such as Unisys 's LZW patent . Additionally, some cryptographic algorithms have export restrictions (see export of cryptography ). Another way of classifying algorithms is by their design methodology or paradigm . Some common paradigms are: For optimization problems there

Checksum - Misplaced Pages Continue

1764-692: Was first described in Euclid's Elements ( c.  300 BC ). Examples of ancient Indian mathematics included the Shulba Sutras , the Kerala School , and the Brāhmasphuṭasiddhānta . The first cryptographic algorithm for deciphering encrypted code was developed by Al-Kindi , a 9th-century Arab mathematician, in A Manuscript On Deciphering Cryptographic Messages . He gave the first description of cryptanalysis by frequency analysis ,

#570429