Can a Hex File be Password Protected???

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
Phoenix*
Forum Newbie
Posts: 10
Joined: Sat Mar 14, 2009 10:26 am

Can a Hex File be Password Protected???

Post 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.
Attachments
A4TH100H.zip
(72.03 KiB) Downloaded 78 times
Phoenix*
Forum Newbie
Posts: 10
Joined: Sat Mar 14, 2009 10:26 am

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

Post by Phoenix* »

BUMP... :D
Phoenix*
Forum Newbie
Posts: 10
Joined: Sat Mar 14, 2009 10:26 am

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

Post by Phoenix* »

[Deleted]
Last edited by Phoenix* on Sun Mar 15, 2009 2:48 am, edited 1 time in total.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

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

Post 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.
Phoenix*
Forum Newbie
Posts: 10
Joined: Sat Mar 14, 2009 10:26 am

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

Post 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...
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

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

Post 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
Phoenix*
Forum Newbie
Posts: 10
Joined: Sat Mar 14, 2009 10:26 am

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

Post 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.
Phoenix*
Forum Newbie
Posts: 10
Joined: Sat Mar 14, 2009 10:26 am

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

Post 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:
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

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

Post 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";
}
 
Phoenix*
Forum Newbie
Posts: 10
Joined: Sat Mar 14, 2009 10:26 am

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

Post 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:
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

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

Post 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.
Phoenix*
Forum Newbie
Posts: 10
Joined: Sat Mar 14, 2009 10:26 am

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

Post 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:
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

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

Post 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
Phoenix*
Forum Newbie
Posts: 10
Joined: Sat Mar 14, 2009 10:26 am

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

Post by Phoenix* »

Thank you for the info. Give me a day or two to try this out...

Hope to chat soon.
Post Reply