- you could just stop transferring and leave the larger array to be whatever is appropriate
- you could prefix size information into what is being transferred, so that the destination first retrieves the site and then knows how many locations to look at
- you could pad with a constant
- you could ensure that the data being transferred never includes a particular pattern, and then put the pattern at the place the data stops -- an "end of message" marker
LSB transform for image encryption
1 回表示 (過去 30 日間)
古いコメントを表示
I want to use LSB transform to encode the message in the image. The length of the bit string is less than the size of the image. I wrote a code, but when the length of the message is less, I don't know how to do the encryption. Thank you for your guidance
clc;
clear;
close all;
img=imread('cameraman.tif');
[m,n]=size(img);
message=randi([0 1],m,n);
em=img;
for i=1:m
for j=1:n
pix=dec2bin(img(i,j),8);
if (message(i,j)==0);
pix(8)='0';
else
pix(8)='1';
end
em(i,j)=bin2dec(pix);
end
end
0 件のコメント
回答 (2 件)
Walter Roberson
2023 年 1 月 21 日
For legal reasons we cannot discuss encryption here.
If you have two arrays and information is being transferred from a shorter array to a larger array, you have a few choices:
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!