フィルターのクリア

Convert Struct to Binary and Back

28 ビュー (過去 30 日間)
Michael
Michael 2014 年 1 月 9 日
回答済み: Michael 2014 年 1 月 10 日
I am trying to create an encrypt save function for a mat file as well as a decrypt load function. I have only one structure that I need to save. What I have been able to do successfully is save the variable to a mat file, rename the mat file to a txt file, read the txt file in matlab to get the binary data that was the mat file, and then apply the the encryption algorithm and save that as the final mat file to send out. The to decrypt it I reverse the process of saving txt files and renaming it to mat files but that can leave a trail of files of decrypted data.
Is there a way to convert my structure into raw binary data for me to encrypt and then decrypt the data back into the raw binary data and convert it back into a struct with out have to save text file? Or if any one has any better encryption methods that will be a welcome answer as well.

採用された回答

Michael
Michael 2014 年 1 月 10 日
All set found a solution by using mxSerialize and mxDeserialize to to serialize the structure.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEncryption / Cryptography についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by