Engineering 102
Project two – Encryption with photos
Secure communication is millennia old, and new methods and cyphers are always being developed. As increasing
communication is done over the internet, 21st century engineers will need to confront secure communication like never
before. There are many methods of encrypting and decrypting messages, and this project will explore a few of them,
including encrypting messages and hiding them in plain sight in an image.
You will be assigned teams of 4. Each team member will be responsible for analyzing some data, with comprehensive
analysis by the whole group. Team members who do not contribute substantially in their groups can be replaced, and
team members who are in poorly performing groups may move to other groups.
Four cyphers will be used, one for each member. The team must determine which team member will do which one. For
teams with fewer than four members, they need only to do one per team member. So teams of three need only do
three of the cyphers. The cyphers are all lower case and contain only letters, numbers and a space. For each, the letters
correspond to numbers starting a 1 and going to 217 in increments of 6 (same length of vector as the letters).
Four image files are provided, one for each team member. Each member should use a different image, but there is not a
requirement to use any particular image with any specific cypher. Any image can be used with any cypher, but each
member of the team should have his or her own cypher and image unique from the other members on the team (DO
NOT CHANGE THE NAME OF IMAGE FILE).
Cypher A
(Alphabet broken in half, count down M-A, then Z-N, “space”, then numbers 0 through 9)
‘M, L, K, J, I, H, G, F, E, D, C, B, A, Z, Y, X, W, V, U, T, S, R, Q, P, O, N, “space”, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9’
Cypher B
(Vowels at the beginning, consonants (all alphabets should be Uppercase), “space”, numbers 0 through 9)
‘A,E,I,O,U,B,C,D,F,………..Y,Z, “space” ,0,1,2, … 9 ’
Cypher C
(Numbers 0 through 9, “space”, vowels in reverse, then all consonants in reverse (all alphabets should be Uppercase))
‘0,1,2, … 9 ,“space”,U,O,I,E,A,Z,Y,X,…….D,C,B’
Cypher D
(Vowels at the end after Z (all alphabets should be in Uppercase), “space”, numbers 0 through 9)
‘B,C,D,F,……….X,Y,Z,A,E,I,O,U, “space”,0,1,2, … 9 ’
Important programming information:
•
•
•
•
•
•
You must use the techniques taught in the course to solve this project.
Perform the following analysis in a single MATLAB script file (one per team member) named
“Project_2_Firstname_Lastname.m “.
Each member must write his or her own code, and team member’s codes may not be identical.
The team must work together to divide the work and to complete the final analysis. In all cases except where
noted MATLAB must do the computations and analysis and generate the output.
Computed values for outputs must be used, values may not be hard coded into the code unless noted.
Use comment statements to separate parts of the code and suppress all output to the command window
except the required output.
•
The code must be capable of handling any message of any length, not just the one you use as an example.
Individual portion:
1. Create a message to be encrypted. The minimum length of the message is 2500 characters, and the program
should be capable of handling a message of any length up to that number. It must check the length of the
message and inform the user if it’s too long. Generate your selected encryption cypher and convert the message
to the numerical equivalent. This must be done using loops.
2. Reshape the vector into a message matrix 50 x 50 using reshape command.
3. Display in the command window which of the cyphers you are using. Display the message to be encrypted and
its numerical equivalent using display statements. It should read:
Original Message
Your Message
Numerical Message
Numerical message
Encoded Matrix
Encoded Numerical Matrix
4. Import your image using imread(‘ '). Display the image in a figure window using imshow(‘ ‘) and title it
“Original Image”
5. Define the position of row and column to insert the encoded numerical matrix. (Remember that the position
cannot be more than the value of sum of size of image and the size of Encoded Matrix)
6. Embed the encoded message starting from the positions defined i.e., using loops, replace the pixels (numbers)
of image with the encoded numerical matrix. (For example, the encoded numerical message is of size 50 x 50
and the positions to embed the message are row = 100 and col = 100. So the program should be capable of
replacing all values of images from position (101,101) to (100+50,100+50))
7. Display the image in a new figure window and title it “Encoded Image”
8. Extract the encoded message from the image using the reverse of the process in step 5.
9. Change the numbers back to string values and display the string message
Decoded Message
Should be same as Your Numerical message
Decrypted Message
Should be same as Your Original Message
Note: Output should consist of only the required lines in the command window and TWO
figures.
Note about Discussion and Conclusions: The discussion and conclusion portions of the technical report should at the
very least address the efficacy of the program, whether this is a secure method of sending messages, and why or why
not, and how it could be improved upon.
Using Matlab to Embed a
Message in an Image
Introduction and Problem Statement
●
●
●
●
With increasing use of online communication, data is constantly passed around whether is
it private or public information
○ This has created a need for being able to safely store or transfer information
To solve this issue, encryption is used to protect important data and information
To test methods of encryption, MATLAB was used
Main goal was to find the best way to hide data within the image
Background
●
●
●
●
Encryption can be divided into types and algorithms
Types of encryption include:
○ Asymmetric and symmetric
Encryption algorithms include:
○ DES, AES, and RSA
○ Offer varying degrees of strength for protecting data
Encryption is mainly used by everyone
○ Either directly implementing it or subconsciously using it
Methodology - Encryption
●
●
●
●
●
●
Wanted to create a code capable of embedding a message within an image
Established the cypher, number vector, and message
Altered the length of the message with either if statements or while loops with a nested if
statements
Used for loops to compare the message to the cypher
Reshaped the vector created into a matrix
Matrix was placed in the image by replacing the values of the image with values of the
matrix
Methodology - Decryption
●
●
●
●
To decode, values from the encoded image were pulled
Matric was reshaped to 1x2500
Computed the reverse process of encoding
○ Compared the reshaped matrix to the number vector using positions of unshaped
matrix and the num vector
○ If positions matched each other, the a new vector was created using the cypher and
the number position
Displayed the numerical vector and decrypted message
Methodology - Cyphers and Images
Cypher A
‘M, L, K, J, I, H, G, F, E, D, C, B, A, Z, Y, X, W, V, U,
T, S, R, Q, P, O, N, “space”, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9’
Image 1: bridgeFEP.png
Image 2: lenaFEP.png
Cypher B
‘A,E,I,O,U,B,C,D,F,………..Y,Z, “space” ,0,1,2, … 9 ’
Cypher C
‘0,1,2, … 9 ,“space”,U,O,I,E,A,Z,Y,X,…….D,C,B’
Cypher D
‘B,C,D,F,……….X,Y,Z,A,E,I,O,U, “space”,0,1,2, … 9 ’
Image 3: photographerFEP.png
Image 4: peppersFEP.png
Results
Discussion
As according to the project we were given with the specific task to achieve. We did the programming with our own logic and created a
program that can hide and unhide the text inside the photo with under the command of the user. With the advancement in technology it is
the new innovation, we can save our passwords and any other information. We can encrypt any of the data inside the photo and is decrypted
by the special procedure.
We were given with the project, every member was provided with one of the photo and was allowed to encrypt the data, according to the
theoretical data we were given with the four cyphers and asked to choose any of the one of our will. As these cyphers were lower case and
we were allowed to use only letters, spaces and digits. Theoretically the letters corresponded to digits that start from 1 and then go on to
217 by the increments of 6 with the same length of vectors as the letters.
Discussion- Consideration
Image Encryption a safe method or not?
Yes, this method is the safe method for sending
and receiving messages and we can see that this is the private way and no one can see what is in the backside of the photo.
Considering the social factors
Considering the social factors we can see that
the different social organizations and companies send and receive the messages that are private and must be sent safely,
many of the people socialize with each other and wish to send and receive the messages privately.
Considering the economic factors
Considering the economic factors, many of the
companies and organizations and even individuals can use this technique to save the audit and other billings and even can
send or receive the sensitive information without letting anyone know about it.
Conclusion
Future work
WVU ENGR 101 Technical Report Rubric
Updated Fall 2019
Team: ____________
Task
Points
possible
OVERALL IMPRESSION (16pts)
1.
2.
3.
4.
5.
6.
7.
8.
Body text 12 size font, double spaced, one inch margins
Headings for each section are clear and present
No first person narrative and uses passive voice
Use of past tense in each section
Figures numbered and captioned; tables are numbered and titled
Figures and tables discussed in text and not just there as a picture
Diagrams and graphs look professional and are clearly labeled (axis titles, units, lines to connect
dots when needed, trend lines when needed, clear)
All figures are professional and relevant to the problem (no clip art)
Proper and appropriate grammar and spelling are used throughout
Explains all necessary equations and variables. Equations are listed properly using equation editor
Page numbering correct throughout. No page number on title page. Abstract is on page “i”, table
of contents on page “ii”. Introduction begins page “1”
1
1
3
3
3
3
1
1
FRONT MATTER (11 points)
TITLE PAGE (2 pts)
1. Meaningful title for the project, size 26
2. Authors listed alphabetically by last name (family name)
Class name and section number listed
3. Submitted to:
Instructor’s name listed
Affiliation listed (Fundamentals of Engineering and Statler information)
Date submitted
ABSTRACT (5 pts)
1. What was done and why it was done
2. How the work was conducted
3. Results and major conclusions
TABLE OF CONTENTS (4 pts)
1. Section titles listed in order of appearance in the report. Each section has a number that
corresponds to order in this rubric as shown in template
2. Pages, headings and subheadings match the report and are listed
3. List of Figures formatted like the rest of the table of contents
4. List of Tables formatted like the rest of the table of contents
5. List of Equations formatted like the rest of the table of contents
1
0.5
0.5
1
2
2
0.5
0.5
1
1
1
INTRODUCTION (14 pts)
Introduction (3 pts)
1. Appropriately describes the project purpose and need
Problem Statement and Objective (3 pts)
1. States the problem that needs to be solved
2. States the objectives that should be accomplished
Background / Literature Review (8 pts)
1. Summarizes relevant literature (research)
Check the assignment to see what research you should be doing for this part. The idea here is to
set the stage for the reader to completely understand your report.
2. Tells what research or experimentation on this topic has been done in the past
3. Proper use of in-text citations (author’s last name page number).
3
1
2
3
2
3
Points
earned
WVU ENGR 101 Technical Report Rubric
Updated Fall 2019
Team: ____________
https://owl.english.purdue.edu/owl/resource/747/01/
METHODS and MATERIALS (14 pts)
1.
2.
3.
4.
Describes how design work was conducted (able to recreate project from this description)
Describes how experiments were conducted
No bullets, all in paragraph form, but uses proper subheadings to organize the section
Describes and shows pictures and technical drawings of the apparatus (minimum of 3)
5
3
2
4
RESULTS (10 pts)
1.
2.
All results from project/testing are discussed and correct
Presents all results of testing in words along with tables and graphs. Figures and tables are used
to help support the results described and are NOT just thrown into this section without
explanation in the body text (captions are not enough)
6
4
DISCUSSION (16 pts)
1.
2.
3.
4.
5.
6.
7.
Addresses the meaning of the results. Including analysis and interpretation of the data. Explain
how experimental results compare with theoretical data or hypothesis.
This is not just a place to restate the results or methods. Explain what the results mean and
similarities/deviations between analysis methods, where applicable.
Consideration of Public Health, Safety and Welfare
Consideration of Global Factors
Consideration of Cultural Factors
Consideration of Social Factors
Consideration of Environmental Factors
Consideration of Economic Factors
10
1
1
1
1
1
1
CONCLUSIONS (10 pts)
Conclusion (5 pts)
1. Summarizes the major results
2. Answers the problem statement
Recommendations and Future Work (5 pts)
1. Lists future work in the subject area and applications elsewhere
2. Improvements on the current design or experiment
(note this is not a place where you tell the reader you “should have taken better/more accurate
data”)
3
2
2
3
REFERENCES (6 pts)
1.
2.
Each reference is listed and list is in alphabetical order
Proper MLA formatting for each resource. Here is an example…
Kolata, Gina. “Who Needs Hard Drives? Scientists Store Film Clip in DNA.” New York Times. New
York Times, 12 July 2017, https://www.nytimes.com/2017/07/12/science/filmclip-stored- in-dna.html
2
4
APPENDICES (3 pts)
1.
Has appropriate and requested appendix/appendices are required for the project.
3
TOTAL
Comments:
100
Purchase answer to see full
attachment