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.
خلط شائع
- غالبًا ما يقول الناس "مشفر" عندما يقصدون "مُشكَّل (encoded)". هما ليسوا متطابقين.
- التشكيل (Encoding) يغير صيغة البيانات لتخزينها أو إرسالها — إنه ليس سرياً.
- التشفير يغير البيانات بحيث يتمكن فقط الشخص الذي يمتلك المفتاح من قراءتها — إنه سري.
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.
Base64 — تشكيل مشهور
- Base64 يعيد كتابة البايتات باستخدام 64 حرفًا آمنًا. يُستخدم لوضع الصور أو الملفات داخل النصوص (مثل البريد الإلكتروني).
import base64
secret = base64.b64encode(b"hello").decode()
print(secret) # aGVsbG8=
print(base64.b64decode(secret).decode()) # back to hello
- يمكن لأي شخص فك تشفيره — لا حاجة لمفتاح. لذا فإن base64 لا يخفي شيئًا.
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.
لماذا يهم هذا للأمن السيبراني
- إذا كان موقع إلكتروني "يحمي" كلمة المرور الخاصة بك باستخدام base64، فهو غير محمي على الإطلاق.
- الحماية الحقيقية تتطلب التشفير (بمفتاح) أو التبويغ الرقمي (ذات اتجاه واحد). التشكيل مجرد زينة.
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إلى base64 أدناه. ثم تخيل فك التشكيل — وتذكر أنه ليس سرياً.
يتضمن: أساس 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.
أخطاء شائعة
- base64 هو تشكيل — يمكن لأي شخص عكسه، لذا لا يوفر أي أمان.
- التشكيل يغير الصيغة؛ التشفير يحمي المحتوى.
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. · اضغط تشغيل لرؤية المخرجات هنا.