Encryption/Decryption keys:
Hello - I am working with image encryption and decrytion.
I am using a rand(l,m) * 10 + 1 = encryptionKey
where l,m is the dimensions of my image matrix
i am trying to multiply the encryption key to the magnitude and phase of the image - and then use a decryption key to get back to the original image.
i am not sure how to go about getting this decryption key.
i would have assumed it be
decryptionKey = inv(encryptionKey)
and then doing:
encyptionKey * magnitude of image = a
then decryptionKey * a = b
i am using fft2 to compute the magnitude and phase of the images.
pretty much - i want to multiple the magnitude and phase of the image by the encryption key and then add these 2 to make the encryptied image and then take the inverse fourier [ifft2] to get back to the original image.
please help.
thanks in advance.
I am using a rand(l,m) * 10 + 1 = encryptionKey
where l,m is the dimensions of my image matrix
i am trying to multiply the encryption key to the magnitude and phase of the image - and then use a decryption key to get back to the original image.
i am not sure how to go about getting this decryption key.
i would have assumed it be
decryptionKey = inv(encryptionKey)
and then doing:
encyptionKey * magnitude of image = a
then decryptionKey * a = b
i am using fft2 to compute the magnitude and phase of the images.
pretty much - i want to multiple the magnitude and phase of the image by the encryption key and then add these 2 to make the encryptied image and then take the inverse fourier [ifft2] to get back to the original image.
please help.
thanks in advance.
0
Comments
would if be .*
or *
?
same question for when decrypting it.
thanks
EDIT: Did you come up with this algorithm or did your professor tell you to implement your cipher this way?
Also, what do you mean when you say you're going to add the encrypted magnitude and phase together? Can you even do that? Speaking from a mathematical standpoint, generally you don't use addition/subtraction when doing encryption unless you're adding/subtracting a known constant since adding/subtracting two variable values isn't possible to reverse without knowing what one of the original values is. Of course, that's strictly algebraically speaking, I'm not so familiar with phase and magnitude of images wrt how you manipulate them.
Really though, at the end of the day, what you're asking is beyond the scope of this forum. Please read the posting guideline for this forum: http://icrontic.com/forum/showthread.php?t=91735
If you have problems with your code, we can help. You seem to have fundamental algorithm problems which is something you need to work out on your own. I'd suggest speaking to your professor, TA or consulting the people in an appropriate learning center (if your school has them).
Actually - I posted this a little bit early yesterday and then I figured out what I really needed to do:
So: I figured out that to decrypt the image it is not inv(enc)
Really - the only problem that i am having now is:
when i separate the magnitude and phase of the image and multiply both pieces with the encryption key, how do i combine the magnitude and phase to get back to the original image?
would it be point by point multiplcation or how would i go about combining the two pieces to get back?
because my professor wants us to display the encrypted part of the magnitude and the encrpyted part of the phase and then combine those two parts and then decrypt the image and then run ifft2 on it to get back to the original image.
i have all the code and it works perfectly when i run the encryption/decryption on only the original image...but i just do not know how to combine the magnitude and phase into 1 image once i separate them..
if anyone would like....i could email you the code that i have?
THANK YOU SO VERY MUCH FOR THIS.
- and we asked our TA....she doesn't know anything about matlab.
I am having trouble with bringing the magnitude and phase back together...
So I should decrypt them separately...then combine and then take the ifft2 and it should be the original, correct?
The only thing i dont understand is how to combine them...
would it be:
DecryptedMagni .* DecryptedPhase = Decrypted Image
And then do ifft2 on the Decrypted image?
Thank you very much for your help!!!
I found this set of slides interesting: http://www.cse.unr.edu/~bebis/CS474/Lectures/FourierTransform.ppt
Would I use the full complex form or the eulers form in matlab when combining the phase and magnitude?
after combing i would do ifft2(x)
and then imshow((x), [10 10000]) or soemthing similar to that to get the original image - correct?
Thanks!