Skip to content

Assignment 3 in High performance Computing (Parrallel processing), Encrypt a message using Caesar Cipher

Notifications You must be signed in to change notification settings

nadaahmed2001/Messege_Encryption_Parallel_Program_MPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Assignment 3 in High performance Computing (Parrallel processing), Encrypt a message using Caesar Cipher.

Assignment Describtion

[Using BCast, Scatter and Gather ONLY]

You are required to take a message from a file and encrypt the message using caesar cipher and store the output in a new file.
The encryption can be represented using modular arithmetic by first transforming the letters into numbers, according to the scheme, A = 0, B = 1,…, Z = 25.

For example :
Encryption of a letter x by a shift n can be described mathematically as:

En(x) = (x + n) mod 26

Any other character outside the range from A to Z (or a to z) is transferred to the output file as it is.
Input: filename and key/shift value.
Output: new file that contains the encrypted message.

ScreenShots of my source code output:

First case: a messege length is divisible by number of processes, in myfile.txt I have written a string of 20 characters
so 20/4 = 5 and 20%4=0 ... then each process will handle 5 charachters

Problem1WithoutRemainder

Second case: a messege length is not divisible by number of processes, in myfile.txt I have written a string of 20 characters
but used 3 processes, 20%3=2... so each process will take 6 characters and the last 2 characters are handeled by master at the end

Problem1WithRemainder

About

Assignment 3 in High performance Computing (Parrallel processing), Encrypt a message using Caesar Cipher

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages