Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
December 23rd, 2012, 11:02 AM
Registered User

Join Date: Dec 2012
Posts: 3
Time spent in forums: 33 m 24 sec
Reputation Power: 0
C Program urgent help

dear readers I have done my researches and still un-able to solve this program so please I need someone to help me or even solve it but as I think we must use semaphores, forks and pipes. am not good in C language... thanks for all.

We are requested to implement a code cracking system. The system will deploy four processes (p1,p2,p3 & p4) to try to guess the password of an encrypted code.
For encryption, we consider that the formula is: C = P XOR K, where
• C = encrypted code
• P = plain text
• K = key
For decryption the formula is: P = C XOR K. So, your program will try to find K using this formula. The XOR operator is ^.
Given an encrypted code C and plain code P your program should deploy three processes to try and find the key used to encrypt the plain code. These three processes will be under the control of process P1.
All processes will send their results to process P1 and process P1 will terminate the three processes and display the encryption key and decrypted text once any of the three processes finds the key.
For simplicity we will consider that we have the original number P stored in a file called plain.txt and the encrypted code is stored in a file called cipher.txt. Consider that only numbers are stored in these files and they have a range between 0 and 100000000.
So we have P and C your program should find the key K. Consider that K is a positive number between 0 and 1000000.

#2
December 23rd, 2012, 01:31 PM
 BobS0327
Contributing User

Join Date: Oct 2012
Posts: 160
Time spent in forums: 4 Days 7 h 53 m 33 sec
Reputation Power: 64
Here's a thread that looks very similar to yours.

Quote:
 I think we must use semaphores, forks and pipes

A detailed tutorial of IPC mechanisms can be found here.

What does your plain.txt and cipher.txt files look like?
salem agrees: Nice catch of the clones

 Viewing: Dev Shed Forums > Programming Languages > C Programming > C Program urgent help