이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
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..
조회 수: 2 (최근 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.
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!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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 (한국어)
