encryption of .mat files
이전 댓글 표시
*hello , i have stored the data of my application in .mat file , i edit and change the values of the variables throw my application , i don't want the other user to see the name of variables or the values , any suggested function or a way to encrypt the file ??
Thanks ALL*
채택된 답변
추가 답변 (4개)
Matt Kindig
2012년 7월 18일
편집: Matt Kindig
2012년 7월 18일
1 개 추천
Hi Khaled,
This hasn't gotten any bites yet, so I thought I'd take a stab at it, although I am not an encryption expert by any means.
What access do you want the "other user" to have to your data? As I understand it, you basically want to encrypt your file such that someone else cannot open and read your data. I'm not sure how you'll be able to do that in a *.mat file-- if you use Matlab to save the data in MAT format, the file will be written in such a way that it can be opened with Matlab, as that is the purpose of the file format. I don't believe that Matlab has an equivalent of Excel's "Protect Workbook" or similar. You can encrypt m-files such that they can be executed without revealing the source code (using the 'pcode' function), but that is obviously something different than you want.
If you want to store your data in a format that is available for reading only for yourself (or a limited number of people), you are probably better off writing to a binary file and then using one of a number of standard encryption codes. A quick search of the File Exchange indicates a few encryption functions--Google I'm sure has countless more. How secure do you need the encryption?
Matt
댓글 수: 2
khaled DAWOUD
2012년 7월 18일
편집: khaled DAWOUD
2012년 7월 18일
Mahmoud
2016년 8월 21일
Dear Khaled, Have you found any solution for your problem?
per isakson
2012년 7월 18일
편집: per isakson
2012년 7월 18일
Matlab documentation:
New MAT-File Format Based on HDF5
In Version 7.3 (R2006b), you can save MAT-files in a format based on HDF5.
The v7.3 mat-file is documented and can be inspected with the hdf5-tools:
>> h5disp( 'mk.mat')
HDF5 mk.mat
Group '/'
Group '/#refs#'
Dataset 'a'
....
HDF5 is open and well supported.
In the "The Data Transfer Pipeline" of HDF5 it is possible to include your own code for encryption and decryption (and more common compression).
Thus, it should be doable - maybe.
댓글 수: 2
khaled DAWOUD
2012년 7월 18일
per isakson
2012년 7월 18일
편집: per isakson
2012년 7월 19일
I picked up the info above from reading the documentation and hdf-forum. I cannot add much. Bad news:
- the size of the "v7.3 file" is much larger than the compressed default file
- might work for values but maybe not for names.
If you are serious about it why not ask tech-support.
David Leffingwell
2023년 6월 12일
0 개 추천
If you are using the MATLAB Compiler, you can use the -s option to encrypt your data (e.g. MAT files) in addition to your M files. See here.
카테고리
도움말 센터 및 File Exchange에서 Manage Products에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!