Solved

Decrypting an encrypted file in memory and then opening it

Posted on 2006-06-20
8
286 Views
Last Modified: 2010-04-17
Dear Masters

i have encrypted a file on the hard disk, i want to decrypt this file in memory and want to open it by another application,FOR EXAMPLE suppose that i have encrypted an Excel file so i want to decrypt it in memory and i want to open it by excel , because of security reasons(preventing some usesr from reading it's data) i don't want to put decrypted file on the hard drive so i need it to be decrypted then to be opened only in memory, how can i do this ? I know that excel files can be password protected, but this is only an example and the important case for me is to decrypt a file in memory then open it by another application.

please guide me, thank you in advance for your information.

sincerely yours
===============
Milad
0
Comment
Question by:miladyyy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
8 Comments
 
LVL 20

Expert Comment

by:alainbryden
ID: 16946436
Well if you need to open a decripted file, then I think what you may need to do is encrypt it, then when you want to open it, decrypt it and open the other application through your program in read only mode, and monitor the application, otherwise, if you are opening the file in the application independent of your program, you will need to decrypt it first and place it into a temporary folder on your hard drive before the other application will read it.
0
 
LVL 20

Expert Comment

by:alainbryden
ID: 16946456
For example, if you have an incrypted file, you can open it in your program then excel by first decripting opening the file and decrypting it from within your program, and then giving Excel reference to the file by creating an Excel.Application from within your program, then when you are done with it, you don't save your decrypted changes to the file and it remains, on the hard drive, encrypted. But you can only do this easily with some applications, some won't let an external program create an instance of them, and the way to do it differs with each one.
0
 

Author Comment

by:miladyyy
ID: 16948942
Dear alainbryden

First of Thank you for your information, the only thiong that i don't know is :

"Creating a temporary file in memory"

So please help me.if any source code is available please guide me.

Thank you in advance
===============
Sincerely Yours
Milad
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Accepted Solution

by:
alainbryden earned 50 total points
ID: 16951642
Well I never said "Creating a temporary file in memory" (ie RAM) because you can't create a file in RAM, you can only store data in ram. (that data could be an entire file but it would be awkward working with it, because it can no longer be treated as a file.)
what I had said was "place it into a temporary folder", But I still think you can work with this option.

What I do for instance is I say

open( ...the file you are opening..)
then
save( ..the file you are saving, "C:/temp/mytemp.ext")
make alterations/ decrypt it etc and read from it.
and then when you are done with it:
delete("C:/temp/mytemp.ext")
and all that remains it the encrypted file.
0
 
LVL 20

Expert Comment

by:alainbryden
ID: 17229199
I certainly don't have an objection :P

I'm pretty sure my reccomendation is accurate to as great an extent as it is able to be, considering the information provided.
0
 
LVL 20

Expert Comment

by:alainbryden
ID: 17229203
well worth at least 50 points anyways
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question