Data integrity — validation and verification
導入済み
15:06
セキュリティ、プライバシー & 完全性
今この瞬間、あなたのデバイスは攻撃を受けています。キーボードにうかがい立つ人間ではなく、無数の自動ボット軍によって、絶え間なくスキャンされています…
英語のナレーション・英語と中国語の字幕を切り替え可能
このレッスンの内容
| English | 意味 |
|---|---|
| software/ˈsɒftweə/ | The programs and instructions that tell a computer what to do. |
| format check/ˈfɔːmæt tʃek/ | A check that data matches a required pattern. |
| integrity/ɪnˈteɡrɪti/ | 完全性 |
| Validation/ˌvælɪˈdeɪʃn/ | Checking whether data meets specified rules for acceptable values or format. |
| Verification/ˌverɪfɪˈkeɪʃn/ | Double entry compares the two email addresses and reports a mismatch if they differ. The computer compares two copies, and it would accept a wrong address typed identically twice. |
| range check/reɪndʒ tʃek/ | 範囲チェック |
| limit check | A check that a value is above or below a set limit. |
| existence (lookup) check | A check that a value appears in an allowed list or table. |
| length check/leŋθ tʃek/ | A check that data has the required number of characters. |
| type / character check | A check that data or its characters are of the required kind. |
| field/fiːld/ | A named component of a record, with its own value and type. |
| presence check/ˈprezəns tʃek/ | A check that a required field has been filled in. |
| check digit/tʃek ˈdɪdʒɪt/ | チェック桁 |
| pseudocode/ˈsuːdəʊkəʊd/ | A language-independent description of an algorithm using structured, programming-like statements. |
| Double entry/ˈdʌbl ˈentri/ | The data is entered twice, by the same person or by two people, and the computer compares the two versions and reports any difference. A new password is the everyday case. |
| Visual check/ˈvɪʒuːəl tʃek/ | The person compares what is on the screen with the original source document and corrects any difference before saving. |
| source document | The original document containing data to be entered or checked. |
| parity check/ˈpærɪti tʃek/ | パリティチェック |
| bit/bɪt/ | A binary digit, taking the value zero or one. |
| byte/baɪt/ | A group of eight bits, commonly used as a unit of data storage. |
| even parity | A method of making the total number of ones even by adding a bit. |
| checksum/ˈtʃeksəm/ | チェックサム |
| block of data | A group of data treated as one unit for processing or transfer. |
| algorithm/ˈælɡərɪθəm/ | A finite sequence of precise steps for solving a problem or carrying out a task. |
| server/ˈsɜːvə/ | A computer or program that provides services or resources in response to requests from clients. |
| cyclic redundancy check/ˈsaɪklɪk rɪˈdʌndənsi tʃek/ | 巡回冗長検査 |
| polynomial division | A way of dividing mathematical expressions to find an answer and a remainder. |
| parity block/ˈpærɪti blɒk/ | A grid of data with extra bits used to detect and locate a single-bit error. |
| parity block check/ˈpærɪti blɒk tʃek/ | パリティブロックチェック |
| row parity bit | An extra bit that makes the number of ones in a row even or odd. |
| parity byte/ˈpærɪti baɪt/ | An extra byte containing parity bits for the columns of a data block. |
| column parity | A check using the number of ones in each column to detect errors. |
| Encryption/enˈkrɪpʃn/ | The process of using a key to turn readable data into unreadable data. |
数字がすべてのチェックを通過したケース
- 1999年9月、NASAのマース・クライメート・オービターが軌道乗入のためエンジン点火を行いましたが、以降消息不明となりました。計画より170km低い高度を飛行し、大気圏で焼失しました。
- 1チームのソフトウェアはポンド力秒単位の推力値を出力しましたが、受信側のソフトウェアはニュートン秒を期待していました。すべての値は妥当な範囲にある正しく構成された数字でした。しかし、すべての値が4.45倍の誤差を含んでいました。
- どの形式チェックもこれを検出することはできなかった。なぜならデータ自体に構造的な不備はなかったからだ。単に、それが自称していた内容とは異なっただけだった。$327百万ドル。
- この教訓は、完全性を守る2種類のチェックの家族に関するものです。バリデーションはデータが妥当かどうかを問うものであり、ベリフィケーションは正しくコピーされたかどうかを問うものです。そしてマーズが落ちた、その隙間です。

2つの質問
- データは正確で、整合性があり、完全であれば、それは完全性があります。
- バリデーションは、入力されたデータが合理的であり、設定されたルールに従っているかを確認する自動チェックです。質問:これは妥当ですか?
- ベリフィケーションは、データが正しく入力または転送されたかを、ソースとの比較や再計算値との比較によって確認します。質問:これは正しくコピーされましたか?
- いずれもデータが真実であることを保証するものではありません。両方が必要です。
コンピューティング概念ラボ
Classify concrete examples by the computing idea they demonstrate.
バリデーション方法
| チェック | ルール | 例 |
|---|---|---|
| レンジチェック | 2つの境界値の間 | 月は1から12 |
| リミットチェック | 単一の境界値の片側 | 年齢 ≥ 18 |
| 存在チェック(照合) | リストや表に値があるか | 製品コードが存在する |
| 長さチェック | 正しい文字数か | 6文字の郵便番号 |
| タイプ/文字種チェック | 正しいデータの種類か | 電話番号のフィールドは数字のみを許可する |
| 形式チェック | パターンと一致するか | メールに @ が含まれる |
| 存在チェック | 必須項目が空でないか | 名前が入力されている |
| チェック桁 | 他から計算された追加の桁 | ISBN、カード番号 |
Checking that a month entered is between 1 and 12 is a:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
A range check confirms a value lies within sensible limits.
Match each validation check to its purpose.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Presence = not empty; format = matches a pattern; check digit = computed to catch mistyped digits.
An extra digit computed from the others to catch a mistyped number (as on ISBNs and card numbers) is a ______ digit.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
A check digit is recomputed from the rest and compared, catching most single-digit and transposition errors.
worked example: 擬似コードが行うチェックの名前を答える
| 擬似コード | チェック |
|---|---|
IF x < 0 OR x > 10 THEN OUTPUT "Invalid" |
範囲チェック: 2つの限度の間にあるか |
IF x = "" THEN OUTPUT "Invalid" |
存在チェック: 空ではないか |
IF NOT(x = "Red" OR x = "Yellow" OR x = "Blue") THEN OUTPUT "Invalid" |
存在チェック(照合): リストに含まれるか |
IF LENGTH(x) <> 6 THEN OUTPUT "Invalid" |
長さチェック: 6文字であるか |
IF MID(x, 1, 1) < "A" OR MID(x, 1, 1) > "Z" THEN OUTPUT "Invalid" |
形式チェック: 最初の文字がアルファベットであるか |
- 車輌登録番号が「1文字+3桁+2文字」の場合、各位置に対して形式チェックを行い、全6文字に対して長さチェックを行う。生年月日に対しては、形式チェック(
DD/MM/YYYY)、範囲チェック(月は1〜12、年は未来ではない)、そして存在チェックが必要である。
Match each line of pseudocode to the validation check it performs.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Empty test = presence; character count = length; two limits = range; a list of allowed values = existence or lookup.
worked example: チェック桁と、それが見逃すエラー
- 単純な方式:チェック桁は桁和を10で割った余りを末尾に付加する。
4162の桁和は13なので、41623として保存される。 - ユーザーが
41523を入力した場合:合計は12になり、チェック桁は2になるはずなので、エラーは検出される。 - ユーザーが
14623を入力した場合:最初の2桁が入れ替わっているが、桁和は依然として13なのでチェック桁は一致し、エラーは検出されない。実際の方式(ISBN、カード番号)では位置ごとに重み付けを行っており、入れ替えにより結果が変わる。

バリデーションが不能なこと
- バリデーションは、誤ってフォーマットされているか、または範囲外データを検出する。
- 正しいフォーマットでありながら事実上誤りであるデータは検出できない。
BobをBibとして入力すればすべてのチェックを通過する。火星へ送られたスラスト機も同様であった。 - それには、ソースとの照合による検証と、入力内容を確認する人間が必要である。
Why can validation still let bad data through?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Validation checks the form, not the truth — a correctly formatted but wrong value passes.
データ入力中の検証
- 二重入力: データを同じ人物または2人の人物によって2度入力し、コンピューターが両方のバージョンを比較して違いがある場合報告する。新しいパスワード設定が日常的な例である。
- 視覚的チェック: 人物が画面に表示された内容与し元の文書を見比べ、保存前に差異を修正する。
- どちらも、保存されたデータがソースと一致することを保証することで整合性を保護する。

Asking a user to type a new password twice is an example of:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Double entry compares two typed copies to verify the data was entered correctly.
データ転送中の検証
- 転送中にビットが反転することがある。パリティチェックでは、各バイトに1つの追加ビットを追加し、1の数を偶数(偶パリティ)または奇数にする。受信側で再カウントを行い、単一ビットの反転はカウント不整合として検出される。
- チェックサムとは、アルゴリズムによってデータブロックから計算され、ともに送信される値である。受信側で再計算・比較を行う。カメラからサーバーへの動画ファイル転送はこの方式で行われ、不一致の場合は再送信となる。
- 巡回冗長符号(CRC)は、多項式除法を用いるより強力なチェックサムであり、多くのエラーパターンを検出できる。

1つの追加ビットで1の数が偶数になります;反転したビットがその平衡を崩します

計算、送信、再計算、比較


A parity check works by:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
The parity bit makes the count of 1s even or odd; the receiver re-counts to detect a single-bit error.
Which are verification methods used during data transfer? Select すべて that apply.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Parity and checksums recompute a value at the receiving end. Double entry and a visual check happen during data entry.
A byte parity check detects every possible transmission error in that byte.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Two flipped bits leave the parity of the count of 1s unchanged, so they pass. Parity detects any odd number of flipped bits.
worked example: パリティブロックがビットを特定する方法
- パリティブロックチェックでは、バイトをグリッド状に配置する。各バイトは行パリティビットを持ち、追加のパリティバイトには上の字节の列パリティが含まれる。
- 偶パリティで4バイトを送信し、その後パリティバイトを送る。各行および各列の1の数を数えると、3番目のバイトには5つ、4番目の列には3つあり、どちらも奇数である。
- その行とその列が交差する位置のビットが変化したビットであるため、1から0にリセットされる。単一パリティビットはエラーを検出しますが、ブロックはそれを特定・修正する。

1行が間違っている、1列が間違っている:ビットは交点にある

Put the steps of a parity block check in order.
難易度 3/5 · 200 コイン + 今日初回達成時の小ボーナス
Rows detect, columns detect, the crossing locates, and the flip corrects. That is what a block adds over a single parity bit.
このカードは修正されたため、翻訳が更新されるまで英語で表示されます。
Worked example: which check catches which error
- A user types their date of birth as
31/02/2009, then types their email address twice. Which check catches which error, and what is the difference? - Validation: a calendar validity check rejects
31/02/2009, because February never has 31 days. The computer tests the day against the month and year. - Verification 核对: double entry compares the two email addresses and reports a mismatch if they differ. The computer compares two copies, and it would accept a wrong address typed identically twice.
- Validation asks whether the data is sensible; verification asks whether it was entered correctly.

Sensible, or copied correctly: two different questions
Which statement is correct?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Validation tests sensibility against rules; verification tests that the data was entered/transferred without change.
Verification checks whether data was copied or entered without change — but does not prove that it was unchanged or factually correct.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Double entry and checksums can detect errors, but matching results do not prove the data is unchanged or factually correct.
見落としやすいポイント
- チェック桁は入力時のバリデーションであり、パリティやチェックサムは転送時の検証である。誤った分類に含めないこと。
- いずれのチェックもデータが真実であることを証明しない。バリデーションは「妥当」、検証は「ソースと一致」という意味である。
- バイトのパリティチェックでは、同じバイト内の2つの反転ビットは相殺するため見逃す。「単一ビットエラー」と言うべきである。
- 暗号化はセキュリティ対策である。整合性には何ら寄与しない。
理解できましたか
- バリデーション=入力時の自動ルール:範囲、限度、存在、長さ、タイプ、形式、存在、チェック桁;正しいフォーマットだが誤った値は検出できない
- 検証 入力時 = 二重記録 と 視覚確認;転送時 = パリティ(バイトまたはブロック)、チェックサム、CRC
- パリティブロックは、失敗した行と列の交点にある反転ビットを特定する
- 妥当性検証は「意味があるか?」を問う;検証は「正しくコピーされたか?」を問う;どちらも「真か?」を問わない
何が問題でしたか?この内容はサイトの運営チームだけが確認します。