Please help me raise money to study abroad with Temple University in Tokyo, Japan. Please follow the link to donate. I appreciate any amount of money that you are willing to give. Any money donated will go ONLY towards tuition and program costs. Thank you again.
http://www.gofundme.com/22z71g
Ray Chappel wrote:I have been given an assignment in which I am supposed to write a program that takes a plaintext and a cipher text (encrypted using DES) and does an exhaustive search for the key. So I need a few things:
Import the plaintext file (a .txt) and the ciphertext file (a .txt)
compare the two files and find the key (key must be at least 8 characters)
Has to be done using brute force
plain text: Seize the Day!
Cipher Text: püš½:©¹ÝBõ¿
Again, the plain text was encrypted using DES.
I have no idea where to start with this and how to do what needs to be done. Any sources, code, or suggestions are greatly appreciated.
The following plaintext:
Seize the Day!
was encrypted with DES the algorithm implemented at:
http://www.avajava.com/tutorials/lessons/how-do-i-encrypt-and-decrypt-files-using-des.html
Three files (original.txt, encrypted.txt, and CipherExample.java) are included with this assignment. Note that the key in the code was changed.
Write code that given the plaintext and ciphertext above will try and exhaustive search for the key.
Please help me raise money to study abroad with Temple University in Tokyo, Japan. Please follow the link to donate. I appreciate any amount of money that you are willing to give. Any money donated will go ONLY towards tuition and program costs. Thank you again.
http://www.gofundme.com/22z71g
Please help me raise money to study abroad with Temple University in Tokyo, Japan. Please follow the link to donate. I appreciate any amount of money that you are willing to give. Any money donated will go ONLY towards tuition and program costs. Thank you again.
http://www.gofundme.com/22z71g
Please help me raise money to study abroad with Temple University in Tokyo, Japan. Please follow the link to donate. I appreciate any amount of money that you are willing to give. Any money donated will go ONLY towards tuition and program costs. Thank you again.
http://www.gofundme.com/22z71g
Ray Chappel wrote:Well the goal is to try and find the key. However, yes, it may not be able to if it would take too long. So the goal is to write a program that will try to find the key.
My problem is that I'm not sure how to do it.
I have very little java (or programming) experience so I'm not sure where to start.
Richard Tookey wrote:
I'm very uncomfortable with this. It is difficult to see how a Java course could jump in with a homework requirement such as this so I assume it builds on lectures and previous homework. Your task does not really rely on understanding the JCE; the JCE is just clutter and the homework requires that you be able to iterate through all the 2^56 possible key values and then use them in the code given.
Note - a DES key is just 56 bits packaged in 8 bytes with the least significant bit of each byte being a parity bit. The JCE ignores this parity bit so you just have to go though the 128 values of each byte that ignore the least significant bit. This can be done very simply using recursion but could equally well be done by counting though the first 2^56 values of a long and converting the first 56 bits of the long to 8 bytes (7 bits at a time) using the shift operators. The actual approach you take will depend on what you have done in the course so far.
Note 1 - the code you published is flawed. It assumes that the key can always be represented by a String and that it can be converted to bytes using the platform default character encoding! This makes it non-portable since for a given key String the actual bytes of the key will depend on the platform default character encoding!
Please help me raise money to study abroad with Temple University in Tokyo, Japan. Please follow the link to donate. I appreciate any amount of money that you are willing to give. Any money donated will go ONLY towards tuition and program costs. Thank you again.
http://www.gofundme.com/22z71g
Please help me raise money to study abroad with Temple University in Tokyo, Japan. Please follow the link to donate. I appreciate any amount of money that you are willing to give. Any money donated will go ONLY towards tuition and program costs. Thank you again.
http://www.gofundme.com/22z71g
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|