Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Encryption  (Read 811 times)
Canning
Community Member
*
Posts: 320


« on: December 03, 2007, 05:19:26 PM »

Hello,

I am looking for some good encryption code. The code I have adds an extra 2 characters to the string when i open up a saved encrypted file. Not sure why.

Please help

Canning
Logged
Hypnotron
Customers
Community Member
*****
Posts: 808


« Reply #1 on: December 03, 2007, 06:47:31 PM »

it might help if you tell people what language and what its primarily going to be used for. 

Logged
petroz
Community Member
*
Posts: 603


WWW
« Reply #2 on: December 03, 2007, 07:16:20 PM »

There is a lot of options when it comes to encryption. When you say 'good' encryption code you could probably help us out by specify what qualities you desire. Is it just to make game data files unreadable or must it be very secure (financial information etc.)

It is my recommendation at this point that you look online for some encryption algorithms which suit your purposes because we do not have enough information at this point to really make the decision for you.

-Petroz
Logged

Happiness is found in your kindness.

Project: BattleSpace
Gallery URL:
http://s235.photobucket.com/albums/ee185/PeterStirling
Canning
Community Member
*
Posts: 320


« Reply #3 on: December 06, 2007, 05:13:14 PM »

OK, I am using vb 6 and tv3d 6.3.
My problem is that when I encrypt a string, save this to a file, and then open this file and decrypt it... the string is not the same. An extra 2 characters are added to the string.

« Last Edit: December 11, 2007, 06:04:18 PM by Canning » Logged
Hypnotron
Customers
Community Member
*****
Posts: 808


« Reply #4 on: December 06, 2007, 05:36:52 PM »

good grief.
Logged
beyonder
Customers
Community Member
*****
Posts: 249


« Reply #5 on: December 06, 2007, 05:38:30 PM »

If you are saving the file in VB6 it will add an extra carriage return to the file. I forget if this is while printing the file or reading the file from disk.  
 
Anyway, you can get rid of the extra two characters by doing something like this:
 
DString = Mid(DString, 1, Len(DString) - 2)

The extra two characters are Chr(13) + Chr(10) and they are at the end of the file.

I'm pretty sure that's it...
« Last Edit: December 06, 2007, 05:49:00 PM by beyonder » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks