Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > General > Chit Chat
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Chit Chat The place for open discussions.


Encrypting, decrypting - any better idea how to work with file?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-02-2008, 10:46 AM
Standa's Avatar
Junior Member
 
Join Date: May 2007
Location: Czech Republic
Posts: 25
Default Encrypting, decrypting - any better idea how to work with file?

Hi, maybe stupid question, but...
I am trying to write passwords storage software using crypto library. What is better:
1) Encrypt whole text file with passwords, and when need to read, decrypt this file, save it to string and read.
...or...
2) Encrypt only separate items like www site, nick, pass etc., and save it to readable file. On reading, decrypt only those items what I need to see.
...or...
3) everything is bad, I have better solution for you...

Here is planned format for storage file:

Quote:
<entry>
<desc1>Title</desc1>
<desc2>Address</desc2>
<desc3>Nick</desc3>
<desc4>Password</desc4>
<text1>Basic4ppc</text1>
<text2>http://basic4ppc.com</text2>
<text3>Shrek</text3>
<text4>MyLovelyFiona</text4>
</entry>
I hope, you understand me, this post is very close to the end of my English knowledge
__________________
XDA Flame
Reply With Quote
  #2 (permalink)  
Old 04-02-2008, 07:36 PM
Knows the basics
 
Join Date: May 2007
Location: Daarsit
Posts: 94
Default

I'd use a table & "save" it as a CSV (process it as an array before saving). Then you can load the encrypted file, covert back to csv & use that to feed a table in memory. Makes referencing the data much easier later, as well as obfuscating the structure of your file.

Then again if you're paranoid about someone sneaking a peak at your memory then you are probably using the wrong solution all together.
Reply With Quote
  #3 (permalink)  
Old 04-03-2008, 08:05 AM
Standa's Avatar
Junior Member
 
Join Date: May 2007
Location: Czech Republic
Posts: 25
Default

Yes, table looks like best idea, it saves a lot of my work. Thanks
__________________
XDA Flame
Reply With Quote
  #4 (permalink)  
Old 08-30-2008, 04:58 PM
Newbie
 
Join Date: Aug 2008
Posts: 5
Default Tables, CSV and Encryption - New guy needs help

Hi all, just bought Basic4ppc and thanks to this forum have got up and running more or less in just a few days. I would like to encrypt then write to table and save as CSV. It's the retrieving that gets me I have read and re-read the postings regarding Crypto and I have spent hours trying to get it to work to no avail. I have managed to encrypt using Crypto, writing to a table cell, and then saving to CSV. When retrieving the encrypted information from loading, the data looks good. However, I am unable to 'paste' that secret() back into the Sub btnDecrypt_Click and have it return the original value. I would be most grateful if someone would give some example code if they have succeeded in using CSV with the Crypto.

New to Basic4ppc (Franco-american in Italy),

Georges Louis
Reply With Quote
  #5 (permalink)  
Old 08-30-2008, 06:15 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,368
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Might be easier if you posted your code so we can see where you are going wrong. The Crypto library is limited by having to run under .NET 1.1/1.0. If you are running .NET 2.0 then my CryptoEx library is somewhat more comprehensive (actually that's a bit of an understatement ) and includes examples CryptoEX library

@Erel - might be better shifting this thread to Questions ...
Reply With Quote
  #6 (permalink)  
Old 08-30-2008, 06:48 PM
Newbie
 
Join Date: Aug 2008
Posts: 5
Default Thank you !

Thanks so much for the quick reply and yes I'm running under .NET 2.0 I'll review your CryptoEx library. If my efforts remain unsuccessful, I'll be sure to attach code next time.

It's a real pleasure to see such prompt and generous forum members.

Grazie,

Georges Louis
Reply With Quote
  #7 (permalink)  
Old 08-31-2008, 02:08 PM
Newbie
 
Join Date: Aug 2008
Posts: 5
Default Word of thanks to Agraham

Got the Basic64 functions to work right away ! I am encrypting the data, writing to table cells then saving the table to CSV. When retrieving the data after Loading the CSV, the data "decrypts" perfectly. Thank you again !

Georges Louis
Reply With Quote
  #8 (permalink)  
Old 08-31-2008, 02:13 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,368
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

You realize, I hope, that Base64 is a standard coding scheme not an encryption and as such has no security whatsoever!
Reply With Quote
  #9 (permalink)  
Old 08-31-2008, 04:45 PM
Newbie
 
Join Date: Aug 2008
Posts: 5
Default Base64

Right - Just some positive feedback on your library. I thought of using a secret-key algorithm for the application. Your help file mentions a choice of several. Could you recommend one to get started with ?
Reply With Quote
  #10 (permalink)  
Old 08-31-2008, 05:29 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,368
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by Gapple View Post
Right - Just some positive feedback on your library.
Thank you. Much appreciated
Quote:
I thought of using a secret-key algorithm for the application. Your help file mentions a choice of several. Could you recommend one to get started with ?
Rijndael is the latest and strongest. However its minimum block size is 128 bits so if you encrypt lots of separate small items of data the storage overhead is twice that of the other algorithms. Unless you are paranoid about your data a 128 bit key is sufficient. The next strongest is TripleDES but for domestic use plain DES is probably as good and cheaper computationally unless you are paranoid that GCHQ or the NSA are watching you. RC2 is of historic interest only.
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
Best data to work with GPS Put Claude Questions & Help Needed 4 10-21-2007 08:58 PM
Just an idea ..... Scubaticus Forum Discussion 3 07-20-2007 02:56 PM
Give me an idea conf Questions & Help Needed 6 07-03-2007 06:18 PM
Encrypting and Decrypting XerVision Questions & Help Needed 1 06-16-2007 04:42 PM
two timers won't work sloopa Bug Reports 1 05-22-2007 06:21 AM


All times are GMT. The time now is 05:00 AM.


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