C语言代写
MTRX1702 - C Programming
Assignment 2
This assignment requires you to design and build a program that hides the contents of
a data le inside a bitmap le. The original data le may subsequently be recovered
from the modi ed bitmap le.
This assignment should take an average student 12 hours to complete.
Submission Deadline: 23:59 pm on the Sunday, 27th of October.
Late submissions will be penalised.
The proportion of the overall marks allocated to each component of the assignment
is indicated after the title enclosed in square brackets.
1 Background
Steganography (which means \concealed writing") is the art of writing hidden mes-
sages, disguised as a clearly visible but innocuous cover message.1 Historically, hidden
messages have taken many forms including the use of invisible ink, or marking selected
letters with pin-pricks, or using cut-out grilles to cover most of a message except the
relevant letters. In ancient times, Histiaeus shaved the head of a trusted slave, tattooed
a message on it, and hid it by waiting for the slave's hair to regrow. In the period fol-
lowing the rst World War, covert messages were photographically reduced to the size
of a full-stop and printed as microdots in ordinary letters and sent via regular post.
The purpose of steganography is to send a message without attracting the attention
of unwary third parties. This is di erent to encryption, where others may be aware
of and possibly intercept encoded messages, but are unable to interpret them. Even
with unbreakable encryption, an encoded message is likely to arouse suspicion, which
is problematic for a covert or under-cover operative. Steganography on the other hand
permits subterfuge in plain sight of the enemy, allowing the obscured message to pass
by unnoticed.
The current digital age facilitates a form of steganography wherein the low-order
bits of an image or audio le are replaced with the message bits. These bits typically
have insigni cant in
uence on the appearance or sound of the original le, and so they
can be modi ed without noticeable e ect. This assignment is concerned with image-
based steganography. You are to hide the contents of a data le in the low-order bits
of a bitmap image le, and later retrieve the original data from a modi ed image.
2 Windows Bitmap Files
Your program is to operate on uncompressed Windows Bitmap les with 24-bit colour
encoding. This is one of the simplest available le-formats and is composed of a \header
block" followed by colour data for each image pixel.
[header info] [pixel 1] ... [pixel N]
1For more information on Steganography, see http://en.wikipedia.org/wiki/Steganography.
1
The contents of the header is not relevant to this project. All you need to know is how
many bytes are in the header so as to skip over them to get to the pixel data. Each
pixel is represented by three bytes; one each for the red, green and blue components of
its colour. Thus, the intensity for a component (eg., red) of a single pixel is given by
an 8-bit value (ie., 0 to 255 unsigned char). It is therefore clear that the low-order
pixel information is simply the least-signi cant bits of each byte.2
Your program shall copy the header block of the bitmap to the output le directly
and without change. The hidden message is to be stored in the low order bits of the
pixel data. You will be provided with code that analyses the bitmap le and tells you
the number of bytes in the header and the number of bytes of pixel data, so that the
separate treatment of header and pixel data is trivial.
3 Basic Speci cation [60%]
Interface. The program is to have a command-line interface. This means using the
alternative form of main() that takes command-line arguments (see Section 13.4 of the
course text).
int main(int argc, char **argv)
The interface for encoding a data le inside a bitmap le takes three lenames as
arguments.3
steg <bmpfile> <datafile> <outputfile>
In this case, <bmpfile> is a Windows bitmap le, <datafile> is the data le, and
<outputfile> is the modi ed bitmap that contains the hidden message. The interface
for decoding a modi ed bitmap and recovering the data le takes only two arguments.
steg <bmpfile> <outputfile>
Here <bmpfile> is a modi ed bitmap and <outputfile> is the recovered data le.
Encoding algorithm. To store the data le inside the bitmap le, the following
steps are carried out.
The BitmapO set eld of the le header is read to identify the start of the pixel
data.
The header block is written to output verbatim.
The rst 32 bytes of pixel data are reserved to store the size of the input data
le. The size is to be stored in the least-signi cant bit of these 32 bytes.
2Compare this to the 8-bit Windows Bitmap le-format, where each pixel is represented by a single
byte, and colour is determined by a colour-map lookup table. In this case the low-order information is
not necessarily the least-signi cant bits of the byte.
3Here the executable is named steg. You may give your executable a di erent name, if you wish.
It does not matter since you will only submit your source code les.
2
Compute the amount of space required to store the input data. From this, com-
pute the number of bits in each pixel byte that will have to be modi ed so as
to store the data. For example, a small data le of N bytes might t into the
least-signi cant bit of the rst 8N pixel bytes. A larger le might need to modify
the two lowest bits of some bytes. In the worst case, the data le will modify all
8 bits of some or all of the pixel bytes, (in which case the data will not be well
hidden).
Store the bits of the data le in the low-order positions of the pixel bytes.
The last step requires the use of bitwise operations. You will read in a byte from the
data le and spread its bits across several pixel bytes.
Decoding algorithm. To extract the data le from the modi ed bitmap involves
the following steps.
Skip over the bitmap header block.
Get the number of bytes of the data le from the rst 32 bytes of the pixel data.
Compute the number of bits from each pixel that store the hidden data.
Extract the relevant bits and reconstruct the data le.
Messages. The program shall provide feedback to the user by printing messages to
the screen. There are three non-error messages.
Usage message. If the program is run with no additional arguments, or the wrong
number of arguments, it is to print the following message and terminate.
Usage: (encode or decode, respectively)
steg <bmpfile> <datafile> <outputfile>
steg <bmpfile> <outputfile>
Overwrite output le. If the output le already exists, query whether to overwrite,
terminating the program if the user doesn't type 'y'.
Output file <filename> already exists. Overwrite (y/n)?
Maximum number of bits modi ed. The ratio of the data le size to the number
of pixel bytes will determine the maximum number of low-order bits per byte that
are overwritten. The program shall print this number.
There was a maximum of <N> bits modified per byte.
3
Errors. If the program encounters an error, it is to print an error message to the
screen and terminate. In particular, the program shall include the following error
messages.
Unable to open a le.
Error: Could not open file <filename>.
Encoding error, where the bitmap is not big enough to store the entire data- le.
Error: Bitmap too small to store data file.
Decoding error, where the 32-bit value that denotes the size of the hidden data
is larger than the available space in the bitmap.
Error: Expected data size is larger than available space in bitmap.
3.1 Compiling
Your submission will be compiled using the following command in the Visual Studio
2010 Command Prompt:
cl *.c
If your program does not compile when this command is run, it cannot
be assessed for compliance with the speci cation and you will receive 0%
for this component of the assignment.
4 Extensions [20%]
If the basic speci cation as described above is implemented, the maximum possible
mark for the assignment shall be 80%. In order to gain a mark of greater than 80%,
one or more extensions must be implemented. These extensions should extend the
functionality of the above program in a useful and appropriate way, given the speci ed
goals of the program. Some suggested extensions are:
Include an interactive user interface in addition to the command-line interface.
Calculate a checksum and include that checksum within the hidden message to
validate the successful decoding of a message.
Calculate an indication of the overall level of le corruption caused by the stegano-
graphic process.
Implement compression by identifying whether the input le uses only ASCII
characters. (This would require additional 'header' information beyond the size
of the output le to be included in the hidden data.)
Parse the header to verify that the le is actually a supported bitmap.
4
Implement Doxygen-style commenting to enhance the quality of the project doc-
umentation.
Create a make le so that the program can be compiled by gcc using the single
command make.
Other possible extensions will also be considered. The suitability of any other
extensions should be discussed by e-mail with the Lecturer (j.ward@acfr.usyd.edu.au).
5 Documentation [20%]
The documentation for this assignment shall comprise two components. In-source doc-
umentation, and a separate short report.
Appropriate commenting and descriptive variable names should be used in all source
code to maximise readability. This will be marked based on the ability of the reader
to understand the operation of the code without reference to the accompanying re-
port. This in-code documentation should NOT discuss design decisions, but simply
the implementation of the program. Each function must have a comment header block
describing the inputs, outputs and a one-sentence description of the operation of the
function.
The short report shall contain a discussion of each module within the program, the
functionality of the module, and the data-
ows between each of the modules. Do not
discuss each individual function within the program. Simply discuss the functionality
of each module as a whole, their dependencies, and list the component functions. If a
multi- le approach to the project has been implemented, ensure the le boundaries are
indicated within the modular discussion. Use diagrams where appropriate. This report
is expected to ll 2-3 pages.
The report shall also include a \Statement of Compliance", which describes how
well the implemented programme complies with the speci cation in the assignment
sheet. It must identify all points of non-compliance, and may provide a justi cation
for this non-compliance. The Statement of Compliance must also clearly and brie
y
describe the additional functionality provided by any extensions.
5
C语言代写的更多相关文章
- 奥运会订票系统c语言代写源码下载
制作能够实现2008北京奥运会网上订票的系统,能够实现购票人员注册.购票.管理人员可以设置各个比赛场地的赛事安排及票数. 程序要求实现的功能如下: 购票者信息注册:购票者可以用昵称和身份证进行注册,若 ...
- C++代做,C++编程代做,C++程序代做,留学生C++ Lab代写
C++代做,C++编程代做,C++程序代做 我们主要面向留学生,广泛接美加澳国内港台等地编程作业代写,中英文均可. C语言代写 C++代写 Python代写 Golang代写 Java代写 一年半的时 ...
- 如何鉴别程序抄袭c语言程序代写
如何鉴别程序抄袭:如何鉴别一份程序代码是抄袭另一份程序.输入:两个C语言源程序文件 输出:抄袭了多少?给出最相似的片段,判断是谁抄袭了谁? 提示:首先进行统一规范化排版,去掉无谓的空格.空行,然后比对 ...
- 实验教学管理系统 c语言程序代写源码下载
问题描述:实验室基本业务活动包括:实验室.班级信息录入.查询与删除:实验室预定等.试设计一个实验教学管理系统,将上述业务活动借助计算机系统完成. 基本要求: 1.必须存储的信息 (1)实验室信息:编号 ...
- 基于JAVA WEB技术旅游服务网站系统设计与实现网上程序代写
基于JAVA WEB技术旅游服务网站系统设计与实现网上程序代写 专业程序代写服务(QQ:928900200) 随着社会的进步.服务行业的服务水平不断发展与提高,宾馆.酒店.旅游等服务行业的信息量和工作 ...
- 代写编程的作业、笔试题、课程设计,包括但不限于C/C++/Python
代写编程作业/笔试题/课程设计,包括但不限于C/C++/Python 先写代码再给钱,不要任何定金!价钱公道,具体见图,诚信第一! (截止2016-11-22已接12单,顺利完成!后文有成功交付的聊天 ...
- 代写assignment
集英服务社,强于形,慧于心 集英服务社,是一家致力于优质学业设计的服务机构,为大家提供优质原创的学业解决方案.多年来,为海内外学子提供了多份原创优质的学业设计解决方案. 集英服务社,代写essay/a ...
- c编写程序完成m名旅客和n辆汽车的同步程序代写
jurassic公园有一个恐龙博物馆和一个公园,有m名旅客和n辆汽车,每辆汽车仅能允许承载一名旅客.旅客在博物馆参观一阵,然后排队乘坐旅行车.当一辆车可用时,他载入一名旅客,再绕花园行驶任意长的时间. ...
- 模拟游客一天的生活与旅游java程序代写源码
在某个城市的商业区里,有一家首饰店,一家饭店,一家面馆,一家火锅店,一家银行,一家当铺 现在有一群来自四川的游客,一群陕西的游客,一群上海的游客,和以上各店家的工作人员在此区域里,请模拟他们一天的生活 ...
随机推荐
- 5.7 NDK开发
JNI开发流程主要分为以下6步: 编写Java源代码 将Java源代码编译成class字节码文件 用javah -jni命令生成.h头文件(-jni参数表示将class中用native声明的函数生成j ...
- HTML编程
通俗的解释:HTML是一个没有穿衣服的人 CSS是穿上了华丽衣服的人 JS是使这个人动起来 HTML是英文Hyper Text Mark-up Language(超文本标记语言)的缩写,他是一种制作万 ...
- codeforces 429E
题意:给定n<=100000线段[l,r],然后给这些线段染色(red or blue),求最后平面上任意一个点被蓝色及红色覆盖次数只差的绝对值不大于1 思路:把每条线段拆成2个点[l<& ...
- How to Call SharePoint 2013 API Service to Query The Lists
How to Call SharePoint 2013 API In SharePoint 2013, we can query the list by it owner service, then ...
- Could not create the view: An unexpected exception was thrown 异常处理
MyEclipse 打开后有时候莫名的在server窗口里抛出"Could not create the view: An unexpected exception was thrown&q ...
- [C#] 與Android共舞–手機post資料給Server (转帖)
最近在搞安卓,跟Server溝通是一定要的,這範例很簡單,就是我在Android 上面,透過POST 的方式傳資料給 Server ,則Server 收到值後直接回傳, Server side 是用a ...
- Qt之课外实践——文件操作(简单清道夫)
说明:这个小项目是关于文件操作的.主要的功能有:重复文件的查找(根据文件的大小),说白了,就是讲大小相同的文件在一起显示出来,供用户自由的选择删除.这个360云盘里的文件去重还差的很远.还有空文件夹的 ...
- paip.web数据绑定 下拉框的api设计 选择框 uapi python .net java swing jsf总结
paip.web数据绑定 下拉框的api设计 选择框 uapi python .net java swing jsf总结 ====总结: 数据绑定下拉框,Uapi 1.最好的是默认绑定..Map(k ...
- 通过rinetd实现端口转发来访问内网的服务
通过rinetd实现端口转发来访问内网的服务 一. 问题描述 通过外网来访问内网的服务 二. 环境要求 需要有一台能够外网访问的机器做端口映射,通过数据包转发来实现外部访问阿里云的内网服务 三 ...
- 努力学习 HTML5 (1)—— 初体验
HTML5 代表未来:W3C ( World Wide Web Consortium, 万维网联盟) 已经放弃 XHTML,从而使 HTML5 成为正式标准并得到认可. 最简单的 HTML5 文档 & ...