image encryption using rc4 : error in bitxor

Hello Community ,
i work now on rc4 image encryption algorithm but i am facing a little proplem
the image dimensions is 128 * 128 uint8
& the cipher generated by my algorithm is 1 * 128 uint 8
how to get the cipher to be generated in the same dimensions of input image
i will attach compressed file contains algorithm files
Hope you can help me, Thanks in Advance

2 件のコメント

DGM
DGM 2021 年 11 月 16 日
What is image2data()? Is it this? If so, the output is a handle to a figure object, not an image.
Muhammad Abdulrazek
Muhammad Abdulrazek 2021 年 11 月 16 日
No sir , it is not image2data which get curve data from image
image2data is a function from qpsk modulator package

 採用された回答

Jan
Jan 2021 年 11 月 16 日

0 投票

You instruct PRGA to reply 128 values:
Cipher = uint8(PRGA(KSA(key), size(original,2)));
I assume you want:
Cipher = uint8(PRGA(KSA(key), numel(original)));

3 件のコメント

Muhammad Abdulrazek
Muhammad Abdulrazek 2021 年 11 月 16 日
Thank you very much , it work
but i have another problem : the image after encryption & decryption doesnt apear in figure or histogram ?
Jan
Jan 2021 年 11 月 16 日
It does appear: Do you see the blue lines at x==0 and x==1? This seems to be a confusion between the double and UINT8 types. Cast the images as UINT8 before you forward it to the function to compute the histograms.
Muhammad Abdulrazek
Muhammad Abdulrazek 2021 年 11 月 16 日
Thank you , I solved ther other problem

その他の回答 (0 件)

この質問は閉じられています。

製品

リリース

R2016a

質問済み:

2021 年 11 月 16 日

閉鎖済み:

2021 年 11 月 18 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by