Project Description
Project Description
Groups
This project is to be done in groups of Three (Maximum). Please note "If you copy the code, share your
code, and/or any form of cheating, your project will not be graded".
Purpose
This project is an opportunity to obtain hands-on practice using the introductory data transformation and
brute force techniques covered in the lectures.
Design a block encryption algorithm to meet specific requirements, brute force the algorithm, and reflect
on how the type of data encrypted affects the breakability of the encryption.
Objectives
Technology Requirements
Project Description
In cryptography, a block is a fixed-length chunk of data. To encrypt these blocks, we use block ciphers. A
block cipher is a deterministic algorithm operating on blocks with an unvarying transformation that is
specified by a symmetric key. Along with the key, substitution and permutation are also used to transform
the data. The S-boxes and P-boxes are used to make the relation between the plaintext and the ciphertext
difficult to understand. In general, substitution box (S-box) takes some number of input bits, m, and
transforms them into some number of output bits, n, where n is not necessarily equal to m. A permutation
For this project design and implement an algorithm that can encrypt and decrypt the documents. These
documents can be in any format (.txt, .pdf, .jpeg and so on). The algorithm should be a 32-bit block
encryption algorithm which uses Electronic Code Book (ECB) mode.
• The core program/function takes two 32-bit quantities as input, a ‘plaintext’ and a ‘key’, then
produce a 32-bit output ‘ciphertext’.
• The input, output, and key are all ‘type-less’ (or unsigned integers) –as they could be any form of
data.
• The input and key should be difficult to figure out from the output. i.e., Even if the plaintext and
ciphertext are known, the key should be hard to derive. You may use an s-box, a p-box, or both to
obscure the relationship between the key and ciphertext.
• The encryption algorithm must be reversible. i.e., Decrypting the encrypted file should be possible
when the key is known.
• The encryption should work in a manner that it makes the algorithm hard to “break.”
Part 1 Directions:
1. Write a program to encrypt and decrypt data and test it. It should run from the command line with the
following format:
% encrypt key <filename1> <filename2> Where key is an 8-character (32-bits) HEXADECIMAL string
(example: “1A2B9E0F”) and the input is in filename1. The program encrypts the input and produces the
encrypted output in filename2.
2.Write the decryption program in the same fashion. Make sure you test it on several kinds of input such
as text, PDF, JPG, and so on. You may use C or C++ or Java, but C / C++ is encouraged.
3.Write a program to brute force the encrypted file and find the key.
4.Find ways of cracking the key using some weakness of your algorithm without the need for brute forcing
it. You are encouraged to get help from friends or colleagues to find weaknesses in your design.
Part 2 Directions:
●Describes your algorithm design and why you made those choices.
●Document the time it takes for you to brute force the key.
●Explain how the file type relates to the amount of time it takes to brute force that file.
Submit the codes and the document you generated for Part 2 in a zipped file. Keep it short.
Note: each student in the group should upload the project deliverables to her blackboard. Put both names
on the document.