Student: Ying Hong Course: Database Security Instructor: Dr. Yang

Slides:



Advertisements
Similar presentations
Number Bases Informatics INFO I101 February 9, 2004 John C. Paolillo, Instructor.
Advertisements

Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
ICS312 Set 2 Representation of Numbers and Characters.
The Binary Numbering Systems
Lecture 5: security: PGP Anish Arora CIS694K Introduction to Network Security.
IT Systems What Number? EN230-1 Justin Champion C208 –
Traceroute Assignment. Base64 Encoding The SMTP protocol only allows 7 bit ASCII data, so how can you send me a picture of Avril Lavigne, which is an.
Data Representation Computer Organization &
Data Representation COE 205
Level ISA3: Information Representation
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Data Representation in Computers
 Method of representing or encoding numbers  Two main notation types  Sign-value  Roman numerals  Positional (place-value)  Modern decimal notation.
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
Simple Data Type Representation and conversion of numbers
Computers Organization & Assembly Language
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Today’s Topics How information.
IT253: Computer Organization
Chapter 3 Data Representation
Electronic mail security. Outline Pretty good privacy S/MIME.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 8 INTRODUCTION TO INFORMATION THEORY.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Chapter 3 Section 1 Number Representation Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation.
ICS312 Set 1 Representation of Numbers and Characters.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Chapter 6 Electronic Mail Security MSc. NGUYEN CAO DAT Dr. TRAN VAN HOAI 1.
Binary Numbers. Why Binary? Maximal distinction among values  minimal corruption from noise Imagine taking the same physical attribute of a circuit,
CPU Internal memory I/O interface circuit System bus
Number systems, Operations, and Codes
CISC1100: Binary Numbers Fall 2014, Dr. Zhang 1. Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
Data Representation, Number Systems and Base Conversions
Digital Systems Digital Logic and Design Dr. Musab Bassam Zghool Text Book: Mano Morris M. “ Digital Logic And Computer Design ”
MECH1500 Chapter 3.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Data Representation COE 301 Computer Organization Dr. Muhamed Mudawar
 Method of representing or encoding numbers  Two main notation types  Sign-value  Roman numerals  Positional (place-value)  Modern decimal notation.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
N 3-1 Data Types  Binary information is stored in memory or processor registers  Registers contain either data or control information l Data are numbers.
DATA Unit 2 Topic 2. Different Types of Data ASCII code: ASCII - The American Standard Code for Information Interchange is a standard seven-bit code that.
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
Programmable Logic Controller
Data Representation COE 308 Computer Architecture
Binary Representation in Text
Binary Representation in Text
NUMBER SYSTEMS.
Data Representation ICS 233
Lec 3: Data Representation
Data Representation.
3.1 Denary, Binary and Hexadecimal Number Systems
Data Representation Binary Numbers Binary Addition
BINARY CODE.
Introduction The term digital is derived from the way computers perform operation, by counting digits. Application of digital technology: television, communication.
Chapter 3 Data Representation
Binary, Decimal and Hexadecimal Numbers
Data Representation COE 301 Computer Organization
Dr. Clincy Professor of CS
Lecture 9: Radix-64 Tutorial
Binary Numbers.
Fundamentals of Python: First Programs
William Stallings Data and Computer Communications
Chapter Four Data Representation in Computers By Bezawit E.
Data Representation ICS 233
Networks & I/O Devices.
Chapter 3 - Binary Numbering System
Data Representation COE 308 Computer Architecture
Presentation transcript:

Student: Ying Hong Course: Database Security Instructor: Dr. Yang Base64 Encode and Decode Student: Ying Hong Course: Database Security Instructor: Dr. Yang 12/5/2018 Base64 Encode & Decode

Contents Introduction Algorithm Example Issues for Considerations Other Methods References 12/5/2018 Base64 Encode & Decode

Introduction The Base64 Content-Transfer-Encoding is a method to encode an arbitrary sequence of octets in a form that is unintelligible to unauthorized readers. It’s used for MIME (Multipurpose Internet Mail Extensions) email and various other Internet-related applications. 12/5/2018 Base64 Encode & Decode

Algorithm Read inputs from left to right. Combine 3 8-bit input data to a 24-bit input group. Split each 24-bit input group to 4 6-bit units. If last group is not 24-bit, add zero bits to form 4 6-bit units. Translate each 6-bit input data into a single digit. The digit is used as an index into the base64 alphabet table. 12/5/2018 Base64 Encode & Decode

Algorithm con’t Represent each digit by its corresponding alphabet in the base64 alphabet table. Set the last several output characters (at most two) that do not represent actual input data to the character “=“. That is, in the last group last one or two 6-bit units may be “0”; you should either interpret it/them to “A” if they come from the plaintext, or set it/them to “=“ if they are added by ourselves. 12/5/2018 Base64 Encode & Decode

The Base64 Alphabet Table 12/5/2018 Base64 Encode & Decode

Example To encode “www.cl.uh.edu”: Represent “www.cl.uh.edu” as its ASCII code number (in hexadecimal for easier to be represented as binary number later): 77 77 77 2E 63 6C 2E 75 68 2E 65 64 75. Represent it as binary number and combine 3 8-bit input data to a 24-bit group: 01110111 01110111 01110111, 00101110 01100011 01101100, … … 12/5/2018 Base64 Encode & Decode

