現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
in a code of encryption if y=mod(x,256); is used. how can i apply the same statement in decryption process to get x back if i have only y and 256 know..
1 回表示 (過去 30 日間)
古いコメントを表示
採用された回答
Jan
2016 年 1 月 2 日
編集済み: Jan
2016 年 1 月 2 日
You can't. If x is smaller than 256, the modulo operation replies x without changes. If x is larger than 256, this operation replies the remainder of the division, and the other information is lost. So if you do not store the value of floor(x / 256) anywhere, this "encryption" is not reversable in a unique manner.
16 件のコメント
tania
2016 年 1 月 3 日
actually i was doing encryption by bit level permutation..which uses arnold cat map and logistic map..in the decryption process ..i applied all the processes in a reverse manner to get the intial image..is this encryption process not reversible?? can u tell me what is this encryption used for ..if it cannot be decrypted to get back the intial image.. thanks in advance
Image Analyst
2016 年 1 月 3 日
Only if you kept track of how many multiples of 256 your signal was sitting on top of.
John D'Errico
2016 年 1 月 3 日
Information, once tossed into the bit bucket black hole, is lost forever.
Walter Roberson
2016 年 1 月 3 日
The arnold cat map is reversible in one step by using a lookup table.
Populate a cell array the same size as your original array, and fill the cell array with the coordinate pairs of the cell location. Apply the cat map process, moving the cell contents. The result is a lookup table for inversion: to know where location (I,J) came from, look in the table at location (I,J) and the cell content there give you the original coordinates.
tania
2016 年 1 月 24 日
編集済み: tania
2016 年 1 月 24 日
i have basically done encryption by bit level permutation using logistic and arnold cat map.it is a article published in elsevier .i m struck in the decryption or we can say inverse of arnold cat map. as it loses the info. in the application of mod in it.Walter Roberson sir .. would u plzz make me understand the concept of cell array and cell location . as i m not able to get the above explaination.. moreover ..if i hv encrypted the image and sent it . at the other end the person only has the secret ket and decryption algo. the look table cannot be sent to the receiver. thanks
Walter Roberson
2016 年 1 月 24 日
Example:
[rows, cols] = size(YourArray);
[R, C] = ndgrid(1:rows, 1:cols);
map_cell = arrayfun(@(r,c) {r,c}, R, C, 'Uniform', 0);
Now map_cell is a cell array that has the same number of rows and columns as YourArray, and for any location YourArray(I,J), map_cell{I,J} = [I,J] which is the coordinates in the original array. Now you can apply the arnold cat map to map_cell, moving the cell contents around to get a new array, such as map_from_cell, which will be such that map_from_cell{I,J} will be the vector of coordinates that tell you where that location moved from .
This is something you can do on the decoding side, provided you know the size of the original array.
With the map_from_cell in hand, you can use
for J = 1 : size(map_from_cell,1)
for K = 1 : size(map_from_cell,2)
came_from = map_from_cell{J,K};
unscambled_image( came_from(1), came_from(2) ) = scambled_image(J,K);
end
end
tania
2016 年 2 月 3 日
how can i apply arnold cat map to a matrix containing cell arrays??? i tried doing so ..but it gives error
Undefined function 'mrdivide' for input arguments of type 'cell'.
Walter Roberson
2016 年 2 月 4 日
[rows, cols] = size(YourArray);
idximg = reshape(1:numel(YourArray), rows, cols);
Now apply the cat map to idximg producing cat_idximg .
Now,
unscambled_image = zeros(rows, cols, class(scrambled_image));
unscambled_image(cat_idximg) = scrambled_image;
Caution: you might have written your cat map code expecting the values to be uint8. Your cat map code should be written to produce an output image the same type as its input image, by initializing like I show above, using zeros and class()
tania
2016 年 2 月 4 日
編集済み: Walter Roberson
2016 年 2 月 4 日
I=[2 3 4 ; 5 6 7; 7 8 9];
[rows, cols] = size(I);
[R, C] = find(I);
P1 = arrayfun(@(r,c) {r,c}, R, C, 'Uniform', 0);
id = reshape(1:numel(I), rows, cols);% index image
z=4;
KD(1)=0.34565487923280;%%arbitrary selected
yy1=mod(((z*(I/1000)*(1-I)/1000)*1000)+(KD(1)*10^10),256);
yy=mod(((z*(id/1000)*(1-id)/1000)*1000)+(KD(1)*10^10),256);
unscambled_image = zeros(rows, cols, class(yy1));
unscambled_image(yy) = yy1;
for J = 1 : size(yy,1)
for K = 1 : size(yy,2)
came_from = yy{J,K};
unscambled_image( came_from(1), came_from(2) ) = yy1(J,K);
end
end
basically i want to do all the procedure on a image .. but only for testing i applied on a matrix of 3x3.
my main aim is to retrieve the values of the matrix as it is. now this error is coming
Subscript indices must either be real positive integers or logicals.
Error in try11 (line 13)
unscambled_image(yy) = yy1;
as the value of
yy=[184.256000041962 184.111999988556 183.967999935150;
184.243999958038 184.064000129700 183.884000301361;
184.231999874115 184.016000270844 183.800000190735];
Walter Roberson
2016 年 2 月 4 日
I do not know where you got your code for KD and yy and yy1, but it is not correct code for an Arnold Cat Map. Arnod Cat Map uses strictly integer coefficients, as the output of a Cat Map step is a set of coordinates where you are to write the data into.
tania
2016 年 2 月 7 日
i got this from a review paper published in ELSEVIER in ScienceDirect..."A chaotic Based symmetric image encryption using bit level permutation. " in 2010 under information sciences. the encryption process is given.. i have problem in the decryption process, to retrieve the values back.
tania
2016 年 2 月 9 日
i think the pic given as attachment file will help u to understand.. it is of one of the page of the paper. which contains the main equation.
Walter Roberson
2016 年 2 月 9 日
That paper has an incorrect algorithm unless there is a non-standard notation that is explained earlier in the paper or unless there is a typesetting mistake in the formula. I would need a printed copy of the paper (based upon the original manuscript, not an image of it), and a magnifying glass to be certain, but with the image you have given the algorithm certainly appears to be wrong.
tania
2016 年 2 月 11 日
Sry for the inconvenience and thank u and I will try to provide the hard copy if possible
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)