Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Code Samples & Tips Share your recent discoveries and ideas with other users.


Encrypt / Decrypt a complete file


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-04-2007, 09:45 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,141
Default Encrypt / Decrypt a complete file

This is an example of using the Crypto library (together with the BinaryFile library) to encrypt and later decrypt a complete file.
You can use it to encrypt a file, send the encrypted file over an unsecured connection and then decrypt it.
Attached Files
File Type: zip EncryptFile.zip (10.2 KB, 30 views)
Reply With Quote
  #2 (permalink)  
Old 06-05-2007, 01:09 PM
Junior Member
 
Join Date: May 2007
Posts: 37
Default

Very nice code! I've tried this and that's great..

Can crypto control decrypt a file -on the fly-? So no need to always make a temporary one and then delete it after the application is closed. In my project I want to use the already encrypted sql database file, and then decrypt it just when the app read them. But don't want to make a temporary file, because there's always a possibility, while the file is not in the encrypted state, that file (temporary decrypted file) can be copied by user, and.. in that case, the protection is gone.

One more question, Is the decryption process from files need high 'power' of pda's device? Because i don't want it slows down my app's performance.

Thank you..
Reply With Quote
  #3 (permalink)  
Old 06-05-2007, 05:13 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,141
Default

You can encrypt a complete file without using a temporary file as long as you have enough memory.
You could just read the whole file to an array and then encrypt it.
The decryption takes some time, you should test if it suits your needs.
Reply With Quote
  #4 (permalink)  
Old 06-05-2007, 05:20 PM
Junior Member
 
Join Date: May 2007
Posts: 37
Default

Thanks Erel. So the only thing to consider is the performance. I've tried the method at ipaq hx2750 a little bit slow. and at o2 atom exec slower than 2750. At rx3417 faster than atom exec but slower than 2750. At 1940 just 'like' stuck (too long for me)..
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
encrypt in1st app, decrypt in 2nd app Arrie Questions & Help Needed 20 06-02-2008 10:05 PM
CSV file generates strange start in file sunnyboyj Questions & Help Needed 9 12-21-2007 09:38 PM
Decrypt Big JR Questions & Help Needed 8 06-30-2007 08:36 PM
Trying to encrypt a file transer mwaite Questions & Help Needed 8 06-05-2007 06:02 PM


All times are GMT. The time now is 10:57 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0