Final Report
Final Report
Final Report
CRYPTOGRAPHY
by
Bachelor of Technology
in
Computer Science
May, 2009
TABLE OF CONTENTS Page
DECLARATION ................................................................................................... i
CERTIFICATE ..................................................................................................... ii
ACKNOWLEDGEMENTS .................................................................................. iii
ABSTRACT ........................................................................................................... iv
CHAPTER 1 INTRODUCTION OF PROBLEM …............................................ 1
1.1. Existing System......................................................................................... 2
1.2. Proposed System........................................................................................ 3
CHAPTER 2 CHOICE OF LANGUAGE (vb.net) ................................................. 5
CHAPTER 3 SDLC.............................................................................................. 6
CHAPTER 4 FEASIBILITY STUDY................................................................... 9
4.1. Types of Feasibility Study……………………………………………… 10
CHAPTER 5 SOFTWARE REQUIREMENT SPECIFICATION ……………… 12
5.1. Purpose of SRS............................................................................................. 13
5.2. Scope of SRS................................................................................................. 14
CHAPTER 6 FORMAT FOR SRS …...................................................................... 15
CHAPTER 7 SYSTEM ANALYSIS……………………………………………… 17
7.1 Introduction.................................. .................................................................. 18
7.2 Elements of System Analysis.................................. ....................................... 19
7.3. Techniques Used For Analysis.................................... .................................. 19
7.4. Types Of Observation Methods..................................................................... 20
7.5. Existing System.............................................................................................. 20
7.6 Drawback in the existing system........................................................................ 21
7.7. Proposed System................................................................... ……………... 21
7.8 Advantage of the Proposed System………………………………………... 21
CHAPTER 8 DESCRIPTION OF ALGORITHMS USED……………………… . 22
CHAPTER 9 DATA FLOW DIAGRAM AND DESIGN ……………………….. 52
CHAPTER 10 CODING ………………………………………………………… 55
CHAPTER 11 TESTING …………………………………………………… 203
CHAPTER 12 IMPLEMENTATION AND MAINTENANCE................................ 206
DECLARATION
we hereby declare that this submission is our own work and that, to the best of my
knowledge and belief, it contains no material previously published or written by
another person nor material which to a substantial extent has been accepted for the
award of any other degree or diploma of the university or other institute of higher
learning, except where due acknowledgment has been made in the text.
Signature:
Date: Supervisor
It gives us a great sense of pleasure to present the report of the B. Tech Project undertaken
during B. Tech. Final Year. We owe special debt of gratitude to Ms. Archana Pandey,
Department of Information Technology, Ideal Institute Of Technology, Ghaziabad for her
constant support and guidance throughout the course of our work. Her sincerity,
thoroughness and perseverance have been a constant source of inspiration for us. It is only
her cognizant efforts that our endeavors have seen light of the day.
We also take the opportunity to acknowledge the contribution of Mr. Naresh Trivedi, Head of
Department of Information Technology, Ideal Institute Of Technology, Ghaziabad for his full
support and assistance during the development of the project.
We also do not like to miss the opportunity to acknowledge the contribution of all faculty
members of the department for their kind assistance and cooperation during the development
of our project. Last but not the least, we acknowledge our friends for their contribution in the
completion of the project.
Signature:
This makes DATA COMPRESSION AND CRYPTOGRAPHY SYSTEM easy to use and implement
INTRODUCTION OF PROBLEM
Two different software are required for the purpose of Compression and
Encryption/Decryption.
Data type of different software may not be the same (compatibility issue)
Using two different software requires more time as compared to using one .
Proposed system is a software that provides the functionality of both the Compression and
Cryptography .There are two main modules in this proposed software one provides security to
the data via Encryption /Decryption and other reduces the size if the data by compressing it.
For providing cryptograpic utilities AES, DES, triple DES and seganography is used. For
compression (reducing the size of data ) various algorithms like run length encoding, JPEG
compression, LZW are used. The proposed system will eradicate all the problems related to
the use of two different software as in the existing system. The proposed system is easy to use
and handle .
The proposed system will provide the functionality of both the Compression and that of
Cryptography .
The use of one system for both compression of the data and providing security to it will
be less time consuming as compared to that of the existing system.
The proposed system removes the compatibility issue that is prevailing when we have to
use two different software
The use of proposed system will also reduce the budget as only one software has to be
purchased for providing both the security and compression.
The use of the proposed system will also reduce the training as in the existing system
training on two different software are required .
CHOICE OF LANGUAGE
The project Data Compression and Cryptography works on vb.net. vb.net is the language
developed by the Microsoft. Visual Basic is used for devolping this project because it is one of
the powerful programming system that helps in developing sophisticated, graphical
applications that can be run on Microsoft Window environment
Visual Basic supports event driven programming .A program can be developed in three ways
–in modular programming style or in object-oriented style or in event-driven style .In modular
or procedural programming style emphasis is on the the procedure not on the data .In object-
oriented programming style emphasis is on the objects. Event driven programming style
responds to the to the user events and is driven by the occurrence of the user event.Visual
Basic provides the combination of the event-driven and the object-oriented style .
Active X support.
N-tier architecture .
Quick development. VB offers many tool that provide a quick and easy way to
develop applications.
Wizards.VB also provides many wizards that can automate tasks or even automate
coding.
SYSTEM DEVELOPMENT LIFE CYCLE(SDLC) MODEL
This is also known as Classic Life Cycle Model (or) Linear Sequential Model (or) Waterfall
Method. This model has the following activities.
As software is always of a large system (or business), work begins by establishing the
requirements for all system elements and then allocating some subset of these requirements
to software. This system view is essential when the software must interface with other
elements such as hardware, people and other resources. System is the basic and very critical
requirement for the existence of software in any entity. So if the system is not in place, the
system should be engineered and put in place. In some cases, to extract the maximum
output, the system should be re-engineered and spruced up. Once the ideal system is
engineered or tuned, the development team studies the software requirement for the system.
This process is also known as feasibility study. In this phase, the development team visits the
customer and studies their system. They investigate the need for possible software automation
in the given system. By the end of the feasibility study, the team furnishes a document that
holds the different specific recommendations for the candidate system. It also includes the
personnel assignments, costs, project schedule, target dates etc.... The requirement gathering
process is intensified and focussed specially on software. To understand the nature of the
program(s) to be built, the system engineer or "Analyst" must understand the information
domain for the software, as well as required function, behavior, performance and interfacing.
The essential purpose of this phase is to find the need and to define the problem that needs to
be solved .
In this phase, the software development process, the software's overall structure and its
nuances are defined. In terms of the client/server technology, the number of tiers
needed for the package architecture, the database design, the data structure design etc...
are all defined in this phase. A software development model is thus created. Analysis
and Design are very crucial in the whole development cycle. Any glitch in the design
phase could be very expensive to solve in the later stage of the software
development. Much care is taken during this phase. The logical system of the product
is developed in this phase.
4. Code Generation
The design must be translated into a machine-readable form. The code generation step
performs this task. If the design is performed in a detailed manner, code generation can be
accomplished without much complication. Programming tools like compilers, interpreters,
debuggers etc... are used to generate the code. Different high level programming languages
like C, C++, Pascal, Java are used for coding. With respect to the type of application, the
right programming language is chosen.
5. Testing
Once the code is generated, the software program testing begins. Different testing
methodologies are available to unravel the bugs that were committed during the previous
phases. Different testing tools and methodologies are already available. Some companies build
their own testing tools that are tailor made for their own development operations.
6. Maintenance
The software will definitely undergo change once it is delivered to the customer. There can be
many reasons for this change to occur. Change could happen because of some unexpected
input values into the system. In addition, the changes in the system could directly affect the
software operations. The software should be developed to accommodate changes that could
happen during the post implementation period.
FEASIBILITY STUDY
To test the feasibility of this Online Examination System, following aspects were studied in
details so that there should not be any resistance from the personnel or the user.
Technical feasibility
Economic feasibility
Operational feasibility
Social feasibility
TECHNICAL FEASIBILITY :-
It is determined by evaluating the hardware and supportive software. Hardware requirement
mini computer with 16MB of main memory space. Software requirement visual studio 2005
and window XP for implementation of this system.
ECONOMIC FEASIBILITY:-
Economic analysis is the most frequently used technique for evaluating the effectiveness of a
proposed system. More commonly known as cost-benefit analysis; the procedure is to
determine the benefits and savings that are expected from a proposed system and compare
them with costs. If benefits outweigh costs, a decision is taken to design and implement the
system.
OPERATIONAL FEASIABILITY:-
Proposed system has benefits as it can be turned into information system that will meet the
operating requirement, two main point that followed operational feasibility are:
(1) There is abundant support for the project from user. The new system will linked and used
to extend the person won’t be able to see reasons for a change there may be resistance.
(2) The current methods are acceptance to users. If they are not users, many welcome a change
that will bring about a more operational and useful system.
SOCIAL FEASIBILITY:-
It is the determination of whether a proposed project will be acceptable to the people or not.
This determination typically examines the probability of the project being accepted by the
group directly affected the proposed system change.
Every one wants to invest his money in a reputed insurance company. Such activity and fast
information system improve the social circle of such organization and people as well. Such
projects are always helpful to build an image of the Insurance Company.
SOFTWARE REQIUREMENT SPECIFICATION
SYSTEM REQUIREMENTS
Hardware Requirement:
Software Requirement:
The document covers the detailed description of the different process. The details include:
• Description of process.
• Proposed process model.
• Assumptions dependencies and constraints.
FORMAT FOR THE SRS
VALIDATION CRITERIA: It is probably the most important and ironically the most often
neglected section of the software requirement specification. This section is neglected because
completing it demands a thorough understanding of the software requirements. Specification
of validation criteria acts as an implicit review of all other requirements, so it is essential that
time and attention is given to this section.
system to find out the drawbacks and the system requirements, which will have to satisfy
7.1. INTRODUCTION
Analysis is the most important phase in he life cycle of a system. While studying or
analyzing and analyst should understand well all aspects of the system should be capable
enough to analyze them if the system is wrongly analyzed then it may lead to an incorrect
design and sub sequently to faulty system. System analyse therefore is the process of studying
the system in details and collecting the necessary information regarding the system to be
designed. System analysis is the management technique that helps us in designing and
improving an existing system.
In computer system the CPU must interact with other units to solve a problem.
stated.
Outputs : First of all, we must determine what the objective or goals are, what is the purpose
of our work or what is the main aim behind the system.
Once we know the aim , we can try to achieve it in best possible way. These become the
outputs, which the system analyst keeps into mind.
Inputs : once we know the output, we can easily determine what the input should be. The
essential elements of inputs are :
i. Accuracy
ii. Timeliness
iii. Proper format
iv. Economy
Files: Most of the inputs necessary for the system may be historical data which are sorted in
form of files either in terms of isolated facts or in large volumes.
Processes : this involves the programs and the way in which the data is processed through the
computer. The processing involves a set of logical steps. These steps are required to be
instructed the computer and this are done by a series of instructions called programs.
ON-SITE OBSERVATION:
This is one of the main tools for gathering information. It is a process of recognizing and
noticing people, objects and occurrence to obtain information.
The major objective of this tool is to get as possible to the real system being studied.
For this reason it is extensively used by the system analyst during development of a particular
system.
OBTRUSIVE METHOD: An obtrusive observation takes place when the respondent knows
he/she is being observed.
DIRECT METHOD: A direct observation takes place when the analyst actually observes the
subject or the system at work.
Existing system are the different software that provides the compression only and some
provide cryptography only .If some organization wants to send an e-mail that contains secret
data and also to reduce the size of the data then different software are to be used .One for
providing encryption and another for providing compression .This will lead to delay of time
since two different software are to be used .Also if the data type of the different software are
not compatible then it can lead to problems .Use of two different software for providing
security and compression poses different problems for the user .Various issues regarding the
use of the two different software has to be solved like compatibility of the data in the two
software .
7.6 DRAWBACKS IN EXISTING SYSTEM
Two different software are required for the purpose of Compression and
Encryption/Decryption.
Data type of different software may not be the same (compatibility issue)
Using two different software requires more time as compared to using one .
Proposed system is a software that provides the functionality of both the Compression and
Cryptography .There are two different modules in this proposed software one provides
security to the data via Encryption /Decryption and other reduces the size if the data by
compressing it .The main advantage of the proposed system over the existing system are stated
below
All forms of information represented in digital form (0 or 1), such as numbers, text, sound,
image, and video-have some elements, which are redundant. We can have some equipment,
which will study or scan the information to be sent and substitute some kind of control
information to represent the repetitive data and transmit it to achieve compression. At the
other end, we can have another equipment, which will interpret these control characters and
expand the compressed data to the original form. Obviously, the addition of control
information is an overhead, but so long as the amount of data including the overhead to be
transmitted is less than the original one, compression will be beneficial.
1. In loss-less compression, no information is lost. All the information (that is, all the
numbers representing some text or graphic image in digital form) is compressed and
none is discarded. This type of compression is used when we must not lose or misplace
even a single bit in the original message. Examples of such messages are text-based
messages, such as funds transfer, electronic mail, documents, memos, etc.
All compression systems require two algorithms: one for compressing the data at the source,
and another for decompressing it at the destination. These two algorithms are referred to as the
encoding and decoding algorithms, respectively.
The work on the exploration of efficiency, redundancy and entropy of a message has its origin
back in the 1940s. Based on all research so far, two ways of representing a character or a
symbol have emerged: static coding and dynamic coding, as shown in figure:
Data Encoding Schemes
STATIC CODING:
This scheme uses fixed-length codes. A fixed-length code uniquely identifies a character or
symbol. For encoding, each symbol is replaced by its corresponding code. This method is
simple. However, because it does not consider the frequency or probability of the occurrence
of the various symbols in a message, it is not very efficient.
Let us consider a message containing M different symbols. Let us assume further that N is the
number of digits needed to represent these M symbols. Let B be the base of the number
system. Then, we have the following equation:
N=logBM
We know that computers use the binary number system, which has base of 2. thus, substituting
2 for B in the above equation, we get:
N=log2M
DYNAMIC CODING:
This scheme uses variable-length codes. A variable-length code uniquely identifies a character
or symbol. For encoding, each symbol is replaced by its corresponding code. This method is
more complicated. However, because it considers the frequency or probability of the various
symbols in a message, it is not much efficient than static coding.
Variable-length codes: Let us consider an example. If we know beforehand that the character
A occurs far more frequently in our message as compared to another character X, then we
would assign a short code (i.e. lesser number of bits) to A, and a long code (i.e. more number
of bits) to X. this way, we would use less number of bits for all message, since it is likely to
contain many As than Xs.
Claude Shannon at Bell Labs and R M Fano at MIT developed the Shannon-Fano
Algorithm. The algorithm is related to the compression of text. The algorithm codifies text
into a code at the sender’s end, and transforms the code back into the original text at the
receiver’s end. The coded form needs lesser amount of space on the disk, and also while it is
being communicated, thus resulting into data compression.
SHANNON-FANO ALGORITHM:
1. Calculate the total number of distinct symbols appearing in the message/text. Also
calculate the frequency of each of them. For this use the formula:
3. Divide the list horizontally so that the sum of frequencies in the upper half is
approximately same as the sum of frequencies in the lower half.
5. Build the Shannon-Fano (SF) Tree so that the upper half becomes the left sub-tree and
the lower half becomes the right sub-tree. Ensure that all the symbols in the text are
covered.
6. Assign Shannon-Fano (SF) code to every symbol. For this, assign 0 to the left branch
and 1 to the right branch.
7. For obtaining the code for any symbol, the code is the Shannon-Fano (SF) from the
root to that leaf
HUFFMAN CODING:
The Huffman algorithm is an improvement over the Shannon-Fano algorithm. The Huffman
algorithm is also a dynamic coding mechanism, in the sense that it assigns variable-length
codes to the symbols, based on their frequencies. In that sense, it is similar to the Shannon-
Fano algorithm. Like in Shannon-Fano algorithm we build a binary tree of symbols in the case
of the Huffman algorithm as well. We also assign binary values (i.e. 0 or 1) to each node in a
similar fashion.
The Huffman algorithm thus pays due attention to the various symbols based on the likelihood
of their occurring (i.e. their frequencies). It assigns short codes to symbols occurring more
frequently, and longer codes to symbols occurring less frequently.
The major technical difference between the Shannon-Fano algorithm and the Huffman
algorithm is that the former technique builds a binary tree from the top to bottom, whereas the
latter builds it from the bottom to the top.
1. Consider two symbols with the minimum frequencies from the sorted list of symbols.
Let us call these symbols as A and B.
5. Repeat steps 1 to 4 until all symbols in the list get exhausted. The outcome of this
process is the Huffman binary tree.
6. Assign bit values to the nodes of the tree, similar to the way it is done in the Shannon-
Fano tree. In other words, assign a 0 to every left node, and a 1 to every right node.
7. To find the code for any symbol, start counting from the parent and traverse from top-
to-bottom, each time reading the 0 or 1. This traversal gives the binary code for that
symbol.
ADAPTIVE COMPRESION:
Algorithm such as Shannon-Fano and Huffman use a predefined set of frequencies for
representing symbols. This is based on historical evidence and research into the way symbols
are used in a large number of sample messages. This gives an average indication about how
symbols are used, and how frequently they occur in any message. However, these numbers
may not always be true. For certain specified messages, the frequencies may greatly vary. In
such cases, it is prudent to consider frequencies, as they are likely to occur in these messages.
A technique that considers such possibilities and uses them at run-time is called as adaptive
compression technique or adaptive coding technique.
ADAPTIVE
COMPRESSION COMPRESSION
INPUT CODE INPUT CODE
MODEL MODEL
STATIC
STATIC
DATA
DATA
These techniques use the concept of an index. The idea behind this is quite simple. Suppose
that we have some given text, which needs to be compressed. Then we assume that a
dictionary (which is nothing but a list of words) exists for all the words in the input text. The
compression is then performed as follows: Instead of the actual words, we substitute their
positions or indexes in the dictionary in the output text.
There are various compression algorithms that make use of this technique. Some of these are
explained below:
ARITHMETIC COMPRESSION:
In this, separate algorithms are used for encoding and decoding the text/message. This makes
certain calculations with the probability associated with each symbol. This would be clearer
through the algorithms:
ARITHMETIC CODING:
Initialize
LOW_VALUE=0.0;
HIGH_VALUE=1.0;
Difference=1.0;
LOW_VALUE=LOW_VALUE+Difference*RANGE_FROM(symbol);
HIGH_VALUE=LOW_VALUE+Difference*RANGE_TO(symbol);
Difference=HIGH_VALUE-LOW_VALUE;
DISPLAY_OUTPUT(LOW_VALUE);
ARITHMETIC DECODING:
Do while(Code<>0.0)
Code=Code-RANGE-FROM(symbol) ;
RANGE_TO(symbol)-RANGE_FROM(symbol)
LZ77 CODING:
In 1977, Abraham Lampel and Jacob Ziv proposed the first dictionary-based compression
technique, called as LZ77. the idea of this algorithm is quite simple. Suppose we want to
compress the following text:
LZ78 CODING:
Lampel and Ziv improved this technique the next year to come up with the LZ78 algorithm.
The main difference between the LZ77 and LZ78 algorithms is related to the use of the
dictionary. LZ77 stores the dictionary (i.e. the information regarding compression) inside the
message. However, in case of LZ78, the dictionary is maintained separately, outside of the
main text.
LZW CODING:
Terry Welch improved this algorithm further, and developed the LZW algorithm in 1984.
LZW compression replaces the strings of symbols with single codes. It does not perform any
analysis on the incoming text. Rather, it simply accumulates every new string of symbols in
stable. Compression occurs when a single code is output in the place of a series of symbols.
ADVANTAGES:
1. It produces very good results for text containing lots of repetitive data. This is often the
case with text and images.
3. LZW does not require the sender to send the dictionary along with the compressed text
to the receiver. The receiver is able to reconstruct and use the dictionary only based on
the compressed text.
DISADVANTAGES:
TECHNICAL DETAILS:
The LZW algorithm works in an interesting fashion. While the algorithm reads the input text,
for every symbol/character that it reads the next character immediately. It then adds these two
characters in the dictionary. For example, suppose that currently we are at the character R in a
string PQRS. Then the LZW algorithm makes an entry for RS in the dictionary. This
interesting property makes the compression process much faster and efficient. Another
important technical detail needs to be kept in mind. We know that the ASCII code has the
assigned numeric values between 0 to 255 to various symbols. Therefore, LZW algorithm uses
the first number in its dictionary as a pointer with value 256. That is, the indexing of
dictionary items starts with 256.
STRING = STRING+CHARACTER
ELSE
STRING = CHARACTER
END IF
ENDWHILE
Read OLD_CODE
Output OLD_CODE
Read NEW_CODE
STRING = Get translation of NEW_CODE
Output STRING
OLD_CODE = NEW_CODE
END of WHILE
RUN-LENGTH ENCODING:
In many kinds of data, strings of repeated symbols (bits, numbers, etc) are common. These can
replaced by a special marker not otherwise allowed in the data, followed by the symbol
comprising the run, followed by how many times it occurred. If the special marker itself
occurs in the data, it is duplicated (as in character stuffing). For example, consider the
following string of decimal digits:
3150000000000008458711111111111116354674000000000000000000000065
If we introduce A as the marker and use two-digit numbers for the repetition count, we can
encode the above digit string as
315A01284587A1136354674A02265
Runs are common in multimedia. In audio, runs of zeros often represent silence. In video, runs
of the same color occur in shots of the sky, walls, and many flat surfaces. All of these runs can
be greatly compressed.
BLOCK FORMATION
because, to a first approximation, the multimedia standard for moving pictures, MPEG, is just
the JPEG encoding of each frame separately, plus some extra features for interframe
compression and motion frame separately, plus some extra features for interframe
compression and motion detection. JPEG is defined in International Standard 10918.
STEPS:
QUANTIZATION
ENCODING
JPEG has many modes and many options. For our purposes, though, only the lossy sequential
mode is relevant, and that one is illustrated in Figure. Furthermore, we will concentrate on the
way JPEG is normally used to encode 24-bit RGB video images and will leave out some of the
minor details for the sake of simplicity.
JPEG DECODER
ALGORITHM:
STEP 1: This is a block preparation step. For the sake of specificity, let us assume that the
JPEG input is a 640X480 RGB image with 24 bits/pixel, as shown in the figure. Since using
luminance and chrominance gives a better compression, we first compute the luminance, Y,
and the two chrominances, I and Q (for NTSC), according to the following formulas:
Y = 0.30R+0.59G+0.11B
I = 0.60R-0.28G-0.32B
Q = 0.21R-0.52G+0.31B
For Pal, the chrominances are called U and V and the coefficients are different, but the idea is
the same. SECAM is different from both NTSC and PAL.
RGB Y I
………………………
…………………………. …
……………………… … 24
………………………….
.
………………………. 0
. 8Bit pixel
48 48 …
………………………
0 0 . 1 Block 24
……………………… .
0
24-Bit pixel Block 4799 Q
Separate matrices are constructed for Y, I, and Q, each with elements in the range 0 to 255.
Next, square blocks of four pixels are averaged in the I and Q matrices to reduce them to
320X240. This reduction is lossy, but the eye barely notices it since the eye responds to
luminance more than to chrominance.
Nevertheless, it compresses the data by a factor of two. Now 128 is subtracted from each
element of all three matrices to put 0 in the middle of the range. Finally, each matrix is divided
up into 8X8 blocks. The Y matrix has 4800 blocks; the other two have 1200 blocks each, as
shown in (b).
STEP 2: This is to apply a discrete cosine transformation to each of the 7200 blocks
separately. The output of each DCT is an 8X8 matrix of DCT coefficients. DCT element (0,0)
is the average value of the block. The other elements tell how much spectral power is present
at each spatial frequency. In theory, a DCT is lossless, but in practice using floating-point
numbers and transcendental functions always introduces some roundoff error that results in a
little information loss. Normally, these elements decay rapidly with distance from the origin,
(0,0) as suggested by figure.
Fy
Y
D
C
Y/I/Q T
Amplitutde
The DCT Coefficients
One block of Y X Fx
matrix
STEP 3: This step is called Quantization, in which the less important DCT coefficients are
wiped out. This (lossy) transformation is done by dividing each of the coefficients in the 8X8
DCT matrix by a weight taken from a table. If all the weights are 1, the transformation does
nothing. However, if the weights increase sharply from the origin, higher spatial frequencies
are dropped quickly
Example:
DCT Coefficients
15 8 4 1 4 2 1 0 150 80 20 4 1 0 0 0
0 0 0 4 92 75 18 3 1 0 0 0
92 7 3 1 6 1 0 0 26 19 13 2 1 0 0 0
5 6 0
3 2 2 1 0 0 0 0
52 3 2 8 7 4 0 0
8 6 1 0 0 0 0 0 0 0
12 8 6 4 2 1 0 0 0 0 0 0 0 0 0 0
4 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0
2 2 1 1 0 0 0 0 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0
Here we see that the initial DCT matrix, the Quantization table, and the result obtained by
dividing each DCT element by the corresponding Quantization table element. The values in
the Quantization table are not part of the JPEG standard. Each application must supply its
own, allowing it to control the loss-compression trade-off.
STEP 4: It reduces the (0,0) value of each block (the one in the upper left-hand corner) by
replacing it with the amount it differs from the corresponding element in the previous block.
Since these elements are the averages of their respective blocks, they should change slowly, so
taking the differential values should reduce most of them to small values. No differentials are
computed from the other values. The (0,0) values are referred to as the DC components; the
other values are the AC components.
STEP 5: This linearizes the 64 elements and applies run-length encoding to the list. Scanning
the block from left to right and then top to bottom will not concentrate the zeros together, so a
zig zag scanning pattern is used, as shown in the figure. In this example, the zig zag pattern
produces 38 consecutive 0s at the end of the matrix. This string can be reduced to a single
count saying there are 38 zeros.
There are two essential cryptographic concepts represented in the Encryption namespace. It's
important that every developer understands these concepts before proceeding any further:
1. Symmetric Cryptography
In symmetric encryption, a single key is used for encrypting and decrypting the
data. This type of encryption is quite fast, but has a severe problem: in order to share a
secret with someone, they have to know your key. This implies a very high level of
trust between people sharing secrets; if an unscrupulous person has your key-- or if
your key is intercepted by a spy-- they can decrypt all the messages you send using that
key!
2.Asymmetric Cryptography
The Data Encryption standard (DES) is a symmetric key block cipher published by NIST
(National Institute of Standards and technology.
DES Cipher
Encryption
The Des takes 64 bit plain text and a 56 bit key as a input and produces 64 bit cipher text as
output while encryption.
At the decryption unit 64 bit cipher text is converted back to the 64 bit plain text by using 56
bit key.The encryption process is made of two permutations boxes(P-boxes) called initial and
final permutation and sixteen fiestal rounds.Each fiestal round uses a different key (48 bit).The
initial and final permutation (P-boxes) takes 64 bit input and permute them according to the
predefined rules.The two permutations are reverse of each other.
The round takes L1 and R1 from previous round or from the initial permutation box at the first
round and creates l1and r1 for the next round or to the final permutation box from the last
round.The swapper unit swaps the left and right half of the text and s invertible in nature.
DES FUNCTION:
The Des function applies a 48 bit key to the rightmost 32 bits to produce 32 bit output.This
function is made up of expension P-box,XOR unit,a group of S-boxes and a straight p-box.The
32 bit is given input to expension p-box which expands the 32 bit into 48 bit.These 48 bits are
EXORed with 48 bit round key.The output of the EXORed units is feed into group of eight S-
boxes.The output of these S-boxes are 32 bit which are permuted by a straight P-box on a
predefined rule.
KEY generation of DES:
The round key generator creates sixteen 48 bit keys out of a 56 bit cipher key. The cipher key
is given as 64 bit key in which 8 extra bits are parity bits which are dropped before the actual
key generation process starts. The parity bit drop process drop the parity bits(bit
8,16,24,32…..64) and permutes the remaining bits according to the predefined rules as shown
in the parity bit drop table below. These remaining 56 bits are actually used for key
generation.
After the permutation the keys are devided into 28 bits parts. Each part is shifted left one or
two bits based on the rounds. The two parts are then combined to form a 56 bit part. Then the
compression P-box convert it into 48 bits. These 48 bits is being used as a key for a round.
STRENGTH OF DES:
The strength of DES lies on two facts: key size and nature of algorithm
The use of 56 bit key: 56 bit key is used in encryption,there are 2^56 possible keys.A brute
force attack on such number of keys is impractical.A machine performing one DES encryption
per microsecond would take more than a thousand of years to break the cipher.
TRIPLE DES:
In triple DES three stages of DES are used for encryption and decryption of messages. This
increases the security of DES. Two versions of triple DES are there:
AES is the new encryption standard being used in smart chips, cellphones, and database
encryption. It's fast and secure, and expected to become more widely used in the following
months. Unfortunately, .NET does not include AES in it's encryption library, so you will need
to implement your own class.
AES is fast in both software and hardware, is relatively easy to implement, and requires little
memory Unlike its predecessor DES, AES does not use a Feistel network.
AES has a fixed block size of 128 bits and a key size of 128, 192, or 256 bits, whereas
Rijndael can be specified with block and key sizes in any multiple of 32 bits, with a minimum
of 128 bits and a maximum of 256 bits.
Assuming one byte equals 8 bits, the fixed block size of 128 bits is 128 ÷ 8 = 16 bytes. AES
operates on a 4×4 array of bytes, termed the state (versions of Rijndael with a larger block size
have additional columns in the state). Most AES calculations are done in a special finite field.
The AES cipher is specified as a number of repetitions of transformation rounds that convert
the input plain-text into the final output of cipher-text. Each round consists of several
processing steps, including one that depends on the encryption key.
A set of reverse rounds are applied to transform cipher-text back into the original plain-text
using the same encryption key.
ALGORITHM:
In the SubBytes step, each byte in the array is updated using an 8-bit substitution box, the
Rijndael S-box. This operation provides the non-linearity in the cipher. The S-box used is
derived from the multiplicative inverse over GF(28), known to have good non-linearity
properties. To avoid attacks based on simple algebraic properties, the S-box is constructed by
combining the inverse function with an invertible affine transformation. The S-box is also
chosen to avoid any fixed points (and so is a derangement), and also any opposite fixed points
In the ShiftRows step, bytes in each row of the state are shifted cyclically to the left. The
number of places each byte is shifted differs for each row.
The ShiftRows step operates on the rows of the state; it cyclically shifts the bytes in each row
by a certain offset. For AES, the first row is left unchanged. Each byte of the second row is
shifted one to the left. Similarly, the third and fourth rows are shifted by offsets of two and
three respectively. For the block of size 128 bits and 192 bits the shifting pattern is the same.
In this way, each column of the output state of the ShiftRows step is composed of bytes from
each column of the input state. (Rijndael variants with a larger block size have slightly
different offsets). In the case of the 256-bit block, the first row is unchanged and the shifting
for second, third and fourth row is 1 byte, 3 bytes and 4 bytes respectively - although this
change only applies for the Rijndael cipher when used with a 256-bit block, which is not used
for AES.
The MixColumns step:
In the MixColumns step, each column of the state is multiplied with a fixed polynomial c(x).
In the MixColumns step, the four bytes of each column of the state are combined using an
invertible linear transformation. The MixColumns function takes four bytes as input and
outputs four bytes, where each input byte affects all four output bytes. Together with
ShiftRows, MixColumns provides diffusion in the cipher. Each column is treated as a
polynomial over GF(28) and is then
In the AddRoundKey step, each byte of the state is combined with a byte of the round subkey
using the XOR operation .
In the AddRoundKey step, the subkey is combined with the state. For each round, a subkey is
derived from the main key using Rijndael's key schedule; each subkey is the same size as the
state. The subkey is added by combining each byte of the state with the corresponding byte of
the subkey using bitwise XOR.
Optimization of the cipher
On systems with 32-bit or larger words, it is possible to speed up execution of this cipher by
combining SubBytes and ShiftRows with MixColumns, and transforming them into a
sequence of table lookups. This requires four 256-entry 32-bit tables, which utilizes a total of
four kilobytes (4096 bytes) of memory—one kilobyte for each table. A round can now be done
with 16 table lookups and 12 32-bit exclusive-or operations, followed by four 32-bit
exclusive-or operations in the AddRoundKey step.
If the resulting four kilobyte table size is too large for a given target platform, the table lookup
operation can be performed with a single 256-entry 32-bit table by the use of circular
rotates.Using a byte-oriented approach it is possible to combine the SubBytes, ShiftRows,
and MixColumns steps into a single round operation.
DIGITAL IMAGES
Introduction
When using digital equipment to capture, store, modify and view photographic
images, they must first be converted to a set of numbers in a process called digitization
or scanning. Computers are very good at storing and manipulating numbers, so
once your image has been digitized you can use your computer to archive, examine,
alter, display, transmit, or print your photographs in an incredible variety of ways.
Digital images are composed of pixels (short for picture elements). Each pixel represents
the color (or gray level for black and white photos) at a single point in the
image, so a pixel is like a tiny dot of a particular color. By measuring the color of an
image at a large number of points, we can create a digital approximation of the image
from which a copy of the original can be reconstructed. Pixels are a little like grain
particles in a conventional photographic image, but arranged in a regular pattern of
rows and columns and store information somewhat differently. A digital image is a
rectangular array of pixels sometimes called a bitmap.
STEGANOGRAPHY
I. Introduction
This paper's focus is on a relatively new field of study in Information Technology known
as Steganography. This paper will take an in-depth look at this technology by ntroducing
the reader to various concepts of Steganography, a brief history of Steganography and a look
at some of the Steganographic techniques available today. The paper will close by looking at
how we can use Steganography in an open-systems environment such as the Internet, as well
as some of the tools and resources available to help us accomplish this.
In this section we will discuss Steganography at length. We will start by looking at the
different types of Steganography generally used in practice today along with some of the other
principles that are used in Steganography. We will then look at some of the
Steganographic techniques in use today. This is where we will look at the nuts and bolts
of Steganography and all the different ways we can use this technology. We will then
close by going over Steganalysis. Steganalysis concentrates on the art and science of
finding and or destroying secret messages that have been produced using any of the
various steganographic techniques we will cover in this paper.
To start, lets look at what a theoretically perfect secret communication (Steganography)
would consist of. To illustrate this concept, we will use three fictitious characters named
Amy, Bret and Crystal. Amy wants to send a secret message (M) to Bret using a random (R)
harmless message to create a cover (C) which can be sent to Bret without raising suspicion.
Amy then changes the cover message (C) to a stego-object (S) by embedding the secret
message (M) into the cover message (C) by using a stego-key (K). Amy should then be able to
send the stegoobject (S) to Bret without being detected by Crystal. Bret will then be able to
read the secret message (M) because he knows the stego-key (K) used to embed it into the
cover message (C). As Fabien A.P. Petitcolas [2] points out, "in a 'perfect' system, a normal
cover should not be distinguishable from a stego-object, neither by a human nor by a computer
looking for statistical patterns." In practice, however, this is not always the case. In order to
embed secret data into a cover message, the cover must contain a sufficient amount of
redundant data or noise. This is because the embedding process Steganography uses, actually
replaces this redundant data with the secret message. This limits the types of data that we can
use with Steganography.
In practice, there are basically three types of steganographic protocols used. They are
Pure Steganography, Secret Key Steganography and Public Key Steganography.
Pure Steganography is defined as a steganographic system that does not require the
exchange of a cipher such as a stego-key. This method of Steganography is the least
secure means by which to communicate secretly because the sender and receiver can rely only
upon the presumption that no other parties are aware of this secret message. Using open
systems such as the Internet, we know this is not the case at all.
Secret Key Steganography is defined as a steganographic system that requires the
exchange of a secret key (stego-key) prior to communication. Secret Key Steganography takes
a cover message and embeds the secret message inside of it by using a secret key (stego-key).
Only the parties who know the secret key can reverse the process and read the secret message.
Unlike Pure Steganography where a perceived invisible communication channel is present,
Secret Key Steganography exchanges a stego-key, which makes it more susceptible to
interception. The benefit to Secret Key Steganography is even if it is intercepted, only parties
who know the secret key can extract the secret message. Public Key Steganography takes the
concepts from Public Key Cryptography as explained below. Public Key Steganography is
defined as a steganographic system that uses a public key and a private key to secure the
communication between the parties wanting to communicate secretly. The sender will use the
public key during the encoding process and only the private key, which has a direct
mathematical relationship with the public key, can decipher the secret message. Public Key
Steganography provides a more robust way of implementing a steganographic system because
it can utilize a much more robust and researched technology in Public Key Cryptography. It
also has multiple levels of security in that unwanted parties must first suspect the use of
steganography and then they would have to find a way to crack the algorithm used by the
public key system before they could intercept the secret message.
Encoding secret messages in text can be a very challenging task. This is because
text files have a very small amount of redundant data to replace with a secret message.
Another drawback is the ease of which text based Steganography can be altered by an
unwanted parties by just changing the text itself or reformatting the text to some other
form (from .TXT to .PDF, etc.). There are numerous methods by which to accomplish
text based Steganography. I will introduce a few of the more popular encoding methods
below.
= AF19 FA27 2F94 998D FDB5 DE3D F8B5 06E4 A169 4E46
Line-shift encoding involves actually shifting each line of text vertically up or
down by as little as 3 centimeters. Depending on whether the line was up or down from
the stationary line would equate to a value that would or could be encoded into a secret
message.
Word-shift encoding works in much the same way that line-shift encoding works,
only we use the horizontal spaces between words to equate a value for the hidden
message. This method of encoding is less visible than line-shift encoding but requires that the
text format support variable spacing.
Feature specific encoding involves encoding secret messages into formatted text
by changing certain text attributes such as vertical/horizontal length of letters such as b,
d, T, etc. This is by far the hardest text encoding method to intercept as each type of
formatted text has a large amount of features that can be used for encoding the secret
message. All three of these text based encoding methods require either the original file or the
knowledge of the original files formatting to be able to decode the secret message.
Coding secret messages in digital images is by far the most widely used of all
methods in the digital world of today. This is because it can take advantage of the limited
power of the human visual system (HVS). Almost any plain text, cipher text, image and any
other media that can be encoded into a bit stream can be hidden in a digital image. With the
continued growth of strong graphics power in computers and the research being put into image
based Steganography, this field will continue to grow at a very rapid pace. Before diving into
coding techniques for digital images, a brief explanation of digital image architecture and
digital image compression techniques should be explained. As Duncan Sellars [7] explains
"To a computer, an image is an array of numbers that represent light intensities at various
points, or pixels. These pixels make up the images raster data." When dealing with digital
images for use with Steganography, 8-bit and 24-bit per pixel image files are typical. Both
have advantages and disadvantages, as we will explain below. 8-bit images are a great format
to use because of their relatively small size. The drawback is that only 256 possible colors can
be used which can be a potential problem during encoding. Usually a gray scale color palette
is used when dealing with 8-bit images such as (.GIF) because its gradual change in color will
be harder to detect after the image has been encoded with the secret message. 24-bit images
offer much more flexibility when used for Steganography. The large numbers of colors (over
16 million) that can be used
go well beyond the human visual system (HVS), which makes it very hard to detect once a
secret message, has been encoded. The other benefit is that a much larger amount of hidden
data can be encoded into a 24-bit digital image as opposed to an 8-bit digital image. The one
major drawback to 24-bit digital images is their large size (usually in MB) makes them more
suspect than the much smaller 8-bit digital images (usually in
KB) when sent over an open system such as the Internet. Digital image compression is a good
solution to large digital images such as the 24-bit images mentioned earlier. There are two
types of compression used in digital images, lossy and lossless. Lossy compression such as
(.JPEG) greatly reduces the size of a digital image by removing excess image data and
calculating a close approximation of the original image. Lossy compression is usually used
with 24-bit digital images to reduce its size, but it does carry one major drawback. Lossy
compression techniques increase the possibility that the uncompressed secret message will
lose parts of its contents because of the fact that lossy compression removes what it sees as
excess image data. Lossless compression techniques, as the name suggests, keeps the original
digital image in tact without the chance of loss. It is for this reason that it is the compression
technique of choice for steganographic uses. Examples of lossless compression techniques are
(.GIF and .BMP). The only drawback to lossless image compression is that it doesn't do a very
good job at compressing the size of the image data.
We will now discuss a couple of the more popular digital image encoding techniques used
today. They are least significant bit (LSB) encoding and masking and filtering techniques.
Least significant bit (LSB) encoding is by far the most popular of the coding techniques used
for digital images. By using the LSB of each byte (8 bits) in an image for a secret message,
you can store 3 bits of data in each pixel for 24-bit images and 1 bit in each pixel for 8-bit
images. As you can see, much more information can be stored in a 24-bit image file.
Depending on the color palette used for the cover image (i.e., all gray), it is possible to take 2
LSB's from one byte without the human visual system (HVS) being able to tell the difference.
The only problem with this technique is that it is very vulnerable to attacks such as image
changes and formatting (i.e., changing from .GIF to .JPEG).
Masking and filtering techniques for digital image encoding such as Digital
Watermarking (i.e.- integrating a companies logo on there web content) are more popular with
lossy compression techniques such as (.JPEG). This technique actually extends an images data
by masking the secret data over the original data as opposed to hiding information inside of
the data. Some experts argue that this is definitely a form of Information Hiding, but not
technically Steganography. The beauty of Masking and
Filtering techniques are that they are immune to image manipulation which makes there
possible uses very robust.
There are techniques that use complex algorithms, image transformation techniques and image
encryption techniques which are still, relatively new, but show promise to be more secure and
robust ways to use digital images in Steganography.
COLOR MATRIX
INTRODUCTION:
This article discusses color operations on digital images, using the new ColorMatrix class
provided by GDI+. The ColorMatrix is a welcome addition to the GDI library, especially with
the increase in demand of digital imaging applications, as more and more consumer products
are made available. This class, as well as many other new GDI classes, provide more control
to the developer and reduce dependence on 3rd party applications such as LEAD tools, and
others. Some basic knowledge of matrix operations (multiplication, addition, etc), the RGBA
colorspace and GDI+ is assumed.
BACKGROUND:
ColorMatrix operations are performed in the RGBA colorspace (red, green, blue, alpha). A
ColorMatrix consists of a 5x5 matrix, with color values normalized to 1 for full intensity (255
-> 1.0). You might expect the matrix to be 4x4 ( [R, G, B, A] ), which would be sufficient if
we only needed to perform linear transformations (multiplication: scaling, rotation, etc).
However, one of the most frequent color manipulations, color adjustment, requires adding
color values. This is a non-linear operation, referred to as a translation. Adding a 5th element
to the color vector ( [R, G, B, A, w] ) combines these two operations, linear and non-linear,
into a single operation called an affine transformation. The 5th element of the color vector is
simply a dummy element, always with a value of 1, which only serves to allow a translation
(addition) of the color vector.
The example below scales the color vector [255, 128, 102, 255] by .5 and then adds a value of
26 to the R, G and B components, leaving the A component at full intensity. Remember that
the component values are normalized, with full intensity, 255, equal to 1.0 (values have been
rounded to the nearest tenth). Also notice the addition of the 5th element to the color vector,
which is simply ignored in the resultant color vector.
Now that we've covered the basic principle of the ColorMatrix and it's operations on color
vectors, we can start exploring some practical uses.
DESIGN
DATA FLOW DIAGRAMS
What is DFD:-
A Data Flow Diagram is a graphical technique that depicts information flow and
the transform that are applied as data moves from input to output.The Data Flow Diagram is
also known as Data Flow Graph or Bubble chart
(1)To provide an indication of how data is transformed as they move through the system
(2) To depict the function and sub function that transform the data
The Dfd provides additional information that is used during the analysis of the information
domain and serves as basis for modeling of function. The data flow diagram may be portioned
into levels that represents increasing information flow and function call.The DFD may be
divided into many levels-
(1)0 level DFD(CAD)-In zero level DFD we represent whole system and its external entities
with Data Flow it is also called Context Analysis Diagram.
(3)Then after one level DFD it can again further enlarge make the expanded DFD
INPUT
ENCRYPTE
D DATA
COMPRESSION (JPEG,
LZW, RUN-LENGTH
ENCODING, FORMAT COMPRESSED
CONVERSION) DATA(IMAGE,
TEXT)
INPUT (TEXT,
IMAGES)
CRYPTOGRAPHY
(DES, AES,
TRANSPOSITION,
TRIPLE DES, UNREADABLE
STEGNOGRAPHY) /HIDDEN MESSAGE
End If
Timer1.Dispose()
Me.Visible = False
Form1.Show()
End If
End Sub
End Sub
Private Sub Label8_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label8.Click
End Sub
End Class
FORM1.VB
Imports System.Drawing.Imaging
Imports system.threading
Public Class Form1
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
End If
End Sub
picResult.Image = bm
picResult.Refresh()
m_Alpha += m_DAlpha
If m_Alpha > 1 Then
m_Alpha = 1
m_DAlpha *= -1
ElseIf m_Alpha < 0 Then
m_Alpha = 0
m_DAlpha *= -1
End If
End Sub
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Dim t As Date
t = TimeOfDay
ltime.Text = t
End Sub
End Class
IMAGEANALYSER.VB
Imports System
Imports System.Text
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
Me.Panel1.BackColor = System.Drawing.Color.FromArgb(CType(CType(0,
Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte),
Integer))
Me.Panel1.BackgroundImage =
Global.DCC_final.My.Resources.Resources.untitled21
Me.Panel1.BackgroundImageLayout =
System.Windows.Forms.ImageLayout.Stretch
Me.Panel1.Controls.Add(Me.picResult)
Me.Panel1.ForeColor = System.Drawing.Color.White
Me.Panel1.Location = New System.Drawing.Point(-3, -1)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(810, 147)
Me.Panel1.TabIndex = 25
'
Me.picResult.ImeMode = System.Windows.Forms.ImeMode.NoControl
Me.picResult.Location = New System.Drawing.Point(228, 0)
Me.picResult.Name = "picResult"
Me.picResult.Size = New System.Drawing.Size(646, 147)
Me.picResult.TabIndex = 20
Me.picResult.TabStop = False
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte),
Integer), CType(CType(255, Byte), Integer), CType(CType(128, Byte),
Integer))
Me.ClientSize = New System.Drawing.Size(805, 587)
Me.Controls.Add(Me.Panel2)
Me.Controls.Add(Me.Panel1)
Me.Controls.Add(Me.button2)
Me.Controls.Add(Me.button1)
Me.Controls.Add(Me.textBox1)
Me.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.SizableToolWindow
Me.Name = "imageanalyservb"
Me.Text = "r"
Me.Panel2.ResumeLayout(False)
Me.Panel2.PerformLayout()
CType(Me.picSrc2,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.picSrc1,
System.ComponentModel.ISupportInitialize).EndInit()
Me.Panel1.ResumeLayout(False)
CType(Me.picResult,
System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Private m_Alpha As Single = 0 Private m_DAlpha As Single = 0.05
picResult.Image = bm
picResult.Refresh()
m_Alpha += m_DAlpha
If m_Alpha > 1 Then
m_Alpha = 1
m_DAlpha *= -1
ElseIf m_Alpha < 0 Then
m_Alpha = 0
m_DAlpha *= -1
End If
End Sub
#End Region
<STAThread()> _
Private Shared Sub Main()
Application.Run(New imageanalyservb())
End Sub
sb.Append(vbTab)
For index2 = 0 To 15
sb.Append(" ")
End If
Next
sb.Append(vbTab)
For index2 = 0 To 15
sb.Append(".")
Else
sb.Append(c)
End If
End If
Next
Return sb.ToString()
End Function
Me.textBox1.Text = ""
Case &H0
s = "PropertyTagGpsVer "
Exit Select
Case &H1
s = "PropertyTagGpsLatitudeRef "
Exit Select
Case &H2
s = "PropertyTagGpsLatitude "
Exit Select
Case &H3
s = "PropertyTagGpsLongitudeRef "
Exit Select
Case &H4
s = "PropertyTagGpsLongitude "
Exit Select
Case &H5
s = "PropertyTagGpsAltitudeRef "
Exit Select
Case &H6
s = "PropertyTagGpsAltitude "
Exit Select
Case &H7
s = "PropertyTagGpsGpsTime "
Exit Select
Case &H8
s = "PropertyTagGpsGpsSatellites "
Exit Select
Case &H9
s = "PropertyTagGpsGpsStatus "
Exit Select
Case &HA
s = "PropertyTagGpsGpsMeasureMode "
Exit Select
Case &HB
s = "PropertyTagGpsGpsDop "
Exit Select
Case &HC
s = "PropertyTagGpsSpeedRef "
Exit Select
Case &HD
s = "PropertyTagGpsSpeed "
Exit Select
Case &HE
s = "PropertyTagGpsTrackRef "
Exit Select
Case &HF
s = "PropertyTagGpsTrack "
Exit Select
Case &H10
s = "PropertyTagGpsImgDirRef "
Exit Select
Case &H11
s = "PropertyTagGpsImgDir "
Exit Select
Case &H12
s = "PropertyTagGpsMapDatum "
Exit Select
Case &H13
s = "PropertyTagGpsDestLatRef "
Exit Select
Case &H14
s = "PropertyTagGpsDestLat "
Exit Select
Case &H15
s = "PropertyTagGpsDestLongRef "
Exit Select
Case &H16
s = "PropertyTagGpsDestLong "
Exit Select
Case &H17
s = "PropertyTagGpsDestBearRef "
Exit Select
Case &H18
s = "PropertyTagGpsDestBear "
Exit Select
Case &H19
s = "PropertyTagGpsDestDistRef "
Exit Select
Case &H1A
s = "PropertyTagGpsDestDist "
Exit Select
Case &HFE
s = "PropertyTagNewSubfileType "
Exit Select
Case &HFF
s = "PropertyTagSubfileType "
Exit Select
Case &H100
s = "PropertyTagImageWidth "
Exit Select
Case &H101
s = "PropertyTagImageHeight "
Exit Select
Case &H102
s = "PropertyTagBitsPerSample "
Exit Select
Case &H103
s = "PropertyTagCompression "
Exit Select
Case &H106
s = "PropertyTagPhotometricInterp "
Exit Select
Case &H107
s = "PropertyTagThreshHolding "
Exit Select
Case &H108
s = "PropertyTagCellWidth "
Exit Select
Case &H109
s = "PropertyTagCellHeight "
Exit Select
Case &H10A
s = "PropertyTagFillOrder "
Exit Select
Case &H10D
s = "PropertyTagDocumentName "
Exit Select
Case &H10E
s = "PropertyTagImageDescription "
Exit Select
Case &H10F
s = "PropertyTagEquipMake "
Exit Select
Case &H110
s = "PropertyTagEquipModel "
Exit Select
Case &H111
s = "PropertyTagStripOffsets "
Exit Select
Case &H112
s = "PropertyTagOrientation "
Exit Select
Case &H115
s = "PropertyTagSamplesPerPixel "
Exit Select
Case &H116
s = "PropertyTagRowsPerStrip "
Exit Select
Case &H117
s = "PropertyTagStripBytesCount "
Exit Select
Case &H118
s = "PropertyTagMinSampleValue "
Exit Select
Case &H119
s = "PropertyTagMaxSampleValue "
Exit Select
Case &H11A
s = "PropertyTagXResolution "
Exit Select
Case &H11B
s = "PropertyTagYResolution "
Exit Select
Case &H11C
s = "PropertyTagPlanarConfig "
Exit Select
Case &H11D
s = "PropertyTagPageName "
Exit Select
Case &H11E
s = "PropertyTagXPosition "
Exit Select
Case &H11F
s = "PropertyTagYPosition "
Exit Select
Case &H120
s = "PropertyTagFreeOffset "
Exit Select
Case &H121
s = "PropertyTagFreeByteCounts "
Exit Select
Case &H122
s = "PropertyTagGrayResponseUnit "
Exit Select
Case &H123
s = "PropertyTagGrayResponseCurve "
Exit Select
Case &H124
s = "PropertyTagT4Option "
Exit Select
Case &H125
s = "PropertyTagT6Option "
Exit Select
Case &H128
s = "PropertyTagResolutionUnit "
Exit Select
Case &H129
s = "PropertyTagPageNumber "
Exit Select
Case &H12D
s = "PropertyTagTransferFunction "
Exit Select
Case &H131
s = "PropertyTagSoftwareUsed "
Exit Select
Case &H132
s = "PropertyTagDateTime "
Exit Select
Case &H13B
s = "PropertyTagArtist "
Exit Select
Case &H13C
s = "PropertyTagHostComputer "
Exit Select
Case &H13D
s = "PropertyTagPredictor "
Exit Select
Case &H13E
s = "PropertyTagWhitePoint "
Exit Select
Case &H13F
s = "PropertyTagPrimaryChromaticities "
Exit Select
Case &H140
s = "PropertyTagColorMap "
Exit Select
Case &H141
s = "PropertyTagHalftoneHints "
Exit Select
Case &H142
s = "PropertyTagTileWidth "
Exit Select
Case &H143
s = "PropertyTagTileLength "
Exit Select
Case &H144
s = "PropertyTagTileOffset "
Exit Select
Case &H145
s = "PropertyTagTileByteCounts "
Exit Select
Case &H14C
s = "PropertyTagInkSet "
Exit Select
Case &H14D
s = "PropertyTagInkNames "
Exit Select
Case &H14E
s = "PropertyTagNumberOfInks "
Exit Select
Case &H150
s = "PropertyTagDotRange "
Exit Select
Case &H151
s = "PropertyTagTargetPrinter "
Exit Select
Case &H152
s = "PropertyTagExtraSamples "
Exit Select
Case &H153
s = "PropertyTagSampleFormat "
Exit Select
Case &H154
s = "PropertyTagSMinSampleValue "
Exit Select
Case &H155
s = "PropertyTagSMaxSampleValue "
Exit Select
Case &H156
s = "PropertyTagTransferRange "
Exit Select
Case &H200
s = "PropertyTagJPEGProc "
Exit Select
Case &H201
s = "PropertyTagJPEGInterFormat "
Exit Select
Case &H202
s = "PropertyTagJPEGInterLength "
Exit Select
Case &H203
s = "PropertyTagJPEGRestartInterval "
Exit Select
Case &H205
s = "PropertyTagJPEGLosslessPredictors "
Exit Select
Case &H206
s = "PropertyTagJPEGPointTransforms "
Exit Select
Case &H207
s = "PropertyTagJPEGQTables "
Exit Select
Case &H208
s = "PropertyTagJPEGDCTables "
Exit Select
Case &H209
s = "PropertyTagJPEGACTables "
Exit Select
Case &H211
s = "PropertyTagYCbCrCoefficients "
Exit Select
Case &H212
s = "PropertyTagYCbCrSubsampling "
Exit Select
Case &H213
s = "PropertyTagYCbCrPositioning "
Exit Select
Case &H214
s = "PropertyTagREFBlackWhite "
Exit Select
Case &H301
s = "PropertyTagGamma "
Exit Select
Case &H302
s = "PropertyTagICCProfileDescriptor "
Exit Select
Case &H303
s = "PropertyTagSRGBRenderingIntent "
Exit Select
Case &H320
s = "PropertyTagImageTitle "
Exit Select
Case &H5001
s = "PropertyTagResolutionXUnit "
Exit Select
Case &H5002
s = "PropertyTagResolutionYUnit "
Exit Select
Case &H5003
s = "PropertyTagResolutionXLengthUnit "
Exit Select
Case &H5004
s = "PropertyTagResolutionYLengthUnit "
Exit Select
Case &H5005
s = "PropertyTagPrintFlags "
Exit Select
Case &H5006
s = "PropertyTagPrintFlagsVersion "
Exit Select
Case &H5007
s = "PropertyTagPrintFlagsCrop "
Exit Select
Case &H5008
s = "PropertyTagPrintFlagsBleedWidth "
Exit Select
Case &H5009
s = "PropertyTagPrintFlagsBleedWidthScale "
Exit Select
Case &H500A
s = "PropertyTagHalftoneLPI "
Exit Select
Case &H500B
s = "PropertyTagHalftoneLPIUnit "
Exit Select
Case &H500C
s = "PropertyTagHalftoneDegree "
Exit Select
Case &H500D
s = "PropertyTagHalftoneShape "
Exit Select
Case &H500E
s = "PropertyTagHalftoneMisc "
Exit Select
Case &H500F
s = "PropertyTagHalftoneScreen "
Exit Select
Case &H5010
s = "PropertyTagJPEGQuality "
Exit Select
Case &H5011
s = "PropertyTagGridSize "
Exit Select
Case &H5012
s = "PropertyTagThumbnailFormat "
Exit Select
Case &H5013
s = "PropertyTagThumbnailWidth "
Exit Select
Case &H5014
s = "PropertyTagThumbnailHeight "
Exit Select
Case &H5015
s = "PropertyTagThumbnailColorDepth "
Exit Select
Case &H5016
s = "PropertyTagThumbnailPlanes "
Exit Select
Case &H5017
s = "PropertyTagThumbnailRawBytes "
Exit Select
Case &H5018
s = "PropertyTagThumbnailSize "
Exit Select
Case &H5019
s = "PropertyTagThumbnailCompressedSize "
Exit Select
Case &H501A
s = "PropertyTagColorTransferFunction "
Exit Select
Case &H501B
s = "PropertyTagThumbnailData "
Exit Select
Case &H5020
s = "PropertyTagThumbnailImageWidth "
Exit Select
Case &H5021
s = "PropertyTagThumbnailImageHeight "
Exit Select
Case &H5022
s = "PropertyTagThumbnailBitsPerSample "
Exit Select
Case &H5023
s = "PropertyTagThumbnailCompression "
Exit Select
Case &H5024
s = "PropertyTagThumbnailPhotometricInterp "
Exit Select
Case &H5025
s = "PropertyTagThumbnailImageDescription "
Exit Select
Case &H5026
s = "PropertyTagThumbnailEquipMake "
Exit Select
Case &H5027
s = "PropertyTagThumbnailEquipModel "
Exit Select
Case &H5028
s = "PropertyTagThumbnailStripOffsets "
Exit Select
Case &H5029
s = "PropertyTagThumbnailOrientation "
Exit Select
Case &H502A
s = "PropertyTagThumbnailSamplesPerPixel "
Exit Select
Case &H502B
s = "PropertyTagThumbnailRowsPerStrip "
Exit Select
Case &H502C
s = "PropertyTagThumbnailStripBytesCount "
Exit Select
Case &H502D
s = "PropertyTagThumbnailResolutionX "
Exit Select
Case &H502E
s = "PropertyTagThumbnailResolutionY "
Exit Select
Case &H502F
s = "PropertyTagThumbnailPlanarConfig "
Exit Select
Case &H5030
s = "PropertyTagThumbnailResolutionUnit "
Exit Select
Case &H5031
s = "PropertyTagThumbnailTransferFunction "
Exit Select
Case &H5032
s = "PropertyTagThumbnailSoftwareUsed "
Exit Select
Case &H5033
s = "PropertyTagThumbnailDateTime "
Exit Select
Case &H5034
s = "PropertyTagThumbnailArtist "
Exit Select
Case &H5035
s = "PropertyTagThumbnailWhitePoint "
Exit Select
Case &H5036
s = "PropertyTagThumbnailPrimaryChromaticities "
Exit Select
Case &H5037
s = "PropertyTagThumbnailYCbCrCoefficients "
Exit Select
Case &H5038
s = "PropertyTagThumbnailYCbCrSubsampling "
Exit Select
Case &H5039
s = "PropertyTagThumbnailYCbCrPositioning "
Exit Select
Case &H503A
s = "PropertyTagThumbnailRefBlackWhite "
Exit Select
Case &H503B
s = "PropertyTagThumbnailCopyRight "
Exit Select
Case &H5090
s = "PropertyTagLuminanceTable "
Exit Select
Case &H5091
s = "PropertyTagChrominanceTable "
Exit Select
Case &H5100
s = "PropertyTagFrameDelay "
Exit Select
Case &H5101
s = "PropertyTagLoopCount "
Exit Select
Case &H5102
s = "PropertyTagGlobalPalette "
Exit Select
Case &H5103
s = "PropertyTagIndexBackground "
Exit Select
Case &H5104
s = "PropertyTagIndexTransparent "
Exit Select
Case &H5110
s = "PropertyTagPixelUnit "
Exit Select
Case &H5111
s = "PropertyTagPixelPerUnitX "
Exit Select
Case &H5112
s = "PropertyTagPixelPerUnitY "
Exit Select
Case &H5113
s = "PropertyTagPaletteHistogram "
Exit Select
Case &H8298
s = "PropertyTagCopyright "
Exit Select
Case &H829A
s = "PropertyTagExifExposureTime "
Exit Select
Case &H829D
s = "PropertyTagExifFNumber "
Exit Select
Case &H8769
s = "PropertyTagExifIFD "
Exit Select
Case &H8773
s = "PropertyTagICCProfile "
Exit Select
Case &H8822
s = "PropertyTagExifExposureProg "
Exit Select
Case &H8824
s = "PropertyTagExifSpectralSense "
Exit Select
Case &H8825
s = "PropertyTagGpsIFD "
Exit Select
Case &H8827
s = "PropertyTagExifISOSpeed "
Exit Select
Case &H8828
s = "PropertyTagExifOECF "
Exit Select
Case &H9000
s = "PropertyTagExifVer "
Exit Select
Case &H9003
s = "PropertyTagExifDTOrig "
Exit Select
Case &H9004
s = "PropertyTagExifDTDigitized "
Exit Select
Case &H9101
s = "PropertyTagExifCompConfig "
Exit Select
Case &H9102
s = "PropertyTagExifCompBPP "
Exit Select
Case &H9201
s = "PropertyTagExifShutterSpeed "
Exit Select
Case &H9202
s = "PropertyTagExifAperture "
Exit Select
Case &H9203
s = "PropertyTagExifBrightness "
Exit Select
Case &H9204
s = "PropertyTagExifExposureBias "
Exit Select
Case &H9205
s = "PropertyTagExifMaxAperture "
Exit Select
Case &H9206
s = "PropertyTagExifSubjectDist "
Exit Select
Case &H9207
s = "PropertyTagExifMeteringMode "
Exit Select
Case &H9208
s = "PropertyTagExifLightSource "
Exit Select
Case &H9209
s = "PropertyTagExifFlash "
Exit Select
Case &H920A
s = "PropertyTagExifFocalLength "
Exit Select
Case &H927C
s = "PropertyTagExifMakerNote "
Exit Select
Case &H9286
s = "PropertyTagExifUserComment "
Exit Select
Case &H9290
s = "PropertyTagExifDTSubsec "
Exit Select
Case &H9291
s = "PropertyTagExifDTOrigSS "
Exit Select
Case &H9292
s = "PropertyTagExifDTDigSS "
Exit Select
Case &HA000
s = "PropertyTagExifFPXVer "
Exit Select
Case &HA001
s = "PropertyTagExifColorSpace "
Exit Select
Case &HA002
s = "PropertyTagExifPixXDim "
Exit Select
Case &HA003
s = "PropertyTagExifPixYDim "
Exit Select
Case &HA004
s = "PropertyTagExifRelatedWav "
Exit Select
Case &HA005
s = "PropertyTagExifInterop "
Exit Select
Case &HA20B
s = "PropertyTagExifFlashEnergy "
Exit Select
Case &HA20C
s = "PropertyTagExifSpatialFR "
Exit Select
Case &HA20E
s = "PropertyTagExifFocalXRes "
Exit Select
Case &HA20F
s = "PropertyTagExifFocalYRes "
Exit Select
Case &HA210
s = "PropertyTagExifFocalResUnit "
Exit Select
Case &HA214
s = "PropertyTagExifSubjectLoc "
Exit Select
Case &HA215
s = "PropertyTagExifExposureIndex "
Exit Select
Case &HA217
s = "PropertyTagExifSensingMethod "
Exit Select
Case &HA300
s = "PropertyTagExifFileSource "
Exit Select
Case &HA301
s = "PropertyTagExifSceneType "
Exit Select
Case &HA302
s = "PropertyTagExifCfaPattern "
Exit Select
End Select
Case 1
t = "PropertyTagTypeByte"
Exit Select
Case 2
t = "PropertyTagTypeASCII"
Exit Select
Case 3
t = "PropertyTagTypeShort"
Exit Select
Case 4
t = "PropertyTagTypeLong"
Exit Select
Case 5
t = "PropertyTagTypeRational"
Exit Select
Case 7
t = "PropertyTagTypeUndefined"
Exit Select
Case 9
t = "PropertyTagTypeSLONG"
Exit Select
Case 10
t = "PropertyTagTypeSRational"
Exit Select
End Select
Me.textBox1.Text = sb.ToString()
End If
textBox1.Visible = True
Label1.Visible = True
button1.Visible = False
End Sub
End Sub
End Class
IMAGECONVERT.VB
Imports System
Imports System.Drawing
Imports System.Drawing.imaging
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
Imports System.IO
Imports System.Threading
Public Class imageconvert
Inherits System.Windows.Forms.Form
#Region "Delegates"
Private Delegate Sub ImageInfoDelegate(ByVal thumbnail As Thumbnail,
ByVal targetFile As String, ByVal toSize As System.Drawing.Size)
#End Region
#Region "Fields"
Private _convertThread As Thread = Nothing
Private _imageInfoDelegate As ImageInfoDelegate = Nothing
Private _margin As Integer = 5
Private _converting As Boolean = False
#End Region
#Region "Generated Methods"
Public Sub New()
Me.InitializeComponent()
_imageInfoDelegate = New ImageInfoDelegate(AddressOf
DisplayImageInfo)
For Each imageFormat As TargetImageFormat In
[Enum].GetValues(GetType(TargetImageFormat))
Me.comboBoxTargetFormat.Items.Add(imageFormat)
Next
Me.comboBoxTargetFormat.SelectedItem = TargetImageFormat.JPEG
Me.openFileDialog.Filter = "Bitmap Files (*.bmp)|*.bmp|JPEG
(*.jpg,*jpeg,*.jpe,*.jfif)|*.jpg;*.jpeg;*.jpe;*.jfif|GIF (*.gif)|*.gif|Icon
(*.ico)|*.ico|Enhanced Meta File (*.emf)|*.emf|TIFF (*.tif,*.tiff)|
*.tif;*.tiff|PNG (*.png)|*.png|All Image Files|
*.bmp;*.jpg;*.jpeg;*.jpe;*.jfif;*.gif;*.tif;*.tiff;*.png;*.ico"
Me.openFileDialog.FilterIndex = 8
Me.EnableControls()
End Sub
End Sub
#End Region
<STAThread()> _
Private Shared Sub Main()
Application.Run(New imageconvert())
End Sub
#End Region
#Region "Methods"
If True Then
Return ".gif"
End If
Case TargetImageFormat.TIFF
If True Then
Return ".tif"
End If
Case TargetImageFormat.PNG
If True Then
Return ".png"
End If
Case TargetImageFormat.Icon
If True Then
Return ".ico"
End If
Case TargetImageFormat.EnhancedMetaFile
If True Then
Return ".emf"
End If
End Select
Return ".jpg"
End Function
Private Function GetImageFormat() As System.Drawing.Imaging.ImageFormat
Select Case DirectCast(Me.comboBoxTargetFormat.SelectedItem,
TargetImageFormat)
Case TargetImageFormat.Bitmap
If True Then
Return System.Drawing.Imaging.ImageFormat.Bmp
End If
Case TargetImageFormat.JPEG
If True Then
Return System.Drawing.Imaging.ImageFormat.Jpeg
End If
Case TargetImageFormat.GIF
If True Then
Return System.Drawing.Imaging.ImageFormat.Gif
End If
Case TargetImageFormat.TIFF
If True Then
Return System.Drawing.Imaging.ImageFormat.Tiff
End If
Case TargetImageFormat.PNG
If True Then
Return System.Drawing.Imaging.ImageFormat.Png
End If
Case TargetImageFormat.Icon
If True Then
Return System.Drawing.Imaging.ImageFormat.Icon
End If
Case TargetImageFormat.EnhancedMetaFile
If True Then
Return System.Drawing.Imaging.ImageFormat.Emf
End If
End Select
Return System.Drawing.Imaging.ImageFormat.Jpeg
End Function
Private Function DetermineTargetSize(ByVal image As
System.Drawing.Image) As System.Drawing.Size
Dim width As Integer = image.Width
Dim height As Integer = image.Height
If Me.radioButtonSpecified.Checked Then
If image.Width > image.Height Then
width = CInt(Me.numericUpDownSpecifiedWidth.Value)
height = CInt(Me.numericUpDownSpecifiedHeight.Value)
Else
width = CInt(Me.numericUpDownSpecifiedHeight.Value)
height = CInt(Me.numericUpDownSpecifiedWidth.Value)
End If
End If
If Me.radioButtonPercentage.Checked Then
width = CInt((image.Width * Me.numericUpDownPercentage.Value /
100))
height = CInt((image.Height * Me.numericUpDownPercentage.Value /
100))
End If
If Me.radioButtonMaximum.Checked Then
If image.Width > Me.numericUpDownMaximum.Value OrElse
image.Height > Me.numericUpDownMaximum.Value Then
If image.Width > image.Height Then
width = CInt(Me.numericUpDownMaximum.Value)
height = CInt((image.Height *
Me.numericUpDownMaximum.Value / image.Width))
Else
width = CInt((image.Width *
Me.numericUpDownMaximum.Value / image.Height))
height = CInt(Me.numericUpDownMaximum.Value)
End If
End If
End If
Return New Size(width, height)
End Function
Private Sub DisplayImageInfo(ByVal thumbnail As Thumbnail, ByVal
targetFile As String, ByVal toSize As System.Drawing.Size)
Me.statusBarPanelFile.Text = targetFile
Me.statusBarPanelOriginalSize.Text = String.Format("original size:
{0} x {1}", thumbnail.Image.Size.Width, thumbnail.Image.Size.Height)
Me.statusBarPanelNewSize.Text = String.Format("converted to: {0} x
{1}", toSize.Width, toSize.Height)
thumbnail.Handled = True
End Sub
Private Sub DisplayThumbnails()
While Me.panelThumbnails.Controls.Count > 0
Dim thumbnail As Thumbnail =
TryCast(Me.panelThumbnails.Controls(0), Thumbnail)
thumbnail.Dispose()
Me.panelThumbnails.Controls.Remove(thumbnail)
End While
Dim numberHorizontal As Integer = -1
For Each file As String In Me.openFileDialog.FileNames
Dim thumbnail As Thumbnail = Nothing
Try
thumbnail = New Thumbnail(file)
Catch generatedExceptionName As System.OutOfMemoryException
thumbnail = Nothing
Continue For
End Try
If numberHorizontal < 0 Then
numberHorizontal = CInt((Me.panelThumbnails.Width /
thumbnail.Width))
End If
thumbnail.Left = _margin + (thumbnail.Width + _margin) *
(Me.panelThumbnails.Controls.Count Mod numberHorizontal)
thumbnail.Top = _margin + (thumbnail.Height + _margin) *
(Me.panelThumbnails.Controls.Count / numberHorizontal)
Me.panelThumbnails.Controls.Add(thumbnail)
Next
End Sub
>
Private Sub ConvertImageFiles()
_converting = True
Me.EnableControls()
Try
Dim seq As Integer = 1
For Each thumbnail As Thumbnail In Me.panelThumbnails.Controls
thumbnail.Handled = False
Next
Dim extension As String = GetExtension()
Dim targetImageFormat As System.Drawing.Imaging.ImageFormat =
GetImageFormat()
If Me.radioButtonUsePrefix.Checked Then
targetFileName = (Me.labelTargetPathValue.Text & "\") +
Me.textBoxPrefix.Text + seq.ToString("0000") + extension
While File.Exists(targetFileName)
seq += 1
targetFileName = (Me.labelTargetPathValue.Text &
"\") + Me.textBoxPrefix.Text + seq.ToString("0000") + extension
End While
Else
targetFileName = (Me.labelTargetPathValue.Text & "\") +
Path.GetFileNameWithoutExtension(fileName) + extension
End If
Try
Try
targetImage = New Bitmap(thumbnail.Image,
targetSize)
targetImage.Save(targetFileName, targetImageFormat)
Me.Invoke(_imageInfoDelegate, New Object()
{thumbnail, targetFileName, targetSize})
targetImage.Dispose()
Catch e As System.Threading.ThreadAbortException
Throw e
Catch
End Try
Catch e As System.Threading.ThreadAbortException
Throw e
Catch
End Try
Next
Catch
Finally
Me.Cursor = Cursors.[Default]
_converting = False
Me.EnableControls()
End Try
End Sub
#End Region
#Region "Event Handlers"
picResult.Image = bm
picResult.Refresh()
m_Alpha += m_DAlpha
If m_Alpha > 1 Then
m_Alpha = 1
m_DAlpha *= -1
ElseIf m_Alpha < 0 Then
m_Alpha = 0
m_DAlpha *= -1
End If
End Sub
#End Region
End Class
#Region "Enums"
Public Enum TargetImageFormat
Bitmap
JPEG
GIF
TIFF
PNG
Icon
EnhancedMetaFile
End Enum
#End Region
IMAGEFORMAT.VB
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
End Class
ALAA_IMAGE.VB
kl = Len(tx)
FileOpen(12, FI, OpenMode.Random)
FilePut(12, kl, 2772)
FileClose(12)
Dim b1 As Byte
Dim b2 As Byte
Dim b3 As Byte
Dim b4 As Byte
Dim b5 As Byte
Dim b6 As Byte
Dim b7 As Byte
Dim b8 As Byte
Dim hel As Byte
i = 1
j = 1500
i1 = 1
FileOpen(1, FI, OpenMode.Random)
Do While (Not EOF(1)) ' And
If (i1 > Len(tx)) Then
FileClose(1)
Exit Sub
End If
j = j + 10
temp = Mid(t, i1, l) ' t is the reversed text
i1 = i1 + 1
'''Call chang_temp(temp)
hel = Asc(temp) 'to make char -> byte
FileGet(1, b1, j + 1)
FileGet(1, b2, j + 2)
FileGet(1, b3, j + 3)
FileGet(1, b4, j + 4)
FileGet(1, b5, j + 5)
FileGet(1, b6, j + 6)
FileGet(1, b7, j + 7)
FileGet(1, b8, j + 8)
Call by8set(hel, b1, b2, b3, b4, b5, b6, b7, b8)
FilePut(1, b1, j + 1)
FilePut(1, b2, j + 2)
FilePut(1, b3, j + 3)
FilePut(1, b4, j + 4)
FilePut(1, b5, j + 5)
FilePut(1, b6, j + 6)
FilePut(1, b7, j + 7)
FilePut(1, b8, j + 8)
Loop
FileClose(1)
MsgBox("file was to small the letters count entered was only" &
Str(i1))
End Sub
End Sub
Public Sub dec_frm_img(ByRef fpath As String, ByRef txt As String)
End Sub
'this will spread your byte on 8 bytes
Public Sub by8set(ByRef mainb As Byte, ByRef b1 As Byte, ByRef b2 As
Byte, ByRef b3 As Byte, ByRef b4 As Byte, ByRef b5 As Byte, ByRef b6 As
Byte, ByRef b7 As Byte, ByRef b8 As Byte)
Dim u As Object
'bits_to_byte(ByRef b As Byte, ByRef bits As bits_array)
'byte_to_bits(ByVal b As Byte, ByRef bits As bits_array)
Dim p10 As New alaa_image.bits_array
Dim p20 As New alaa_image.bits_array
' p10 = New bits_array
p10.Initialize()
p20.Initialize()
For u = 0 To 7
p10.bits(u) = False
'
p20.bits(u) = False
Next u
Call byte_to_bits(mainb, p10)
'no one should touch p10
Call byte_to_bits(b1, p20)
p20.bits(0) = p10.bits(0)
Call bits_to_byte(b1, p20)
'now we stored 1 bit of our byte
Call byte_to_bits(b2, p20) ''is it nessessry to reinitialize p20
here?
p20.bits(0) = p10.bits(1)
Call bits_to_byte(b2, p20)
'now we stored 1 bit of our byte
Call byte_to_bits(b3, p20) ''is it nessessry to reinitialize p20
here?
p20.bits(0) = p10.bits(2)
Call bits_to_byte(b3, p20)
'now we stored 1 bit of our byte
Call byte_to_bits(b4, p20) ''is it nessessry to reinitialize p20
here?
p20.bits(0) = p10.bits(3)
Call bits_to_byte(b4, p20)
'now we stored 1 bit of our byte
Call byte_to_bits(b5, p20) ''is it nessessry to reinitialize p20
here?
p20.bits(0) = p10.bits(4)
Call bits_to_byte(b5, p20)
'now we stored 1 bit of our byte
Call byte_to_bits(b6, p20) ''is it nessessry to reinitialize p20
here?
p20.bits(0) = p10.bits(5)
Call bits_to_byte(b6, p20)
'now we stored 1 bit of our byte
Call byte_to_bits(b7, p20) ''is it nessessry to reinitialize p20
here?
p20.bits(0) = p10.bits(6)
Call bits_to_byte(b7, p20)
'now we stored 1 bit of our byte
Call byte_to_bits(b8, p20) ''is it nessessry to reinitialize p20
here?
p20.bits(0) = p10.bits(7)
Call bits_to_byte(b8, p20)
'now we stored 1 bit of our byte
End Sub
'this will collect your byte on 8 bytes
Public Sub by8get(ByRef mainb As Byte, ByRef b1 As Byte, ByRef b2 As
Byte, ByRef b3 As Byte, ByRef b4 As Byte, ByRef b5 As Byte, ByRef b6 As
Byte, ByRef b7 As Byte, ByRef b8 As Byte)
Dim u As Object
'Dim p10, p20 As bits_array
'bits_to_byte(ByRef b As Byte, ByRef bits As bits_array)
'byte_to_bits(ByVal b As Byte, ByRef bits As bits_array)
''''Call byte_to_bits(mainb, p10)
'no one should touch p10
Dim p10 As New alaa_image.bits_array
Dim p20 As New alaa_image.bits_array
p10.Initialize()
p20.Initialize()
For u = 0 To 7
'
p10.bits(u) = False
'
p20.bits(u) = False
Next u
Dim b1 As Byte
Dim b2 As Byte
Dim b3 As Byte
Dim b4 As Byte
Dim b5 As Byte
Dim b6 As Byte
Dim b7 As Byte
Dim b8 As Byte
Dim hel As Byte
i = 1
j = 1500
i1 = 1
FileOpen(1, FI, OpenMode.Random)
Do While (Not EOF(1)) ' And
j = j + 10
i1 = i1 + 1
FileGet(1, b1, j + 1)
FileGet(1, b2, j + 2)
FileGet(1, b3, j + 3)
FileGet(1, b4, j + 4)
FileGet(1, b5, j + 5)
FileGet(1, b6, j + 6)
FileGet(1, b7, j + 7)
FileGet(1, b8, j + 8)
Call by8get(hel, b1, b2, b3, b4, b5, b6, b7, b8)
tx = tx & Chr(hel)
Loop
tx = StrReverse(tx)
MsgBox("exited because error end of file //text was so big for this
file")
FileClose(1)
End Sub
Imports System.Drawing.Imaging
Dim j As Integer
Dim encoders As ImageCodecInfo()
encoders = ImageCodecInfo.GetImageEncoders()
For j = 0 To encoders.Length
If encoders(j).MimeType = mimeType Then
Return encoders(j)
End If
Next j
Return Nothing
End Function
Private Sub SaveJPGWithCompressionSetting(ByVal image As Image, ByVal
szFileName As String, ByVal lCompression As Long)
On Error GoTo chkErr
Dim eps As EncoderParameters = New EncoderParameters(1)
eps.Param(0) = New EncoderParameter(Encoder.Quality, lCompression)
Dim ici As ImageCodecInfo = GetEncoderInfo("image/jpeg")
image.Save(szFileName, ici, eps)
Exit Sub
chkErr: MsgBox("Error: " & Err.Number & " " & Err.Description & vbCrLf &
"Choose a different name for file.")
errOcr = True
Resume Next
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim FileSize As Long
Dim suffit As String
Dim i As Integer
For i = 100 To 5 Step -5
cbCI.Items.Add(i)
Next i
SaveJPGWithCompressionSetting(pbPic.Image, Application.StartupPath &
"\temp100.jpg", 100)
SaveJPGWithCompressionSetting(pbPic.Image, Application.StartupPath &
"\temp.jpg", 100)
cbCI.Text = "100"
FileSize = FileLen(Application.StartupPath & "\temp.jpg")
If FileSize < 1000 Then
suffit = " Bytes"
GoTo showit
End If
If FileSize > 1000000 Then
FileSize = Int(FileSize / 1000000)
suffit = " Mb"
GoTo showit
Else
FileSize = Int(FileSize / 1000)
suffit = " Kb"
End If
showit: lbl100.Text = FileSize & suffit
End Sub
End Sub
Module JpegCompression
' Get an encoder parameter array and set the compression level.
Dim encoder_params As EncoderParameters = New EncoderParameters(1)
encoder_params.Param(0) = New EncoderParameter(Encoder.Quality,
compression_level)
Return memory_stream
End Function
End Module
COMPRESSIONPAGE.VB
Imports System.Drawing.Imaging
End Sub
Private m_Alpha As Single = 0 ' Alpha on a 0-1 scale.
Private m_DAlpha As Single = 0.05
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
Inherits System.Windows.Forms.Form
Dim lp As Integer
Dim w1, w2 As String
Dim pp As Integer
Dim IP As String
picResult.Image = bm
picResult.Refresh()
m_Alpha += m_DAlpha
If m_Alpha > 1 Then
m_Alpha = 1
m_DAlpha *= -1
ElseIf m_Alpha < 0 Then
m_Alpha = 0
m_DAlpha *= -1
End If
End Sub
loc_str = key_str
For loc_int = 0 To 7
res_str = res_str & Mid(loc_str, kypermut(loc_int), 1)
Next
key_perm = res_str
End Function
loc_str = p10_str
For loc_int = 0 To 9
s = s & Mid(loc_str, keypermut(loc_int), 1)
Next
P10permut = s
End Function
left_str1 = ls_str1
left_str2 = ls_str2
llft1 = Mid(left_str1, 1, 1)
tmpo1 = Mid(left_str1, 2, 5)
left_str1 = tmpo1 & llft1
llft2 = Mid(left_str2, 1, 1)
tmpo2 = Mid(left_str2, 2, 5)
left_str2 = tmpo2 & llft2
cpyls1 = left_str1
frm3.TextBox2.Text = cpyls1
cpyls2 = left_str2
frm3.TextBox3.Text = cpyls2
p8inpt1 = left_str1 & left_str2
lshift = p8inpt1
End Function
integr = Val(key)
Do
TempValue = integr Mod 2
BinValue = CStr(TempValue) + BinValue
integr = integr \ 2
Dim t, i As Integer
t = 10 - Len(BinValue)
For i = 1 To t
temp = (temp) + "0"
Next
ElseIf Len(BinValue) > 10 Then
MsgBox("S-DES accepts only 10 bit key")
BinValue = ""
temp = ""
Exit Function
End If
'P10input = leftshift
p10output = P10permut(p10input)
frm3.TextBox1.Text = p10output
)
lftsift = p10output
'************divide into 5 bits each**************
ls_s1 = Mid(lftsift, 1, 5)
ls_s2 = Mid(lftsift, 6, 10)
edkey1 = key_perm(p8in1)
frm3.TextBox4.Text = edkey1
'MsgBox("key1=" & edkey1)
TextBox5.Text = edkey1
ls0_s1 = Mid(p8in2, 1, 5)
frm3.TextBox5.Text = ls0_s1
ls0_s2 = Mid(p8in2, 6, 10)
frm3.TextBox6.Text = ls0_s2
edkey2 = key_perm(p8in2)
TextBox6.Text = edkey2
frm3.TextBox7.Text = edkey2
'MsgBox("key2=" & edkey2)
'*****clear values
BinValue = ""
leftshift = ""
temp = ""
cpyls2 = ""
cpyls1 = ""
End Function
key1 = ky1
key2 = ky2
Dim t, i As Integer
t = 8 - Len(BinValue)
For i = 1 To t
temp = (temp) + "0"
Next
ElseIf Len(BinValue) > 8 Then
MsgBox("S-DES accepts only 8 bit PlainText")
BinValue = ""
temp = ""
Exit Function
'msgbox(BinValue)
BinValue = ""
temp = ""
End If
plntxt = (temp + BinValue)
'msgbox(plntxt)
IP = InitPerm(plntxt)
'msgbox("Initial Permutation output=" & IP)
frm3.TextBox8.Text = IP
split1 = Mid(IP, 1, 4)
split2 = Mid(IP, 5, 8)
cpsplit1 = split1
cpsplit2 = split2
expout = ExpPrm(split2)
frm3.TextBox9.Text = expout
'********Xor************
sp1 = Mid(xrout, 1, 4)
sp2 = Mid(xrout, 5, 8)
pbox4out = P4permut(sbxout)
frm3.TextBox13.Text = pbox4out
'**********switching********
swtch_out = SW_switch(xr4out, cpsplit2)
frm3.TextBox15.Text = swtch_out
fk2input1 = cpsplit2
fk2input2 = xr4out
rnd2xpout = ExpPrm(fk2input2)
frm3.TextBox16.Text = rnd2xpout
expky2 = xor8bit(rnd2xpout, key2)
frm3.TextBox17.Text = expky2
rnd2sp1 = Mid(expky2, 1, 4)
rnd2sp2 = Mid(expky2, 5, 8)
bincipher = rnd2inv_pout
Enc_Decrypt = Chr(BinToInt(rnd2inv_pout))
End Function
End Sub
TextBox7.Text = ""
TextBox8.Text = ""
For i = 1 To Len(TextBox2.Text)
sdr = Mid(TextBox2.Text, i, 1)
fin = fin & Enc_Decrypt(sdr, edkey1, edkey2)
Dim pp As Integer
Dim Initial_Permutation As String
Dim plxt As String
plxt = pltxt
For pp = 0 To 7
Initial_Permutation = Initial_Permutation & Mid(plxt,
iniperm(pp), 1)
Next
InitPerm = Initial_Permutation
End Function
For i = 0 To 7
invout = invout & Mid(tmp_ivp, invperm(i), 1)
Next
InvPrm = invout
End Function
For i = 0 To 7
local1 = local1 & Mid(splistr_2, experm(i), 1)
Next
ExpPrm = local1
End Function
lostr = str_4bit
p4perm(0) = 2 : p4perm(1) = 4 : p4perm(2) = 3 : p4perm(3) = 1
For ex = 0 To 3
p4 = p4 & Mid(lostr, p4perm(ex), 1)
Next
P4permut = p4
End Function
left4bit = sbox_str1
right4bit = sbox_str2
Dim i, ia As Integer
Dim s, s1, s2, s3 As String
Dim z1, z2 As Integer
For i = 1 To 4
s = s & Mid(left4bit, i, 1)
i += 2
Next
For i = 2 To 3
s1 = s1 & Mid(left4bit, i, 1)
Next
For i = 1 To 4
s2 = s2 & Mid(right4bit, i, 1)
i += 2
Next
For i = 2 To 3
s3 = s3 & Mid(right4bit, i, 1)
Next
Sbox = sout
End Function
End Sub
For x = 1 To Length
TempValu = TempValu + Val(Mid(BinaryNumber, Length - x + 1, 1))
* 2 ^ (x - 1)
Next
BinToInt = TempValu
End Function
IntNum = IntegerNumber
Dim TempVa As Integer
Dim binval As String
Do
IntNum = IntNum \ 2
Loop Until IntNum = 0
IntToBin = binval
End Function
locstr1 = str_expout
locstr2 = str_key
For re = 1 To 8
inre = inre & (Mid(locstr1, re, 1) Xor Mid(locstr2, re, 1))
Next
xor8bit = inre
End Function
lftstr = lft_ipstr
pbx4out = p4_boxout
For i4 = 1 To 4
loclout = loclout & (Mid(lftstr, i4, 1) Xor Mid(pbx4out, i4, 1))
Next
xor4bit = loclout
End Function
End Function
TextBox4.Text = ""
For i = 1 To Len(TextBox3.Text)
sdr = Mid(TextBox3.Text, i, 1)
End Sub
Inherits System.Windows.Forms.Form
End Sub
Private Sub GroupBox3_Enter(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles GroupBox3.Enter
End Sub
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
End Sub
Private Sub Label14_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label14.Click
End Sub
Private Sub TextBox10_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox10.TextChanged
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox4.TextChanged
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label2.Click
End Sub
Private Sub Label12_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
End Sub
Private Sub TextBox15_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox15.TextChanged
End Sub
Private Sub TextBox14_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox14.TextChanged
End Sub
Private Sub TextBox11_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox11.TextChanged
End Sub
Private Sub Label13_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
End Sub
Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox6.TextChanged
End Sub
Private Sub Label15_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label15.Click
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox3.TextChanged
End Sub
Private Sub Label7_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label7.Click
End Sub
Private Sub GroupBox2_Enter(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles GroupBox2.Enter
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox2.TextChanged
End Sub
Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox5.TextChanged
End Sub
Private Sub TextBox13_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox13.TextChanged
End Sub
Private Sub Label10_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label10.Click
End Sub
Private Sub Label6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
End Sub
Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles GroupBox1.Enter
End Sub
Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox7.TextChanged
End Sub
Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label5.Click
End Sub
Private Sub Label11_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label11.Click
End Sub
Private Sub TextBox12_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs)
End Sub
Private Sub Label16_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label16.Click
End Sub
Private Sub Label8_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label8.Click
End Sub
Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox9.TextChanged
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label1.Click
End Sub
Private Sub Label9_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label9.Click
End Sub
Private Sub TextBox8_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox8.TextChanged
End Sub
End Sub
End Class
FILE DES .VB
Imports System.IO
Imports System.Security
Imports System.Security.Cryptography
Public Class fileDES
Inherits System.Windows.Forms.Form
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim file_path As String = Application.StartupPath
file_path = file_path.Substring(0, file_path.LastIndexOf("\"))
txtPlaintext.Text = file_path & "\text.dat"
txtPlaintextFile.Text = file_path & "\plaintext.txt"
txtCiphertextFile.Text = file_path & "\cyphertext.dat"
txtDecipheredFile.Text = file_path & "\decyphered.txt"
txtPlaintext.Text = GrabFile(txtPlaintextFile.Text)
End Sub
crypto_stream.Write(buffer, 0, bytes_read)
Loop
crypto_stream.Close()
in_stream.Close()
out_stream.Close()
End Sub
key = password_derive_bytes.GetBytes(key_size_bits \ 8)
iv = password_derive_bytes.GetBytes(block_size_bits \ 8)
End Sub
txtCiphertext.Text = GrabFile(txtCiphertextFile.Text)
End Sub
txtDeciphered.Text = GrabFile(txtDecipheredFile.Text)
End Sub
Inherits System.Windows.Forms.Form
#End Region
For i As Integer = 0 To 31
bytKey(i) = bytResult(i)
Next
#End Region
For i As Integer = 32 To 47
bytIV(i - 32) = bytResult(i)
Next
#End Region
csCryptoStream.Write(bytBuffer, 0, intBytesInCurrentBlock)
lngBytesProcessed = lngBytesProcessed +
CLng(intBytesInCurrentBlock)
pbStatus.Value = CInt((lngBytesProcessed /
lngFileLength) * 100)
End While
csCryptoStream.Close()
fsInput.Close()
fsOutput.Close()
.
If Direction = CryptoAction.ActionEncrypt Then
Dim fileOriginal As New FileInfo(strFileToEncrypt)
fileOriginal.Delete()
End If
pbStatus.Value = 0
txtFileToEncrypt.Text = "Click Browse to load file."
txtPassEncrypt.Text = ""
txtConPassEncrypt.Text = ""
txtDestinationEncrypt.Text = ""
btnChangeEncrypt.Enabled = False
btnEncrypt.Enabled = False
Else
MsgBox("Decryption Complete" + Wrap + Wrap + _
"Total bytes processed = " + _
lngBytesProcessed.ToString, _
MsgBoxStyle.Information, "Done")
pbStatus.Value = 0
txtFileToDecrypt.Text = "Click Browse to load file."
txtPassDecrypt.Text = ""
txtConPassDecrypt.Text = ""
txtDestinationDecrypt.Text = ""
btnChangeDecrypt.Enabled = False
btnDecrypt.Enabled = False
End If
Catch
fsInput.Close()
fsOutput.Close()
pbStatus.Value = 0
txtPassEncrypt.Text = ""
txtConPassEncrypt.Text = ""
End If
End Try
End Sub
#End Region
End If
End Sub
Private m_Alpha As Single = 0 Private m_DAlpha As Single = 0.05
picResult.Image = bm
picResult.Refresh()
m_Alpha += m_DAlpha
If m_Alpha > 1 Then
m_Alpha = 1
m_DAlpha *= -1
ElseIf m_Alpha < 0 Then
m_Alpha = 0
m_DAlpha *= -1
End If
End Sub
strOutputDecrypt = strFileToDecrypt.Substring(0,
strFileToDecrypt.Length - 8)
Dim S As String = strFileToDecrypt.Substring(0, iPosition + 1)
strOutputDecrypt = strOutputDecrypt.Substring((iPosition + 1))
txtDestinationDecrypt.Text = S +
strOutputDecrypt.Replace("_"c,"."c)
btnDecrypt.Enabled = True
btnChangeDecrypt.Enabled = True
End If
End Sub
#End Region
End If
End Sub
#End Region
End Class
STRINGCOMCRY.VB
Public Class stringcomcry
If Me.chk_use_encryption.Checked Then
CompStr.Passphrase = Me.txt_Passphrase.Text
End If
If Me.chk_Use_Prefix_Suffix.Checked Then
CompStr.PrefixForCompressedString = Me.txt_Prefix.Text
CompStr.SuffixForCompressedString = Me.txt_Suffix.Text
End If
CompStr.UnCompressed = Me.txt_Uncompressed.Text
Me.txt_Compressed.Text = CompStr.Compressed
Me.txt_UnCompressed_Size.Text = CompStr.UnCompressed_Size.ToString
Me.txt_Compressed_Size.Text = CompStr.Compressed_Size.ToString
Me.txt_Compression_Ratio.Text = CompStr.Compression_Ratio.ToString
End Sub
If Me.chk_use_encryption.Checked Then
CompStr.Passphrase = Me.txt_Passphrase.Text
End If
If Me.chk_Use_Prefix_Suffix.Checked Then
CompStr.PrefixForCompressedString = Me.txt_Prefix.Text
CompStr.SuffixForCompressedString = Me.txt_Suffix.Text
End If
CompStr.Compressed = Me.txt_Compressed.Text
Me.txt_Uncompressed.Text = CompStr.UnCompressed
Me.txt_UnCompressed_Size.Text = CompStr.UnCompressed_Size.ToString
End Sub
Me.txt_Uncompressed.Text = String.Empty
Me.txt_UnCompressed_Size.Text = String.Empty
End Sub
Me.txt_Compressed.Text = String.Empty
Me.txt_Compressed_Size.Text = String.Empty
Me.txt_Compression_Ratio.Text = String.Empty
End Sub
If Me.chk_Use_Prefix_Suffix.Checked Then
Me.txt_Prefix.Enabled = True
Me.txt_Suffix.Enabled = True
Me.txt_Prefix.BackColor = Color.White
Me.txt_Suffix.BackColor = Color.White
Else
Me.txt_Prefix.Enabled = False
Me.txt_Suffix.Enabled = False
Me.txt_Prefix.BackColor = Color.LightGray
Me.txt_Suffix.BackColor = Color.LightGray
End If
End Sub
If Me.chk_use_encryption.Checked Then
Me.txt_Passphrase.Enabled = True
Me.txt_Passphrase.BackColor = Color.White
Else
Me.txt_Passphrase.Enabled = False
Me.txt_Passphrase.BackColor = Color.LightGray
End If
End Sub
' Decompress.
GUnzipFile(txtCompressedFile.Text, txtDecompressedFile.Text)
zip_stream.Close()
End Using ' zip_stream
from_stream.Close()
End Using ' from_stream
If files_different Then
MessageBox.Show("The files are different", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show("files are compressed", "Success",
MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
End Class
TEXTSTEGNO.VB
Imports System.Drawing
If (Clipboard.ContainsText(TextDataFormat.Html)) Then
returnHtmlText = Clipboard.GetText(TextDataFormat.Html)
Clipboard.SetText(replacementHtmlText, TextDataFormat.Html)
End If
Return returnHtmlText
End Function
Public Sub SetText(ByVal Text As String)
End Sub
If (Clipboard.ContainsData(format)) Then
returnObject = Clipboard.GetData(format)
Clipboard.SetData(format, data)
End If
Return returnObject
End Function
Public Sub encrypter1(ByRef loss_flag As Int16) ' 'radio 1 encryption
'if it returns 1 then there is error and should abort
loss_flag = 0
Dim text As String
text = TextBox1.Text.ToString + " "
Dim passw As String = ""
input("Enter Password To Protect Your Text", passw)
If passw = "" Then 'err handler for ugly passwords
MsgBox("Error ! You Didn,t Choose Any Password To Protect The
Message.")
loss_flag = 1
Exit Sub
ElseIf passw.Length < 4 Then
MsgBox("Error ! Password Is Too Short.")
loss_flag = 1
Exit Sub
End If
Dim ba As bits_array
Dim sz As Long
Dim sz1, sz2, sz3, sz4 As Byte
Dim t As Double
sz = text.Length ' number of chars to encrypt
'''''''''''''''''''''''''
For m = 0 To 7 '''''''''''''''''' 1
i = i + 1
'''''''''''''''''''''''''
rt.Text = ""
' set the size according to my bit
If ba.bits(m) = True Then
rt.Font = New Font(TextBox2.Font.Name, (bigsize),
TextBox2.Font.Style, TextBox2.Font.Unit)
Else
rt.Font = New Font(TextBox2.Font.Name, Me.user_size,
TextBox2.Font.Style, TextBox2.Font.Unit)
End If
tre = tre + 1
rt.Text = tempt.Substring(tre, 1)
rt.SelectAll()
Clipboard.SetText(rt.SelectedRtf, TextDataFormat.Rtf)
RichTextBox1.Paste()
''''''''''''''''''''''''''
Next m
ba.Initialize()
byte_to_bits(sz2, ba)
For m = 0 To 7 '''''''''''''''''' 1
i = i + 1
'''''''''''''''''''''''''
rt.Text = ""
' set the size according to my bit
If ba.bits(m) = True Then
rt.Font = New Font(TextBox2.Font.Name, (bigsize),
TextBox2.Font.Style, TextBox2.Font.Unit)
Else
rt.Font = New Font(TextBox2.Font.Name, Me.user_size,
TextBox2.Font.Style, TextBox2.Font.Unit)
End If
tre = tre + 1
rt.Text = tempt.Substring(tre, 1)
rt.SelectAll()
Clipboard.SetText(rt.SelectedRtf, TextDataFormat.Rtf)
RichTextBox1.Paste()
''''''''''''''''''''''''''
Next m
ba.Initialize()
byte_to_bits(sz3, ba)
For m = 0 To 7 '''''''''''''''''' 1
i = i + 1
'''''''''''''''''''''''''
rt.Text = ""
' set the size according to my bit
If ba.bits(m) = True Then
rt.Font = New Font(TextBox2.Font.Name, (bigsize),
TextBox2.Font.Style, TextBox2.Font.Unit)
Else
rt.Font = New Font(TextBox2.Font.Name, Me.user_size,
TextBox2.Font.Style, TextBox2.Font.Unit)
End If
tre = tre + 1
rt.Text = tempt.Substring(tre, 1)
rt.SelectAll()
Clipboard.SetText(rt.SelectedRtf, TextDataFormat.Rtf)
RichTextBox1.Paste()
''''''''''''''''''''''''''
Next m
ba.Initialize()
byte_to_bits(sz4, ba)
For m = 0 To 7 '''''''''''''''''' 1
i = i + 1
'''''''''''''''''''''''''
rt.Text = ""
' set the size according to my bit
If ba.bits(m) = True Then
rt.Font = New Font(TextBox2.Font.Name, (bigsize),
TextBox2.Font.Style, TextBox2.Font.Unit)
Else
rt.Font = New Font(TextBox2.Font.Name, Me.user_size,
TextBox2.Font.Style, TextBox2.Font.Unit)
End If
tre = tre + 1
rt.Text = tempt.Substring(tre, 1)
rt.SelectAll()
Clipboard.SetText(rt.SelectedRtf, TextDataFormat.Rtf)
RichTextBox1.Paste()
''''''''''''''''''''''''''
Next m
'MsgBox(sz1.ToString)
' MsgBox(sz2.ToString)
' MsgBox(sz3.ToString)
' MsgBox(sz4.ToString)
'MsgBox(sz)
'''' we have just stored the size of the text
'now we will store real message's text itself
'''''''''''''''''''''''''
rt.Text = ""
' set the size according to my bit
If ba.bits(m) = True Then
rt.Font = New Font(TextBox2.Font.Name, (bigsize),
TextBox2.Font.Style, TextBox2.Font.Unit)
Else
rt.Font = New Font(TextBox2.Font.Name, Me.user_size,
TextBox2.Font.Style, TextBox2.Font.Unit)
End If
tre = tre + 1
rt.Text = tempt.Substring(tre, 1)
rt.SelectAll()
Clipboard.SetText(rt.SelectedRtf, TextDataFormat.Rtf)
RichTextBox1.Paste()
''''''''''''''''''''''''''
Next m
Next cnt
''now commplete the usless rest of text
Dim rest As Long
For rest = tre + 1 To tempt.Length - 1
rt.Clear()
rt.Font = New Font(TextBox2.Font.Name, (Me.user_size),
TextBox2.Font.Style, TextBox2.Font.Unit)
rt.Text = tempt.Substring(rest, 1)
rt.SelectAll()
Clipboard.SetText(rt.SelectedRtf, TextDataFormat.Rtf)
RichTextBox1.Paste()
Next
rt.Dispose()
End Sub
Public Sub encrypter2(ByRef loss_flag As Int16)
loss_flag = 0
Dim text As String
text = TextBox1.Text.ToString + " "
Dim passw As String = ""
input("Enter Password To Protect Your Text", passw)
If passw = "" Then 'err handler for ugly passwords
MsgBox("Error ! You Didn,t Choose Any Password To Protect The
Message.")
loss_flag = 1
Exit Sub
ElseIf passw.Length < 4 Then
MsgBox("Error ! Password Is Too Short.")
loss_flag = 1
Exit Sub
End If
'''''''''''''''''''''''''
'now we will convert sz1 to bits array and store it in the first
'after it we will do the sz2 and then sz3 and then sz4..
'the coming 4 for loops are used for that
Dim i, j, m
i = 0
j = 1
ba.Initialize()
byte_to_bits(sz1, ba)
For m = 0 To 7 '''''''''''''''''' 1
i = i + 1
'''''''''''''''''''''''''
rt.Text = ""
' set the size according to my bit
If ba.bits(m) = True Then
Color = ColorTranslator.FromWin32(Me.user_rgb_big)
rt.ForeColor = Color
Else
Color = ColorTranslator.FromWin32(Me.user_rgb)
rt.ForeColor = Color
End If
tre = tre + 1
rt.Text = tempt.Substring(tre, 1)
rt.SelectAll()
Clipboard.SetText(rt.SelectedRtf, TextDataFormat.Rtf)
RichTextBox1.Paste()
''''''''''''''''''''''''''
Next m
ba.Initialize()
byte_to_bits(sz2, ba)
For m = 0 To 7 '''''''''''''''''' 1
i = i + 1
'''''''''''''''''''''''''
rt.Text = ""
' set the size according to my bit
If ba.bits(m) = True Then
Color = ColorTranslator.FromWin32(Me.user_rgb_big)
rt.ForeColor = Color
Else
Color = ColorTranslator.FromWin32(Me.user_rgb)
rt.ForeColor = Color
End If
tre = tre + 1
rt.Text = tempt.Substring(tre, 1)
rt.SelectAll()
Clipboard.SetText(rt.SelectedRtf, TextDataFormat.Rtf)
RichTextBox1.Paste()
''''''''''''''''''''''''''
Next m
ba.Initialize()
byte_to_bits(sz3, ba)
For m = 0 To 7 '''''''''''''''''' 1
i = i + 1
'''''''''''''''''''''''''
rt.Text = ""
' set the size according to my bit
If ba.bits(m) = True Then
Color = ColorTranslator.FromWin32(Me.user_rgb_big)
rt.ForeColor = Color
Else
Color = ColorTranslator.FromWin32(Me.user_rgb)
rt.ForeColor = Color
End If
tre = tre + 1
rt.Text = tempt.Substring(tre, 1)
rt.SelectAll()
Clipboard.SetText(rt.SelectedRtf, TextDataFormat.Rtf)
RichTextBox1.Paste()
''''''''''''''''''''''''''
Next m
ba.Initialize()
byte_to_bits(sz4, ba)
For m = 0 To 7 '''''''''''''''''' 1
i = i + 1
'''''''''''''''''''''''''
rt.Text = ""
' set the size according to my bit
If ba.bits(m) = True Then
Color = ColorTranslator.FromWin32(Me.user_rgb_big)
rt.ForeColor = Color
Else
Color = ColorTranslator.FromWin32(Me.user_rgb)
rt.ForeColor = Color
End If
tre = tre + 1
rt.Text = tempt.Substring(tre, 1)
rt.SelectAll()
Clipboard.SetText(rt.SelectedRtf, TextDataFormat.Rtf)
RichTextBox1.Paste()
''''''''''''''''''''''''''
Next m
' MsgBox(sz1.ToString)
'MsgBox(sz2.ToString)
' MsgBox(sz3.ToString)
' MsgBox(sz4.ToString)
' MsgBox(amount)
'''' we have just stored the size of the text
'now we will store real message's text itself
'''''''''''''''''''''''''
rt.Text = ""
' set the size according to my bit
If ba.bits(m) = True Then
Color = ColorTranslator.FromWin32(Me.user_rgb_big)
rt.ForeColor = Color
' MsgBox(Color.ToArgb.ToString)
Else
Color = ColorTranslator.FromWin32(Me.user_rgb)
rt.ForeColor = Color
'MsgBox(Color.ToArgb.ToString)
End If
tre = tre + 1
rt.Text = tempt.Substring(tre, 1)
rt.SelectAll()
Clipboard.SetText(rt.SelectedRtf, TextDataFormat.Rtf)
RichTextBox1.Paste()
''''''''''''''''''''''''''
Next m
Next cnt
''now commplete the usless rest of text
Dim rest As Long
For rest = tre + 1 To tempt.Length - 1
rt.Clear()
Color = ColorTranslator.FromWin32(Me.user_rgb)
rt.ForeColor = Color
rt.Text = tempt.Substring(rest, 1)
rt.SelectAll()
Clipboard.SetText(rt.SelectedRtf, TextDataFormat.Rtf)
RichTextBox1.Paste()
Next
rt.Dispose()
End Sub
Public Sub decrypter1(ByRef errflag As Boolean)
errflag = False
TextBox1.Text = ""
ba.Initialize()
Dim sz As Long
Dim sz1, sz2, sz3, sz4 As Byte
Dim m As Long
For m = 0 To 7
' rt.Clear()
cont = cont + 1
RichTextBox1.Select(cont, 1)
If RichTextBox1.SelectionFont.Size = Me.user_size Then
ba.bits(m) = False
Else
ba.bits(m) = True
End If
Next m
bits_to_byte(sz1, ba)
ba.Initialize()
' MsgBox(sz1.ToString)
For m = 0 To 7
cont = cont + 1
RichTextBox1.Select(cont, 1)
If RichTextBox1.SelectionFont.Size = Me.user_size Then
ba.bits(m) = False
Else
ba.bits(m) = True
End If
''' RichTextBox1.Refresh()
Next m
bits_to_byte(sz2, ba)
ba.Initialize()
' MsgBox(sz2.ToString)
For m = 0 To 7
cont = cont + 1
RichTextBox1.Select(cont, 1)
If RichTextBox1.SelectionFont.Size = Me.user_size Then
ba.bits(m) = False
Else
ba.bits(m) = True
End If
''' RichTextBox1.Refresh()
Next m
bits_to_byte(sz3, ba)
ba.Initialize()
' MsgBox(sz3.ToString)
For m = 0 To 7
cont = cont + 1
RichTextBox1.Select(cont, 1)
If RichTextBox1.SelectionFont.Size = Me.user_size Then
ba.bits(m) = False
Else
ba.bits(m) = True
End If
''' RichTextBox1.Refresh()
Next m
bits_to_byte(sz4, ba)
ba.Initialize()
process_pass_with_tx(passw, output)
' MsgBox(output.ToString)
Dim je As Long
je = output.Length - 1
output = output.Substring(0, je)
TextBox1.Text = output
End Sub
Public Sub decrypter2(ByRef errflag As Boolean)
errflag = False
TextBox1.Text = ""
MsgBox("Selected Color /numeric value/ is : " +
Me.user_rgb.ToString, MsgBoxStyle.Information)
Dim tm As String = RichTextBox1.Text
Dim cont As Double = -1
' Dim rt As New RichTextBox
Dim color As Color
Dim ba As bits_array
ba.Initialize()
Dim sz As Long
Dim sz1, sz2, sz3, sz4 As Byte
Dim m As Long
For m = 0 To 7
' rt.Clear()
cont = cont + 1
RichTextBox1.Select(cont, 1)
' MsgBox(RichTextBox1.SelectionColor.ToArgb.ToString)
' MsgBox(Me.user_rgb_big.ToString + " <-big_ normal->" +
Me.user_rgb.ToString)
If RichTextBox1.SelectionColor =
ColorTranslator.FromWin32(Me.user_rgb_big) Then
ba.bits(m) = True
Else
ba.bits(m) = False
End If
Next m
bits_to_byte(sz1, ba)
ba.Initialize()
For m = 0 To 7
cont = cont + 1
RichTextBox1.Select(cont, 1)
If RichTextBox1.SelectionColor =
ColorTranslator.FromWin32(Me.user_rgb_big) Then
ba.bits(m) = True
Else
ba.bits(m) = False
End If
''' RichTextBox1.Refresh()
Next m
bits_to_byte(sz2, ba)
ba.Initialize()
' MsgBox(sz2.ToString)
For m = 0 To 7
cont = cont + 1
RichTextBox1.Select(cont, 1)
If RichTextBox1.SelectionColor =
ColorTranslator.FromWin32(Me.user_rgb_big) Then
ba.bits(m) = True
Else
ba.bits(m) = False
End If
''' RichTextBox1.Refresh()
Next m
bits_to_byte(sz3, ba)
ba.Initialize()
' MsgBox(sz3.ToString)
For m = 0 To 7
cont = cont + 1
RichTextBox1.Select(cont, 1)
If RichTextBox1.SelectionColor =
ColorTranslator.FromWin32(Me.user_rgb_big) Then
ba.bits(m) = True
Else
ba.bits(m) = False
End If
''' RichTextBox1.Refresh()
Next m
bits_to_byte(sz4, ba)
ba.Initialize()
process_pass_with_tx(passw, output)
' MsgBox(output.ToString)
Dim je As Long
je = output.Length - 1
output = output.Substring(0, je)
TextBox1.Text = output
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
End If
''''''''''''color change mode finish
'''''''''''''''''''''''''''''''''''''''''
End Sub
Private Sub RenderText6(ByVal e As PaintEventArgs)
Dim flags As TextFormatFlags = TextFormatFlags.Bottom Or _
TextFormatFlags.EndEllipsis
TextRenderer.DrawText(e.Graphics, _
"This is some text that will be clipped at the end.", _
Me.Font, New Rectangle(10, 10, 100, 50), SystemColors.ControlText,
flags)
End Sub
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
End Sub
End If
Exit Sub
ff:
MsgBox("User Cancelled")
GroupBox2.Visible = False
RadioButton1.Checked = False
Exit Sub
ff2:
MsgBox("Invalid value !")
GroupBox2.Visible = False
RadioButton1.Checked = False
End Sub
End Sub
On Error GoTo ba
Dim tt = CType(TextBox3.Text, Integer)
On Error GoTo ba
On Error GoTo ba
Me.user_rgb = RGB(CType(TextBox3.Text, Integer),
CType(TextBox4.Text, Integer), CType(TextBox5.Text, Integer))
On Error GoTo ba
Dim tempr As Integer
If Me.ComboBox1.SelectedIndex = 0 Then 'red
tempr = (CType(TextBox3.Text, Integer) + 1)
Me.user_rgb_big = RGB(tempr, CType(TextBox4.Text, Integer),
CType(TextBox5.Text, Integer))
ElseIf Me.ComboBox1.SelectedIndex = 1 Then 'green
tempr = (CType(TextBox4.Text, Integer) + 1)
Me.user_rgb_big = RGB(CType(TextBox3.Text, Integer), tempr,
CType(TextBox5.Text, Integer))
ElseIf Me.ComboBox1.SelectedIndex = 2 Then 'blue
tempr = (CType(TextBox5.Text, Integer) + 1)
Me.user_rgb_big = RGB(CType(TextBox3.Text, Integer),
CType(TextBox4.Text, Integer), tempr)
End If
On Error GoTo ba
On Error GoTo ba
Dim tt = CType(TextBox4.Text, Integer)
On Error GoTo ba
On Error GoTo ba
Me.user_rgb = RGB(CType(TextBox3.Text, Integer),
CType(TextBox4.Text, Integer), CType(TextBox5.Text, Integer))
On Error GoTo ba
Dim tempr As Integer
If Me.ComboBox1.SelectedIndex = 0 Then 'red
tempr = (CType(TextBox3.Text, Integer) + 1)
Me.user_rgb_big = RGB(tempr, CType(TextBox4.Text, Integer),
CType(TextBox5.Text, Integer))
ElseIf Me.ComboBox1.SelectedIndex = 1 Then 'green
tempr = (CType(TextBox4.Text, Integer) + 1)
Me.user_rgb_big = RGB(CType(TextBox3.Text, Integer), tempr,
CType(TextBox5.Text, Integer))
ElseIf Me.ComboBox1.SelectedIndex = 2 Then 'blue
tempr = (CType(TextBox5.Text, Integer) + 1)
Me.user_rgb_big = RGB(CType(TextBox3.Text, Integer),
CType(TextBox4.Text, Integer), tempr)
End If
On Error GoTo ba
On Error GoTo ba
Dim tt = CType(TextBox5.Text, Integer)
On Error GoTo ba
On Error GoTo ba
Me.user_rgb = RGB(CType(TextBox3.Text, Integer),
CType(TextBox4.Text, Integer), CType(TextBox5.Text, Integer))
On Error GoTo ba
Dim tempr As Integer
If Me.ComboBox1.SelectedIndex = 0 Then 'red
tempr = (CType(TextBox3.Text, Integer) + 1)
Me.user_rgb_big = RGB(tempr, CType(TextBox4.Text, Integer),
CType(TextBox5.Text, Integer))
ElseIf Me.ComboBox1.SelectedIndex = 1 Then 'green
tempr = (CType(TextBox4.Text, Integer) + 1)
Me.user_rgb_big = RGB(CType(TextBox3.Text, Integer), tempr,
CType(TextBox5.Text, Integer))
ElseIf Me.ComboBox1.SelectedIndex = 2 Then 'blue
tempr = (CType(TextBox5.Text, Integer) + 1)
Me.user_rgb_big = RGB(CType(TextBox3.Text, Integer),
CType(TextBox4.Text, Integer), tempr)
End If
On Error GoTo ba
End Sub
End Sub
End Sub
End Sub
End Sub
On Error GoTo ff
MsgBox("Done")
Exit Sub
ff:
MsgBox(Err.Description)
End Sub
End Class
TRANSPOSITION.VB
Public Class Transposition
IndR = Val(TxtRow.Text)
IndC = Val(TxtColumn.Text)
'>>> create the array
Dim DataArray(IndR, IndC) As String
Dim i, j As Integer
Dim r, c As Integer
Dim StrOut As String
StrOut = ""
i = 1
'>>> loop to total length
While i <= StrDataIn.Length
c = c + 1
p = p + 1
MessageTransposition = StrOut
End Function
'>>> validation
If Val(TxtRow.Text) < 1 Then
MsgBox("Row value should be more than 0.",
MsgBoxStyle.Exclamation)
TxtRow.Focus()
Exit Sub
End If
End Sub
End Class
PIC_KEYVB.VB
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
Imports System.IO
Imports System.Text
''' <summary>
'''
''' </summary>
Public Class pic_keyvb
Inherits System.Windows.Forms.Form
InitializeComponent()
End Sub
''' <summary>Cleanup</summary>
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If components IsNot Nothing Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
End Sub
#End Region
''' <summary>
'''
''' </summary>
<STAThread()> _
Private Shared Sub Main()
Application.Run(New pic_keyvb())
End Sub
Try
'hide the message
CryptUtility.HideMessageInBitmap(messageStream, bitmap,
keyStream, chkGrayscale.Checked)
'display result
picImage.Image = bitmap
btnSaveBitmap.Enabled = True
Catch ex As Exception
MessageBox.Show("Exception:" & vbCr & vbLf & ex.Message)
End Try
End If
keyStream.Close()
End If
messageStream.Close()
bitmap = Nothing
End Sub
Try
'extract the hidden message from the bitmap
CryptUtility.ExtractMessageFromBitmap(bitmap, keyStream,
messageStream)
If dlg.FilterIndex = 2 Then
format = System.Drawing.Imaging.ImageFormat.Tiff
ElseIf dlg.FilterIndex = 3 Then
format = System.Drawing.Imaging.ImageFormat.Png
End If
Black box testing - Internal system design is not considered in this type of testing. Tests are
based on requirements and functionality.
White box testing - This testing is based on knowledge of the internal logic of an
application’s code. Also known as Glass box Testing. Internal software and code working
should be known for this type of testing. Tests are based on coverage of code statements,
branches, paths, conditions.
Unit testing - Testing of individual software components or modules. Typically done by the
programmer and not by testers, as it requires detailed knowledge of the internal program
design and code. may require developing test driver modules or test harnesses.
Incremental integration testing - Bottom up approach for testing i.e continuous testing of an
application as new functionality is added; Application functionality and modules should be
independent enough to test separately. done by programmers or by testers.
Functional testing - This type of testing ignores the internal parts and focus on the output is
as per requirement or not. Black-box type testing geared to functional requirements of an
application.
System testing - Entire system is tested as per the requirements. Black-box type testing that is
based on overall requirements specifications, covers all combined parts of a system.
Sanity testing - Testing to determine if a new software version is performing well enough to
accept it for a major testing effort. If application is crashing for initial use then system is not
stable enough for further testing and build or application is assigned to fix.
Regression testing - Testing the application as a whole for the modification in any module or
functionality. Difficult to cover all the system in regression testing so typically automation
tools are used for these testing types.
Acceptance testing -Normally this type of testing is done to verify if system meets the
customer specified requirements. User or customer do this testing to determine whether to
accept application.
Load testing - Its a performance testing to check system behavior under load. Testing an
application under heavy loads, such as testing of a web site under a range of loads to
determine at what point the system’s response time degrades or fails.
Stress testing - System is stressed beyond its specifications to check how and when it fails.
Performed under heavy load like putting large number beyond storage capacity, complex
database queries, continuous input to system or database load.
Performance testing - Term often used interchangeably with ’stress’ and ‘load’ testing. To
check whether system meets performance requirements. Used different performance and load
tools to do this.
Usability testing - User-friendliness check. Application flow is tested, Can new user
understand the application easily, Proper help documented whenever user stuck at any point.
Basically system navigation is checked in this testing.
Recovery testing - Testing how well a system recovers from crashes, hardware failures, or
other catastrophic problems.
Security testing - Can system be penetrated by any hacking way. Testing how well the system
protects against unauthorized internal or external access. Checked if system, database is safe
from external attacks.
Alpha testing - In house virtual user environment can be created for this type of testing.
Testing is done at the end of development. Still minor design changes may be made as a result
of such testing.
Beta testing - Testing typically done by end-users or others. Final testing before releasing
application for commercial purpose.
IMPLEMENTATION AND MAINTENANCE
Implementation is the process of having systems personnel check out and put new equipment
into use, train users, install the new application and construct any files of data needed to use it.
This phase is less creative than system design. Depending on the size of the organization that
will be involved in using the application and the risk involved in its use, system developers
may choose to test the operation in only one area of the firm with only one or two persons.
Sometimes, they will run both new and old system in parallel way to compare the results. In
still other situations, system developers stop using the old system and start using the new one
the next.
Maintenance is necessary to eliminate errors in the working system during its working life and
to tune the system to any variations in its working environment. Often small system
deficiencies are found as a system is brought into operations and changes are made to remove
them. System planners must always plan for resource availability to carry out these
maintenance functions. The importance of maintenance is to continue to bring the new system
to standards.