2. Encoding
Encoding is for maintaining data usability
and can be reversed by employing the
same algorithm that encoded the content,
i.e. no key is used.
3. Encoding Examples
Hotel Room Number
– 312 (3rd floor, 12th room)
– 009 (0 floor, 9th room)
Metro Ticket
Base64 (PHP)
Minify JS/CSS
HTML URL Encoding
4. Egyptian National ID
Ex. 2 8 2 0 8 1 5 1 3 0 4 5 9 7
Code C Y Y M M D D X X Z Z Z Z1 C1
Desc. Century
code
Year
number
Month
number
Day
number
Governorate
code
Insertion
number
Gender
code
Check
Digit
Cairo 01 Alexandria 02 Port Said 03 Suez 04 Damietta 11
Dakahlia 12 Sharqia 13 Qalyubia 14 Kafr el-Sheikh 15 Gharbia 16
Monufia 17 Beheira 18 Ismailia 19 Giza 21 Beni Suef 22
Faiyum 23 Minya 24 Asyut 25 Sohag 26 Qena 27
Aswan 28 Luxor 29 Red Sea 31 New Valley 32 Matruh 33
North Sinai 34 South Sinai 35 Outside Egypt 88
Century code: 1= 1800 ~ 1899, 2= 1900 ~ 1999, 3 = 2000 ~ 2099
Gender code: Even = Female, Odd = Male
5. Encryption
Encryption is for maintaining data
confidentiality and requires the use of a key
(kept secret) in order to return to plaintext.
7. Hashing
Hashing is for validating the integrity of content by detecting
all modification thereof via obvious changes to the hash
output.
MD5 (Collision problem)
– https://en.wikipedia.org/wiki/MD5
– https://en.wikipedia.org/wiki/MD5#Collision_vulnerabilities
– https://en.wikipedia.org/wiki/Collision_attack
SHA-512 (SHA 2)
– https://en.wikipedia.org/wiki/SHA-2
– https://en.wikipedia.org/wiki/Comparison_of_cryptographic_hash_f
unctions
– https://en.wikipedia.org/wiki/Hash_function_security_summary