Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Decrypting an encrypted file in memory and then opening it

Posted on 2006-06-20
8
Medium Priority
?
288 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
LVL 20

Accepted Solution

by:
alainbryden earned 200 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

Technology Partners: 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

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.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

721 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