You can implement a string encryption method by your own. Using Java you need 3 or 4 lines of code only. Unfortuantely the export laws do not allow to publish the code on a server located in the USA, because evil countries could use it to encrypt their evil data also. But if you ask your favourite search engine for 'MATLAB AES encryption', your are still successful, I think. If you are a citizen of an evil country, please do not ask a search engine.
![]()
(Any additional details of my personal opinion about the US export restrictions would be off-topic.) Then you have the standard problem, that the encryption key must be stored reliably also. Never store the password in clear text, even not in P-coded files, otherwise the decryption gets near to trivial and a dull ROT13 method would offer the same level of security. Another problem appears, when you need to process MAT-files: You can write the MAT file in clear text, encrypt it and ship it to the users. But then you cannot load the file directly.
You have to decrypt the file at first and write it to the harddisk before load can import the data. But then you need a very sophisticated method to remove the clear-text data from the disk afterwards. I'm convinced, that you cannot reach a 95% security level by this way. You find tools to 'serialize' objects in the FEX (use this term to search there). This means, that e.g.
A struct can be converted to a byte stream, which can be encrypted easily. Then the decryption can happen in the memory as well as the 'deserialization'. In consequence the hard disk remains clean and the clear text data can only be found using a memory dump. When the password is kept securely, this means a security level of 99% (in arbitrary units.). I really would thank you for your answer and time i really appreciated.
![]()
I was thinking of make a function that make.mat files unreadable or known by matlab then decrpted by anthoer function to load it to.m file, i found a software that makes this trick but the problem is that i can not use this programmaticly inside my.m files? All i want the users can not edit the data saved by my application outside my program and saved again to.mat file?
Should i started working on this trick and more search and read, or try to connect my data to sql database? An SQL database suffers the same problem as any other password-protection- namely, if you can crack the password, you can access the data in the database.
Obviously different SQL databases have different security approaches, and I don't know enough about them to offer anything further. If the software that you have found to do the encryption/decryption can be operated from the Windows/Linux command line, you can access it using Matlab's system command.
You should then be able to run your software from within your.m file. Be cautious, though: if the software takes the encryption key on the command line, then someone monitoring the processes will be able to see the encryption key when you use system or dos or unix. If you store the password in a file and redirect reading of the key from the file, then you have to ensure that the file is never readable by the user, which is tricky in MS Windows (and requires care and experience in Unix) So you need SSL. Or need to use pipes. Perhaps you should consider using your own binary format instead of.mat files. 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? First i would like to Thank you Matt for your reply and help i really appreciated. Actually this very sensitive point when it comes to protected you application data away from users. Adobe fireworks free crack 2. I want to explain in more details how actually matlab compiler works with.mat files - in my application i load and save the data to.mat file the values of the variables change Through running the program.
Hello, I'm asking this question since a quick google search revealed software able to de-obfuscate p files to m files almost perfectly. Is there any way safer (wrt reverse engineering) than pcode to protect matlab code to be used by matlab (i.e. No stand alone executable)? In particular, the code to be protected calls and is called by functions/m files that cannot be obfuscated/protected (they are part of another library that cannot be modified). We are currently using R2012b on production systems, Thank you, -EDIT- Just to be clear. I'm not talking about information leaking from running code, debugging or anything requiring programming skills. I'm talking about decompilation of a p file to a human readable and (very likely) executable m file, by a simple command line statement.
A search in google brought up software that seems able to do just that. Assuming that works (and it sure looks that way), is there a second line of defense to prevent proprietary algorithms being disassembled by a simple one-click operation, while mantaining compatibility/executability in the matlaab environment? E.g.:Once upon a time, i recall m files could be compiled to mex, but it seems this is not the case anymore (or at least it seems requiring multiple steps and lots of headaches). What leads you to the conclusion that pcoded files can easily be de-obfuscated?
![]()
I am aware of the numerous ways that information can leak from a pcoded file and there are some defenses that have been posted in other answers and downloads on this site. I believe that it is simple to defend p-code from the only credible software I found to inspect pcoded files. I believe this software is capitalizing on an already posted weakness of pcoded files. I expect this software can be defeated by any function that checks the datatypes of inputs and errors on unexpected types. P-coding removes all comments and the help section securely. When the names of the internally used variables are obfustcated also, e.g.
Now Deep Fritz 12 is available for direct download, which means you can get the program very quickly, even if you live in a remote location and have long postal delivery times. It also allows you to try out the program before you actually purchase it. All of this is an interesting alternative to purchasing the DVD version.
![]()
'a', 'b', 'Omega13', understanding the code might be more expensive than paying you sufficiently for the source code. I've seen such obfuscated M-file in the FileExchange.
Matlab File Format
Inspite of an excellent demonstration of advanced obfuscation techniques, the comments and rating have not been positive. You can apply AES encryption to strings, which are EVAL'ed. Unfortunately the US laws forbid to post the 2 lines of Java code or the corresponding M-code for a strong AES encryption. I'm convinced that this law is counter-productive, so it is up to the US citizens to influence the politics to remove it. But even then the standard problem remains: How can an encryption key stored securely? You could start a C-mex thread, which pokes into the memory of a Matlab variable with a specified timing.
Then the debugger is not able to determine the key reliably. But I remember, that there has not been any 100% secure method in the history of modern computing. If you invent one, M- and P-files will not be your profession anymore. A new quote: 'If a man has earned enough money, it is time to sit down and take a nap.'
Decrypt P File Matlab Tutorials
Matlab code and and a secure obfuscation are a contradiction by design. It is the purpose of M-code to be compatible with different Matlab versions and environments and therefore dynamic overloading is a fundamental brick of the design. This is a great benefit for interpreted languages. Hiding details in compiled stand-alone applications is not secure, or if it is, it is not flexible anymore. I'm going to make some experiments in the evening.
Would be great if someone would supply the Windows iso of the Advanced installer so one can have the full solution. Filemaker pro mac torrent italiani. It does not include the runtime library for making runtime solutions.
Please I need this done on MATLAB. The scheme we will be using is to offset the ASCII value of the characters in the message using an encryption key. If you remember, a string is stored in MATLAB as a vector of integer numbers we call ASCII values. Each ASCII value corresponds to a specific character that can be displayed by a computer. Below are the ASCII values for the upper and lower case letters. A B C D E F G H I J K L M 65 66 67 68 69 70 71 72 73 74 75 76 77 N O P Q R S T U V W X Y Z 78 79 80 81 82 83 84 85 86 87 88 89 90 Table 1: Capital Letter ASCII Values a b c D E f G h i j k l M 97 98 99 100 101 102 103 104 105 106 107 108 109 n o p Q R s T u v w x y Z 110 111 112 113 114 115 116 117 118 119 120 121 122 Table 2: Lowercase Letter ASCII Values Assume that we are trying to encode the message: I have a secret! If we convert this message into its ASCII values, we would have the following vector: 73 32 104 97 118 101 32 97 32 115 101 99 114 101 116 33 To encode the message, we pick an integer value and add this value to the ASCII values in the message.
If we pick our key value as 4, the message we would send now becomes: 77 32 108 101 122 105 32 101 32 119 105 103 118 105 120 33 If this is displayed as a string, the encoded message becomes: M lezi e wigvix! To decode the message, we simply perform the opposite: subtract off the key from the ASCII values of the encoded message to recover the original message.
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |