Jump to content

Hiding the source?


Recommended Posts

md5 thispass = affad8802842c213a7a7c09d6cb0403a

 

store that as your password in the perl script

then ask the user for thier password

then compare the two

$encrypted_pass = "affad8802842c213a7a7c09d6cb0403a"

if (md5"$users_password"== $encrypted_pass) {

print "good password";

} else {

print "bad password";

}

 

at least that's kinda how I would do it in PHP :)

Link to comment
Share on other sites

Where is thought to be run that command? depending on what do you want to do paul's advice is good or not.

 

For example, in a server application where the user has no access to the source code of the program (ie php, or perl CGIs) paul's advice is great.

 

But for a 'system' application (versus server-client app) that advice if it is not combined with permission/group restrictions is useless. Nothing avoids a bad minded user to copy your perl program to a less restrictive area of the system and change the source code, ie:

$encrypted_pass = "affad8802842c213a7a7c09d6cb0403a"
if (1==1) {
print "good password";
} else {
print "bad password";
}

and then execute it's own copy of the program skiping the protection

 

So, what kind of program will be? where, who and for what is thought to be executed? and perl is a must be or you can code in a compiled language?

 

If that program is a 'system' program in Linux/Unix the security is granted by a permission and user/group id system. I suggest you to follow this system, it has been tested during years. If you can't then use a compiled langauge to hide the source code.

:)

Edited by aru
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...