Code covered by the BSD License  

Highlights from
pass_protect

3.33333

3.3 | 3 ratings Rate this file 15 Downloads (last 30 days) File Size: 4.31 KB File ID: #17288

pass_protect

by Matt Fig

 

01 Nov 2007 (Updated 02 Nov 2007)

Creates a password protected pcode version of an M-file.

| Watch this File

File Information
Description

Creates a password protected pcode version of an M-file. The user of the pcode file will have to enter the password only on the first execution of the code per session, or until a 'clear all' command is issued. Will not alter the input M-file. Please see the rather verbose help for more information and a built in example.
Please contact me for bug fixes and/or suggestions. My email is in the file. Thanks.

MATLAB release MATLAB 7.2 (R2006a)
Other requirements Created on Winxp, using 2006a.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
02 Nov 2007 Daniel Laug

Well done. One suggestion I would make is this: Why not just return the "intermediate M-file" but with only the help section intact? That way the person who encodes a file could distribute the password protected version (pcode) with a help file included for the end user. Just a suggestion, other than that I like the file.

03 Nov 2007 Matt Fig

Good idea, Daniel. I am going overseas for a week, so if I don't get to it before I go, I will look into it when I get back. As it is now, the person who generates the password protected pcode can open and inspect the M-file, then delete everything after the help very easily. That will give them the help file to accompany the pcode file. Thanks.

04 Nov 2007 Zhijun Wang

Good Work!

06 Dec 2009 ZerO

Good Work .

19 Jan 2010 Jan Simon

Good idea, very good documentation, smart example.

A bug: The example fails since Matlab 2008b (or earlier?), because the line breaks of M-files are char(10) now, but pass_protect assumes [13, 10]. Solution: Swap "13" and "10" in the lines 128 and 129, than this works on Windows and Linux formated files.

But there is a remarkable problem: The password is saved as clear text in the file and I need less than a minute to extract it. Without substantial improvements the level of protection is low.

17 May 2012 Jan Simon

While I still appreciate the quality of the code, I do think that the achieved protection level is not high enough for a function called "pass_protect".
It will need less than a minute to circumvent the P-coded password check.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
pcode Matt Fig 22 Oct 2008 09:33:28
password Matt Fig 22 Oct 2008 09:33:28
protect Matt Fig 22 Oct 2008 09:33:28
secure Matt Fig 22 Oct 2008 09:33:28

Contact us at files@mathworks.com