Solved

Basic encryption and data transmission

Posted on 2004-04-08
6
279 Views
Last Modified: 2013-11-13
I have to write an application in VB6 to implement some basic encryption algorithm and subsequently transmit this ciphertext across a LAN to another terminal where it will be decrypted. This algorithm will be devised by me and doesnt have to be hacker proof just make the data pretty unreadable. Since the data is not neccesarily ASCII (ie could be images etc.) I was thinking that the best course of action would be to do some data manipulation (such as  simple XOR) on the binary data of the file.

My overall question is would the MSCOMM control be the best thing to use the get the PC's to communicate? I will simply be setting up 2 PC's in a lab, connected by a crossover cable in order to demonstrate my program.

How do I go about opening a file in binary format, to do the encryption on it?

Im a bit of a newbie so any suggestions at all would be greatly appreciated. Thanks for your time. Steve
0
Comment
Question by:steveybop
6 Comments
 
LVL 5

Expert Comment

by:phyderous
ID: 10783378
I would use the following senarion,

please let me know if you need any help,

encrypt the data use CAPICOM from microsoft,

it is a com implemntaion of encrypt alogarithms like des,3des and so on,

then I would use WINSOCK you can use the com version by adding MSWINSCK.OCX
the documentaion is avilable under "Winsock Control" in the msdn

then simply use the send command,

now about open a file in binaty format

just use the open statment of vb

dim a() as byte
open "c.dat" for binary access read as #1
get #1,,a
close #1

a will be an array of the file bytes,

how ever you may want to consider reading chunk of filesif the file is to big for example

dim a() as byte

open "c.dat" for binary access read as #1

do while not eof(1)
erase a
redim a(1024) as byte
get #1,,a

x.send encrypt(a)

loop


this is a psedo code,

there sould be no problem implement it





0
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 125 total points
ID: 10783385
There are several algorithms that are already implemented.
Take a look at these sites.

http://www.echeque.com/Kong/tools.htm
http://www.emu8086.com/vb/enigma.html
http://www.codearchive.com/list.php?go=0206
0
 
LVL 14

Assisted Solution

by:Matti
Matti earned 125 total points
ID: 10783413
MSCOMM don't have use in this. it's for serial ports and cables only.

Try Winsock control and ofcause need TCP/IP protocoll

Apply this sample:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=36217&lngWId=1

Or just simple a shared folder where to put crypted files and filecopy over network and let OS do all protocol's and such.

Matti
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video teaches viewers about errors in exception handling.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now