Link to home
Start Free TrialLog in
Avatar of steveybop
steveybop

asked on

Basic encryption and data transmission

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
Avatar of phyderous
phyderous

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





ASKER CERTIFIED SOLUTION
Avatar of venkateshwarr
venkateshwarr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial