Skip to content

令和元年度 秋期 ITパスポート試験 問70

This question's explanation and your answers so far.

問70
頻出度★★★

大文字の英字から成る文字列の暗号化を考える。暗号化の手順と例は次のとおりである。この手順で暗号化した結果が“EGE”であるとき,元の文字列はどれか。

暗号化の手順例 “FAX”の暗号化<br>処理前例 “FAX”の暗号化<br>処理後
1表から英字を文字番号に変換する。FAX5, 0, 23
21文字目に1,2文字目に2,n文字目にnを加算する。5, 0, 236, 2, 26
326で割った余りを新たな文字番号とする。6, 2, 266, 2, 0
4表から文字番号を英字に変換する。6, 2, 0GCA
英字ABCDEFGHIJKLM
文字番号0123456789101112
英字NOPQRSTUVWXYZ
文字番号13141516171819202122232425
出典 令和元年度 秋期 ITパスポート試験 問70
解説

問 70

  • Incorrectア

    Encrypting BED: B,E,D=1,4,3 with 1,2,3 added gives 2,6,6, and the remainders modulo 26 are also 2,6,6, i.e., C,G,G=“CGG”, which is not “EGE”.

  • イ

    正解 Decryption means retracing the encryption steps in reverse. First, convert the ciphertext “EGE” into character numbers: E=4, G=6, E=4. In encryption step 2, n was added to the n-th character, so in decryption we do the reverse and subtract n from the n-th character (if the result is negative, add 26). 1st character: 4-1=3 → D; 2nd character: 6-2=4 → E; 3rd character: 4-3=1 → B. Therefore the original string is “DEB”, so option イ is correct. To be sure, verify by forward calculation: adding 1, 2, 3 to DEB=3,4,1 gives 4,6,4, and the remainders when divided by 26 are also 4,6,4, i.e., E,G,E=“EGE”, which matches the given ciphertext.

  • Incorrectウ

    Encrypting FIH: F,I,H=5,8,7 with 1,2,3 added gives 6,10,10, and the remainders modulo 26 are also 6,10,10, i.e., G,K,K=“GKK”, which is not “EGE”.

  • Incorrectエ

    Encrypting HIF: H,I,F=7,8,5 with 1,2,3 added gives 8,10,8, and the remainders modulo 26 are also 8,10,8, i.e., I,K,I=“IKI”, which is not “EGE”.

ここがポイント
  • Decryption (restoring the ciphertext to the original) means retracing the encryption steps in reverse order with inverse operations: subtract what was added, and look up the conversion table in reverse.
  • This is a position-dependent, Caesar-cipher-type substitution cipher. Since n is added to the n-th character and then taken modulo 26, decryption likewise subtracts n from the n-th character and takes the result modulo 26 to recover the original character number.
用語

Your answers