Preview

ENGG1111 Assignment 2

Good Essays
Open Document
Open Document
1819 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
ENGG1111 Assignment 2
The University of Hong Kong
ENGG1111 Computer Programming and Applications
Assignment 2 Deadline: 17:00 Nov 14, 2014.
CodeBreaker

Background
You and a group of colleagues meet up socially now and then at various shopping malls. The details of when and where to meet are sent out to the group in the form of text messages. To keep the details private, the messages are encoded so that they cannot be read easily; they must be decoded before they can be read.
Here is an example of an encoded message displayed as text:

Unfortunately, you lost the key needed to decode the latest message and don’t want to ask for it again.
Your task in this assignment is to write a program to break the code so that you can read a message without knowing the key.
You know certain details about the messages which will make it easier to write the codebreaker: o o

o

all messages are exactly 140 characters long; the decoded messages will contain the name of one shopping mall. Your group meets at only 7 malls, all of which have exactly 13 characters in their names:
- 1881 Heritage
- Festival Walk
- Horizon Plaza
- Langham Place
- Olympian City
- Pacific Place
- Telford Plaza the messages are encoded using a simple scheme involving character substitution.

Encoding
Messages are encoded using a form of Caesar cipher. A Caesar Cipher encodes a message by replacing each character with the character a certain number of positions from the original. For example, using the English alphabet and shifting by 4 positions to the right, the word LOST is encoded as PSWX:
...

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

...

...

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

...

4 position shift

The number used to specify the number of positions to shift during encoding is known as the key; in this example, the key is 4. Clearly, we can decode PSWX by shifting each character back 4 places to the left to recreate LOST.
The final issue is how to handle cases where the shift takes us beyond the last

You May Also Find These Documents Helpful

  • Good Essays

    Message coded – individual thinks about how they are going to say what they are thinking and decides in what form the communication will be i.e spoken words or sign language. An individual puts it into this form.…

    • 973 Words
    • 4 Pages
    Good Essays
  • Good Essays

    A communication event I recently attended was "rush" for a sorority. It was a series of days where I met with all the different sororities. The whole point of this is to meet many different people to decide which sorority is for you. The event is focused around communicating with people so they can get to know you and you can get to know them. If you send the wrong message about yourself you may not be invited back the next day to see the people that you would like to see again. Also if the person you talk to in the sorority sends the wrong message to you, you may not want to go back and visit that sorority again. You could not be successful with something like this if you cannot communicate properly and if you…

    • 712 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Shopping mall is a classic icon of American culture. Such big shopping center is specifically designed to meat the needs of today’s customer. We like how convenient it is to shop, eat and be entertained all in one place. It is a perfect place to spend an afternoon with your family or if you’re a teen hang out with your friends. But we might just be underestimating the real power such places have over our society. There are plenty of subtle messages being sent to us and those messages in fact play a huge role in the socialization process and shaping of our society as a whole.…

    • 1155 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Johari Window

    • 784 Words
    • 4 Pages

    This model usually use for communication and it’s enhance better context of conversation between groups and individual setting.…

    • 784 Words
    • 4 Pages
    Satisfactory Essays
  • Powerful Essays

    f(x)= x+k (mod26) Character to be shifted to the right by k; x is the characterʼs numerical equivalent.…

    • 1667 Words
    • 7 Pages
    Powerful Essays
  • Satisfactory Essays

    Media Text

    • 782 Words
    • 4 Pages

    * One of the keys to understanding the meanings in the texts in the use of codes.…

    • 782 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Then write the letter from each numbered position in the corresponding blank at the bottom of the page.…

    • 171 Words
    • 1 Page
    Satisfactory Essays
  • Powerful Essays

    Linear Block Codes

    • 864 Words
    • 4 Pages

    A systematic (n,k) linear block code is a mapping from a k-dimensional message vector to an ndimensional codeword in such a way that part of the sequence generated coincides with the k message digits. The difference (n − k) represents the parity bits. A systematic linear block will have a [k × n] generator matrix [G] of the form…

    • 864 Words
    • 4 Pages
    Powerful Essays
  • Powerful Essays

    Shopping mall has become part of a ‘way of life’. The place is a destination frequented by many levels and age groups of people during leisure time and weekends. The intentions of going to the mall now are no longer confined to shopping for necessities in terms of foods and clothes but have expanded to the act of seeking for leisure satisfaction. The reason being that leisure in form of shopping can be achieved rather easily as it can be done casually and quite frequently without much planning and collective agreement among a group of people.…

    • 3296 Words
    • 14 Pages
    Powerful Essays
  • Good Essays

    Ascii Code

    • 730 Words
    • 3 Pages

    The following table shows the ASCII code for letters, numbers, and commands. The ASCII code for the word “Bears” would be: 66 101 97 114 115. Note that the ASCII code is different for uppercase and lowercase letters.…

    • 730 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Mama Ea Kollek

    • 345 Words
    • 2 Pages

    If you want the letters to be apart, like characters by using the \ key. Eg: - thra - th\ra…

    • 345 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    The general idea is the construction of a polynomial, the coefficient produced will be symbols such that the generator polynomial will exactly divide the data/parity polynomial. The basic principle of encoding is to find the remainder for the message divided by a generator polynomial G(x).The Reed-Solomon codeword is generated using a special polynomial known as the Generator polynomial. All valid code words are exactly divisible by the generator polynomial. The generator polynomial of the RS encoder is represented…

    • 982 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Character Encoding

    • 1485 Words
    • 9 Pages

    Assume six Chinese characters are placed in a 6×6 table and in particular in the 6 positions specified below, what binary values can be assigned to these 6 characters according to the given two-dimensional code space?…

    • 1485 Words
    • 9 Pages
    Satisfactory Essays
  • Good Essays

    Speed Dating

    • 259 Words
    • 2 Pages

    Men and women are rotated to meet each other over a series of short "dates", usually lasting from 3 to 8 minutes depending on the organization running the event. At the end of each interval, the organizer rings a bell, clinks a glass, or blows a whistle to signal the participants to move on to the next date. At the end of the event participants submit to the organizers a list of who they would like to provide their contact information to. If there is a match, contact information is forwarded to both parties. Contact information cannot be traded during the initial meeting, in order to reduce pressure to accept or reject a suitor to his or her face.…

    • 259 Words
    • 2 Pages
    Good Essays
  • Good Essays

    A DAY AT THE MALL

    • 810 Words
    • 3 Pages

    It's also known that inside the mall each shop is only a few steps away from the others. Now why would someone design the mall to be so squashed together, you think? The next time you go to a mall, stand from the inside of one shop and walking straight out, you will noticed that before you leave the shop you're currently walking out of, you have already plan on going into the next. Let's just say you've just finished paying for your new fall outfit and told yourself that that was all you came for and is planning on going food shopping for your mother now, but the minute you walk out the…

    • 810 Words
    • 3 Pages
    Good Essays