Read encrypted file header

Reply

Join Date: Aug 2005
Posts: 188
Reputation: bops is an unknown quantity at this point 
Solved Threads: 3
bops bops is offline Offline
Junior Poster

Read encrypted file header

 
0
  #1
Jul 26th, 2007
How would one read an encrypted file's (encrypted using windows' EFS) header? I would like to be able to read the header and extract FEK that was encrypted by either the public or private key of the file.

From reading up I understand the structure of the file header I'm just not sure how to go about reading the header. Also it would be a great help if you could point me in the direction of any apps that read a file header and display it on screen.

EDIT: By encrypted file I mean that it was encrypted using EFS on my previous system and backed up and put onto my current system so they aren't treated as encrypted files anymore but they are encrypted.

Thanks
Last edited by bops; Jul 26th, 2007 at 9:42 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: Read encrypted file header

 
0
  #2
Jul 26th, 2007
First of all I am not familiar with the EFS structure.
Is the header encrypted or not?
If the header is not encrypted, then reading it is the same as reading normal files. Look up for code that reads a bitmap file and extracts the header and image contents. It should be similar.

If the header in encrypted too, then you should decrypt it before trying anything else.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 188
Reputation: bops is an unknown quantity at this point 
Solved Threads: 3
bops bops is offline Offline
Junior Poster

Re: Read encrypted file header

 
0
  #3
Jul 27th, 2007
No I don't think the header itself is encrypted because you need some of the content of the header to decrypt the file content in EFS. i have tried looking around but I can't find any kind of method to it, do any API's exist or is there a specific format for a header of a file, anything at all to get me started would be great, thanks.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,142
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1434
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: Read encrypted file header

 
0
  #4
Jul 27th, 2007
did you read this ? Or research these google links ?
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,145
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Read encrypted file header

 
0
  #5
Jul 28th, 2007
you'd read them the same as any other, and then pull them through some decryption system...
It's just bits and bytes after all, same as any other part of any other file.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 188
Reputation: bops is an unknown quantity at this point 
Solved Threads: 3
bops bops is offline Offline
Junior Poster

Re: Read encrypted file header

 
0
  #6
Jul 28th, 2007
Yes, I've researched it quite a lot. I've read that MSDN page aswell as most google links that I think are relevant. My question is how I would read the file header, i.e. how I would be able to allocate memory and then read the file header into memory, for example, reading a .jpg file like a normal file does not give me the file header in any kind of format visible instead it comes out with a lot of random characters, i.e. the file is stored in some way which I don't yet understand, thats what I'm asking for, basically I want to read a file header into seperate variables and work with them from there..

An short simple example or a link to an example of say reading a JPG fileheader into seperate variables in memory would be ideal.
Last edited by bops; Jul 28th, 2007 at 11:23 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,851
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Read encrypted file header

 
0
  #7
Jul 28th, 2007
Well common file formats are listed here
http://www.wotsit.org/

Simply typing in say "jpg file format" into your favourite search engine would reveal as much.

Windows EFS on the other hand is proprietary for sure, deliberately kept secret (perhaps), and an altogether different prospect.
Perhaps this would help.

> My question is how I would read the file header
You allocate 'n' bytes.
You read 'n' bytes into the memory you allocated.
You examine each byte in turn, and using your knowledge of the file format, decide what that byte actually means.

Most file formats begin with some fixed sized header (this is your first 'n'). Within that header, there is usually something which tells you how big the variable sized data is going to be.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,145
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Read encrypted file header

 
0
  #8
Jul 28th, 2007
"reading a .jpg file like a normal file does not give me the file header in any kind of format visible instead it comes out with a lot of random characters"

Hardly random. There's a definite structure there which is well defined in the JPEG file format specification.
Same for all other file formats. Of course the specification may not be public.
And of course there may be more information scattered across the rest of the file determining its makeup and layout, again well defined in the file format specification.

Your task is to find that specification some way and write some software to read it.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 2
Reputation: draftjoker is an unknown quantity at this point 
Solved Threads: 0
draftjoker draftjoker is offline Offline
Newbie Poster

Re: Read encrypted file header

 
0
  #9
Jul 29th, 2007
Yea, agreed...

<url snipped>
Last edited by Ancient Dragon; Jul 29th, 2007 at 8:04 pm. Reason: snipped url
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC