|
I'm sorry - that was a little blunt. My fault! I was going to say:
Encrypt the files - use the small file filename and some random-but-fixed data mixed together as the key and use the .NET Encryption services. Save the file with the extension ".encrypt" appended to the ".jpg" or whatever bit, and you are good to go.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Which encryption algorithm would you recommend though? There are numerous included in .NET. The one I came across that works fine is "RijndaelManaged".
|
|
|
|
|
For your situation I wouldn't go for anything too complex - All you want is something that bollixes up the simple user from getting his high-res pics for free, I assume?
Follow this[^] and you won't go too far wrong - it's pretty easy to follow, but without your key it's pretty much unbreakable. It won't stop the FBI or the mafia, but then I hope your pictures wouldn't interest either!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Yes you're completely right. While we're on the subject, would it be possible to compile all of these photos into one single encrypted package which can then only be opened by the application? That would be ideal, but if I have to store all the files separately then that's not a train smash either.
|
|
|
|
|
Yes - the encryption doesn't care what the content is. I would suggest either a simple directory structure, or just a length prefix/filename combination to each file so you can extract them from the decrypted stream.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
What you are looking for is called encryption. The photos can be in the original format (.jpg or whatever), but the files should be encrypted using a good algorithm and a strong password to keep the data protected.
You can either use some ready-to-use encryption software, or create your own program from scratch... If you decide to write your own program, see the System.Security.Cryptography namespace (there are high-quality encryption algortihms ready for you in the .NET library). There are also several articles about encryption here at CodeProject.
|
|
|
|
|
put the hi-res files inside a password-protected ZIP; or encrypt them.
|
|
|
|
|
Luc Pattyn wrote: a password-protected ZIP
very easy to copy and crack
Luc Pattyn wrote: encrypt them
better alternative.
|
|
|
|
|
You do realize that password-protecting a ZIP file is a form of encryption, right?
|
|
|
|
|
One of the weakest types of encryption, huh!
|
|
|
|
|
I don't know, is 256-bit AES encryption weak?
|
|
|
|
|
An alternate idea...
Save the high resolution images to a database on your computer. Associate a unique key to each photo, or just create a single key for an entire batch of images. Include that key(s) on the DVD with the low resolution images. When the customer gives you the DVD, use that key to lookup the high resolution pictures on your computer. The "database", "key", and "computer" can be anything you like. For example, one configuration might be:
Database: SQL Server
Key: GUID
Computer: PC
Alternate cofiguration:
Database: Excel File
Key: Customer name and date the photos were put on the DVD
Computer: DVD's with the key written on them
No need to put the data in the user's hands.
|
|
|
|
|
Store the Picture in Sqlite DataBase and lock it with password
I know nothing , I know nothing ...
|
|
|
|
|
The best way to keep secrets is to not have any. If they must come to him to have images printed anyway, why even store them on the disc? Keeping them does put the onus on the photographer for storage but I'd be surprised if doesn't already have a backup plan. It also gives the option for a client to call/email an order and have them sent.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I asked the same question The only reason I can think of is that he does not want to keep backups of all his photos.
|
|
|
|
|
Another Idea.
Leave the hi-res images as hi-res so the customer can open them and see the difference. But put distinct watermark, so when printed it does not look good.
|
|
|
|
|
Hi all,
I am trying to have my program detect when the system's memory is low. Is there an event or a windows API that I can use to achieve this?
Thanks in advance.
|
|
|
|
|
What for?
No, I don't think you can do that in a reliable way, short of actually requesting lots of memory until you aren't getting any more.
Each new version of Windows is trying harder to have all memory in use all the time, by caching everything they encounter.
|
|
|
|
|
I just need to find a way that will let me know if the OS's memory/resources is low. Is there a windows API or maybe an event in .Net that I can just plug-in to?
|
|
|
|
|
I haven't had it happen since I got more than 512MB ram, and set a decent size page file, however I recall windows pops a message for you if you are running out of memory. It would ask permission to increase the size of the page file. Leave it to Windows I say.
|
|
|
|
|
It's called try/catch . That's the best you can do. Besides, what *is* low memory in windows? It pages to disk, so you shouldn't have to worry about it.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
|
Yes, you can observe the GC.GetTotalMemory, query the WMI information or use the unmanaged APIs. But as you've been told above, this does not make much sense in general... Your question makes sense, if your application itself manages chunks of memory for specific purposes, such as caching.
P.S. The situation is different, if we are talking about some kind of mobile device...
modified on Sunday, August 29, 2010 6:54 AM
|
|
|
|
|
It's generally pointless to try.
|
|
|
|
|
I am trying to access a property on a System.__ComObject by name. I can do this for normal objects:
var mapping = m.GoogleMapping as SimpleGoogleMapping;
var propInfo = googleContact.GetType().GetProperty(mapping.PropertyName);
googleValue = propInfo.GetValue(googleContact, null);
googleContact is a normal class so this doesn't cause a problem.
I tried this (outlookContact is a ContactItem retreived using Outlook Interop, but during debugging, shows as a System.__ComObject):
var mapping = m.OutlookMapping as SimpleOutlookMapping;
var propInfo = outlookContact.GetType().GetProperty(mapping.PropertyName);
propInfo.SetValue(outlookContact, googleValue, null);
But propInfo ends up being null , even though the property name is correct. I've also tried:
var propInfo = typeof(ContactItem).GetProperty(mapping.PropertyName);
without success.
Edit: Using outlookContact.GetType().GetProperties() or typeof(ContactItem).GetProperties() returns an empty list, as does GetMembers() .
Does anyone know how to achieve this with a dynamic object?
I am using .Net 4
|
|
|
|