Image encryption in MATLAB

조회 수: 5 (최근 30일)
vardhit
vardhit 2013년 8월 7일
which is the simplest key-less image encryption or scrambling technique?

채택된 답변

Jan
Jan 2013년 8월 7일
It depends on what "simple" means. Perhaps:
  • Rename it from .jpg to .avi, then opening it leads to confusing messages
  • Apply a ROT13 to the bytes of the image file or image data
  • A cumulative XOR looks very scrambled:
image = rand(100, 100, 3);
stream = typecast(image, 'uint8');
for k = 2:numel(stream)
stream(k) = xor(stream(k), stream(k - 1));
end
There are so many other simple methods, that I cannot imagine, that you won't find dozens more by your own.
  댓글 수: 2
vardhit
vardhit 2013년 8월 7일
??? Error using ==> typecast The first input argument must be a vector.
Error in ==> Untitled3 at 2 stream = typecast(image, 'uint8');
Jan
Jan 2013년 8월 7일
As the error message implies: Make it a vector:
stream = typecast(image(:), 'uint8');

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by