Encoding is not encryption · エンコーディングは暗号化ではありません
A common mix-up
- People often say "encoded" when they mean "encrypted". They are not the same.
- Encoding changes the format of data so it can be stored or sent — it is not secret.
- Encryption changes data so that only someone with the key can read it — it is secret.
一般的な混同
- 人々はしばしば「エンコード」と言うことで「暗号化」を意味することがある。これらは全く異なる。
- エンコードはデータの形式を変えて保存や送信を可能にするものであり、秘密ではない。
- 暗号化はデータを鍵を持つ者以外には読めないように変えるものであり、それは秘密である。
Base64 — a famous encoding
- Base64 rewrites bytes using 64 safe characters. It is used to put images or files inside text (like email).
- Anyone can decode it — no key needed. So base64 hides nothing.
ベース64 — 有名なエンコード
- ベース64は、64種類の安全な文字を使ってバイトを再書きします。画像やファイルをテキスト内(メールなど)に埋め込む際に使用されます。
import base64
secret = base64.b64encode(b"hello").decode()
print(secret) # aGVsbG8=
print(base64.b64decode(secret).decode()) # back to hello
- 誰でも解読できるため、鍵は不要です。したがって、ベース64は何も隠しません。
Why this matters for security
- If a website "protects" your password with base64, it is not protected at all.
- Real protection needs encryption (with a key) or hashing (one-way). Encoding is just a costume.
セキュリティにおける重要性
- ウェブサイトがベース64であなたのパスワードを"保護"している場合、それは一切保護されていないに等しい。
- 本物の保護には暗号化(鍵付き)またはハッシュ(一方向性)が必要です。エンコードは単なる衣装に過ぎません。
Try it
- Encode
helloto base64 below. Then imagine decoding it — and remember it is not a secret.
Covers: foundation for IGCSE 2.3 / A-Level 17.1 (encryption).
やってみよう
- 以下で
helloをベース64でエンコードしてください。そして解読してみたと想像し、それが秘密ではないことを思い出してください。
対象: IGCSE 2.3 / A-Level 17.1 (暗号化) の基礎.
Common mistakes
- Base64 is encoding — anyone can reverse it, so it gives no security.
- Encoding changes the format; encryption protects the content.
よくあるミス
- ベース64はエンコードであり、誰でも逆転できるため、セキュリティを提供しません。
- エンコードは形式を変え、暗号化は内容を保護します。
Use base64 to encode the word hello. Encode its bytes and print the result as text. (Notice: anyone can decode it — encoding is not secret.) · base64 を用いて単語 hello をエンコードします。そのバイトと print の結果を文字列としてエンコードしてください。(注記:この暗号化は誰にでも解読可能であり、秘密ではありません。)
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。
An app 'protected' a message as base64 — prove that protects nothing. Decode captured with base64.b64decode and print the text. No key needed. · あるアプリがメッセージを base64 で「保護」したと主張していますが、これが何の保護にもならないことを証明してください。 captured を base64.b64decode でデコードして文字列を印刷します。鍵は必要ありません。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。