필터 지우기
필터 지우기

Key-based matrix scrambling

조회 수: 3 (최근 30일)
Digitalsd
Digitalsd 2012년 10월 31일
I have a matrix and I need to scramble its elements in a reversible way using a key based function.It could be a key based permutation. The question: Are there any built-in MATLAB functions or libraries that could help me to perform such operation? any suggestions?

채택된 답변

Jan
Jan 2012년 10월 31일
편집: Jan 2012년 10월 31일
data = rand(1, 128);
key = 12654;
stream0 = RandStream('mt19937ar', 'Seed', key);
RandStream.setDefaultStream(stream0);
index = randperm(128);
scrambled = data(index);
unscrambled = zeros(1, numel(data));
unscrambled(index) = scrambled;
isequal(data, unscrambled)
This is not tested yet.
  댓글 수: 2
Digitalsd
Digitalsd 2012년 11월 1일
The question’s point : if I send you a key-based scrambled matrix, you will be able to extract the original matrix using the same key (symmetric key). If the codes in lines 3 and 4 will force the ‘randperm’ in line 5 to give me the same ‘index‘ permutation when using the same key, I will reach the point. !?
Digitalsd
Digitalsd 2012년 11월 2일
has been tested, works correctly.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by