Example con’t Form 4 6-bit inputs in each 24-bit group: 011101 110111 011101 110111, 001011 100110 001101 101100, … … Attention: in the last group is only 01110101(7510), so we need to add 0’s to form 4 6-bit units, that is, 011101 010000 000000 000000 NOTE: last 2 6-bit units don’t represent actual input data Translate each 6-bit input into a single digit: 29 55 29 55, 11 38 13 44, 11 39 21 40, 11 38 21 36, 29 16 0 0. 12/5/2018 Base64 Encode & Decode

Example con’t Each digit is used as index into the base64 alphabet table. Represent each digit as corresponding character in the base64 table: 29 55 29 55, 11 38 13 44, 11 39 21 40, 11 38 21 36, 29 16 0 0 d 3 d 3 , L m N s , L n V o , L m V T , d Q = = Attention: Last two 0’s are interpreted as “=“, because they do NOT represent actual input data, they are added by ourselves. The final result of encoding “www.cl.uh.edu” is: “d3d3LmNsLnVoLmVTdQ==”. 12/5/2018 Base64 Encode & Decode

Issues for Considerations The encoded data are consistently about 33% larger than the unencoded data. The output stream (encoded bytes) must be represented in lines of no more than 76 characters each. 12/5/2018 Base64 Encode & Decode

Issues for Considerations con’t All other characters (including line breaks) not found in the table must be ignored during decoding, since they probably indicate a transmission error, for which a warning message or a rejection message may be given under some circumstances. 12/5/2018 Base64 Encode & Decode

Issues for Considerations con’t Careful decoding must be made when last group of input data is less than 24 bits, that is adding 0’s bits to form multiple of 6-bit unit and set output character that doesn’t represent actual input data to the character “=“. Three cases may occur in the last group of output: inputs are 24 bits, outputs are 4 characters with no “=“ inputs are 16 bits, outputs are 3 characters with one “=“ inputs are 8 bits, outputs are 2 characters with two “=“ 12/5/2018 Base64 Encode & Decode

Issues for Considerations con’t Care must be taken when directly encoding text material. That is, some special characters like line breaks should be converted into CRLF sequences prior to base64 encoding (that means you should be aware of both printable characters and those control code). 12/5/2018 Base64 Encode & Decode

Other Methods  uuencode Uuencode is a set of algorithms that convert files to 7-bit ASCII characters, which can be transmitted over the Internet. It’s especially popular for sending email attachments. Originally, uuencode stood for Unix-to-Unix encode, but it has become a universal protocol to transfer files between different platforms such as Unix, Windows, and Macintosh. 12/5/2018 Base64 Encode & Decode

Other Methods  Base85 The Base85 encoding is used to encode IPv6 address, which is treated as a 128-bit integer. The Base85 digits in ascending order are: 0..9, A..Z, a..z, !, #, $, %, &, (, ), *, +,-, ;, <, =, >, ?, @, ^, _, `, {, |, }, ~. 12/5/2018 Base64 Encode & Decode

Other Methods  Base85 con’t Algorithm: Convert address to decimal number. 1080:0:0:0:8:800:200C:417A (Hex.) 21932261930451111902915077091070067066 (Dec.) Divide this number by 85 and take the remainder, then continue to divide the quotient by 85 and take the remainder, and so on. The remainders are: 51, 34, 65, 57, 58, 0, 75, 53, 37,4, 19, 61, 31, 63, 12, 66, 46, 70, 68, 4. Reverse the order of the remainders. 4, 68, 70, 46, 66, 12, 63, 31, 61, 19, 4, 37, 53, 75, 0, 58, 57, 65, 34, 51. 12/5/2018 Base64 Encode & Decode

Other Methods  Base85 con’t Algorithm (con’t): Use the numbers (reversed remainders) as index into the Base85 alphabet table to get the corresponding characters. 4, 68, 70, 46, 66, 12, 63, 31, 61, 19, (remainders) 4, ), +, k, &, C, #, V, z, J, (encoded in Base85) 4, 37, 53, 75, 0, 58, 57, 65, 34, 51. (remainders) 4, b, r, >, 0, w, v, %, Y, p. (encoded in Base85) Final result is: 4)+k&C#VzJ4br>0wv%Yp 12/5/2018 Base64 Encode & Decode

Other Methods  Base85 con’t Benefits: Reduce IPv6 address length when encoding it in textual format, that is from 39 characters to 20 characters. Encode IPv6 address to a fixed-length representation. It’s very hard to be decoded by any casual observer, so it’s more secure. Other issues: So far many current processors don’t have 128-bit arithmetic. Future processors should address this defect before any significant IPv6 deployment has been accomplished. 12/5/2018 Base64 Encode & Decode

References http://www.python.org/doc/current/lib/module-base64.html (Base64) RFC 1521 (Base64) http://www.webopedia.com/TERM/U/Uuencode.html (uuencode) RFC 1924 (Base85) 12/5/2018 Base64 Encode & Decode