encrypting images in asp.net

G

Guest

I wonder if it is possible to encrypt images(like .tiff or .gif files) in
asp.net? How? Any exampel code or url will be appreciated. Thanks
 
K

Kevin Spencer

It's possible to encrypt any data. However, I can't for the life of me
figure out why you would want to do this. If, for example, you're looking
for a way to prevent images from being copied, forget it. Can't be done. If
it could, we wouldn't need copyright laws!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
G

Guest

The .tiff files ( which represent scanned agreement) will be saved in an sql
database 2000 of security reasons. My client demand that these files will be
encrypted also. It would be helpful if you know of any exampel code or url
about that. Thanks
 
B

Brock Allen

The .tiff files ( which represent scanned agreement) will be saved in
an sql database 2000 of security reasons. My client demand that these
files will be encrypted also. It would be helpful if you know of any
exampel code or url about that. Thanks

Well once you start to do encryption if you ever want the original data you'll
need to do decryption. So this means you need a key. Where does your client
want you to store the key? This is a major problem when people (client typically)
say "oh, just encrypt it" and they don't understand what it all means.

So to help, what's the usage of the images? Meaning they're encrypted in
the DB, when do you pull them out? Who gets to see them and how? Are they
going to be served from an ASP.NET application or do only certain people
get to see them via an intranet application? If we know the scenario a bit
better then you might get some better guidance... This security stuff is
tricky.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
G

Guest

These images are going to be served from an ASP.NET application. Certain
people will be able to look at them (depending on their role/persmissions).
What I only need now is how to encrypt these images when uplaoding them to
sql server 2000 database and how to decrypt them when showing them to
entitled users?
 
B

Brock Allen

Here's the easiest way:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT07.asp

But be aware that you have a key management problem, meaning the key using
DPAPI is managed for your by the host OS and it will be different for each
machine, meaning this approach won't work on a server farm. I'd suggest you
go spend some time reading about the issues revolving around security. The
book I'd recommend is:

http://www.amazon.com/exec/obidos/t...103-7524886-8958265?v=glance&s=books&n=507846

And specifically section 2.6 entitled "Cryptography Is Not the Solution".
Like I said, this security stuff is tricky business; Don't rush into something
without understanding how it works and why you're doing it.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top