Solved

Basic encryption and data transmission

Posted on 2004-04-08
6
278 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

14 Experts available now in Live!

Get 1:1 Help Now