Solved

Basic encryption and data transmission

Posted on 2004-04-08
6
280 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

813 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

19 Experts available now in Live!

Get 1:1 Help Now