Base 64 encoding, Computer Networking

Assignment Help:

Base 64 Encoding

The Simple Mail Transfer Protocol (SMTP) is a protocol used on the Internet for sending email. When you send an email, your mail client establishes an SMTP connection to your outgoing mail server, and sends the email to the server. Mail servers also use SMTP to transfer email amongst themselves. Being a relatively old protocol, SMTP supports only 7-bit ASCII characters, meaning that only a total of 27 = 128 characters can be represented in our email (0 to 127). If you take a look at www.asciitable.com, you can see that this is only sufficient for representing the characters in the English language. What if we want to send text in other languages that use different characters. What if we want to attach a picture to an email? The pixels in that picture could be represented by values outside the range of 0 - 127, so how can we send the picture using an email protocol that only accepts characters between the ASCII values of 0 and 127? The answer is that we have to encode non-ASCII data into 7-bit ASCII. We can then send the encoded data in our email and it will be safely transmitted and received, since all the binary data within it will be encoded in 7-bit ASCII characters. When our email reaches its destination, any encoded data within it must then be decoded by the recipient's mail client. One common method of encoding data that falls outside the range of 7-bit ASCII is base 64 encoding. Just as we can take binary data and represent it in decimal (10 digits), hexadecimal (16 digits), or octal (8 digits), we can also take it and represent it in base 64, which represents data using 64 different characters: A through Z , a through z , 0 through 9 , and + and / . Taking a look at an ASCII table, one can see that all of these characters can be represented in 7 bits, meaning we can safely send base 64 encoded data via email. As an example, suppose that you receive an email. You can see that the email has an image attachment, but how was that image sent when SMTP only supports 7-bit ASCII characters. Most email clients allow you to view the raw source of an email. Observe that the attachment is encoded within what is called a MIME1 message part. This part contains information for the mail client, such as the name of the file attachment ( filename=DSC00625.JPG ), the type of file attached ( Content-Type: IMAGE/JPG; ), and the type of encoding used to encode the con- tents of the file ( Content-Transfer-Encoding: BASE64 ). As you can see, base 64 was used to encode the content of the image. Next comes the actual encoded content of the file: /9j/4VKCRXhp... . This is the content of the image, encoded in base 64 representation. When your mail client receives a message with a MIME message part such as this, it knows what type of attachment it is ( Content-Type ), how to decode it ( Content-Transfer-Encoding ), and what to name the attachment ( filename ). Since all 64 characters in base 64 can be represented in 7-bit ASCII, it is safe to send a message containing base 64 encoded data via SMTP.

In this assignment, you'll be developing a SPARC assembly language program to encode data (e.g. strings and the contents of binary files) into base 64 representation.

Task:

Your task for this assignment is to write a SPARC assembly language program that reads data from standard input and outputs the base 64-encoded representation of the data. To accomplish this task, you will write a main program and two functions, as described in the following sections. Note: this assignment has been designed to be performed in the order given below. That is, write the get_b64_char function first, then the get_b64_str function, and then the main program.


Related Discussions:- Base 64 encoding

Fiber modems, FIBER MODEMS: LAN methods are discovered to perform with...

FIBER MODEMS: LAN methods are discovered to perform within the same building. However most institutions have offices located far apart from one other. DISTANCE LIMITATION A

Protocol layering - computer network, Protocol Layering To design  str...

Protocol Layering To design  structural  network protocols the designers organize protocol and use the network  hard ware and software to implement  the protocol  in layers. E

What are the types of servers, There are many types of servers:- a) File...

There are many types of servers:- a) File servers b) Database servers c) Transaction servers d)  Groupware servers e) Object servers Web servers.

Explain the term instruction pipelines, Instruction Pipelines The strea...

Instruction Pipelines The stream of instructions in instruction execution cycle may be realized by a pipeline where overlapped executions of various operations are performed. T

Broadcast domain and collision domain, Explain Difference between broadcast...

Explain Difference between broadcast domain and collision domain? Ans) Broadcast Domain Send the packet to all the Present Network IT might be send by the person It mig

Determine the relation between storage size and genomes, Genome4U is a scie...

Genome4U is a scientific research project at a large university in the United States. Genome4U has recently started a large-scale project to sequence the genomes of 250,000 volun

Which layers are user support layers, Which layers are user support layers?...

Which layers are user support layers? Three layers are come under user support layer:- a. Session Layer b. Presentation Layer and c. Application Layer

Name the protocol which is networking middleware, Name the protocol which i...

Name the protocol which is networking middleware SOCKS is a networking middleware: a circuit-level gateway, acting as a proxy and is placed at the session layer to mediate clie

How to define a constant variable in java, How to define a constant variabl...

How to define a constant variable in Java? The variable should be declared as static and final. So only one copy of the variable exists for all instances of the class and the v

Routing protocol used in design a banking network, You have been asked to d...

You have been asked to design a Banking Network with two primary types of locations.  Branches that will have 3 subnets, one /25 subnet one /26 subnet for ABMS and one /26 s

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd