Page 1 of 1

Can a Hex File be Password Protected???

Posted: Sat Mar 14, 2009 10:45 am
by Phoenix*
Hi Everyone...

I'm new to the forum, and I'm not involved in your field of expertise...
The reason I'm here, is to find out whether a Hex File can be Password Protected.
I have Hex Files coming off Engine Management Systems (EMS) from Performance Cars, and would like to have them Password Protected, in order to avoid unnecessary tampering from an outsider...the file needs to be protected, and still readable from the EMS ecu...

Any help and advice would be greatly appreciated.

Regards,
Phoenix*

P.S. I've attached one of these Hex Files as an example.

Re: Can a Hex File be Password Protected???

Posted: Sat Mar 14, 2009 5:01 pm
by Phoenix*
BUMP... :D

Re: Can a Hex File be Password Protected???

Posted: Sat Mar 14, 2009 5:01 pm
by Phoenix*
[Deleted]

Re: Can a Hex File be Password Protected???

Posted: Sat Mar 14, 2009 5:02 pm
by Benjamin
Forum Rules 1-1.4 wrote: 4. All users of any level are restricted from bumping (as defined here) any given thread within twenty-four (24) hours of its last post. Non-trivial posts are not considered bumping. A bump post found in violation will be deleted, and you may or may not receive a warning. Persons bumping excessively be considered as spammers and dealt with accordingly.

Re: Can a Hex File be Password Protected???

Posted: Sat Mar 14, 2009 5:10 pm
by Phoenix*
My apologies astions...
Didn't mean to break the rules...

Not off to a good start for a newbie...

Won't happen again...

Re: Can a Hex File be Password Protected???

Posted: Sat Mar 14, 2009 5:13 pm
by Benjamin
You can use md5_file() to calculate a 32 character string of the file, which is known as a hash. If the file is changed in any way, the hash will not match.

http://us3.php.net/manual/en/function.md5-file.php

Re: Can a Hex File be Password Protected???

Posted: Sat Mar 14, 2009 5:17 pm
by Phoenix*
Understood...will have a better look as this later this morning.
01h00 at the moment...and logged in via mobile phone.

Thank you for your reply.

Re: Can a Hex File be Password Protected???

Posted: Sun Mar 15, 2009 3:55 am
by Phoenix*
Sadly, I can't get it to work... :(
Would it be ok to ask for some spoon feeding? :oops:

I've attached links of two programs I use to open, and manipulate these ecu Hex Files:
http://www.openecu.org/index.php?title=EcuFlash - Download EcuFlash 1.41
http://www.romraider.com/ - Download RomRaider 0.5.2b

Download these programs and see what I see.
Ecuflash to me is the most important, since it reads/downloads and writes to the vehicles ecu.
Romraider just holds reading functionality.

Would the md5_file() / hash allow me to upload and download the Hex File from the ecu, without negatively affecting the ecu from reading the file?...I can test this with one of my EMS's!
I'm looking for something that allows me to only read/download the file, once I plug in a specific password on request...then I'd manipulate accordingly...and finally write back to the ecu when finished. I need the password protection to reset itself each time after writing back to the ecu, so the password will only need to be inputted when attempting to read the file, again and again...Hope this makes sense...I suck at explaining things to others... :roll:

Re: Can a Hex File be Password Protected???

Posted: Sun Mar 15, 2009 3:59 am
by Benjamin

Code: Select all

 
folder
  - file.php
  - ecm.hex
 
in file.php

Code: Select all

 
<?php
$hash = md5_file('ecm.hex');
echo $hash;
 
// let's say the hash is 123456789.  It will actually be a 32 character string
 
if (md5_file('ecm.hex') == '123456789') {
    echo "The file has not been changed";
} else {
    echo "The file has been changed";
}
 

Re: Can a Hex File be Password Protected???

Posted: Sun Mar 15, 2009 4:20 am
by Phoenix*
astions wrote:

Code: Select all

 
folder
  - file.php
  - ecm.hex
 
in file.php

Code: Select all

 
<?php
$hash = md5_file('ecm.hex');
echo $hash;
 
// let's say the hash is 123456789.  It will actually be a 32 character string
 
if (md5_file('ecm.hex') == '123456789') {
    echo "The file has not been changed";
} else {
    echo "The file has been changed";
}
 
Must I copy and paste this into the Hex File?
When I add any additional text/code, the file cannot be opened by the programs I listed above... :?:
I'm sooo lost...sorry! :banghead:

Re: Can a Hex File be Password Protected???

Posted: Sun Mar 15, 2009 4:25 am
by Benjamin
No, you create a seperate PHP file to hash the ecm file. Please note that PHP is generally used on webservers and may not be suited towards your intented use.

Re: Can a Hex File be Password Protected???

Posted: Sun Mar 15, 2009 4:44 am
by Phoenix*
astions wrote:No, you create a seperate PHP file to hash the ecm file. Please note that PHP is generally used on webservers and may not be suited towards your intented use.
Aaaah...I see the light...LOL

This is expected...How do I create a separate PHP file? :dubious: :dubious: :oops: :oops: :roll: :roll:

Yeah, I hear you...could not work, but let's see what happens.

Thanks for your support and patience astions... :wink:

Re: Can a Hex File be Password Protected???

Posted: Sun Mar 15, 2009 4:55 am
by Benjamin
Well you create a file and name it something.php.

Then you can access it with your web browser by going to http://servername.com/something.php. You can install a server locally using http://www.apachefriends.org/en/xampp-windows.html

Once you have that installed you can run php files by going to http://localhost/something.php

Re: Can a Hex File be Password Protected???

Posted: Sun Mar 15, 2009 6:48 am
by Phoenix*
Thank you for the info. Give me a day or two to try this out...

Hope to chat soon.