?
Solved

Encryption

Posted on 1998-07-30
2
Medium Priority
?
206 Views
Last Modified: 2010-05-03
Hi all,
     I was wondering if any of you experts out there have an encryption routine or algorithm I can use.  I am trying to
encrypt selected information from an access database to a text file to be compressed and sent over to a remote
computer and decrypted on the remote computer.  Thanks!
0
Comment
Question by:palim
2 Comments
 
LVL 6

Expert Comment

by:anthonyc
ID: 1467216
this is a duplicate question.  Please do not answer it.
0
 
LVL 18

Accepted Solution

by:
deighton earned 100 total points
ID: 1467217
Public Function Decrypt(strInput As String, strDefault As String) As String
    Dim i, intAscii, intChar1, intChar2 As Integer
    Dim strTemp As String
   
    If strInput = "" Then
        Decrypt = strDefault
        Exit Function
    End If
   
    strTemp = ""
    For i = 1 To Len(strInput) Step 2
        intAscii = (ConvChar(Mid$(strInput, i, 1)) * 16) + ConvChar(Mid$(strInput, i + 1, 1)) - 13
        If intAscii < 0 Then intAscii = intAscii + 255
        strTemp = strTemp + Chr(intAscii)
    Next i
   
    Decrypt = strTemp
End Function

Public Function ConvChar(strInput As String) As Integer
    Select Case strInput
        Case "A"
            ConvChar = 10
            Exit Function
        Case "B"
            ConvChar = 11
            Exit Function
        Case "C"
            ConvChar = 12
            Exit Function
        Case "D"
            ConvChar = 13
            Exit Function
        Case "E"
            ConvChar = 14
            Exit Function
        Case "F"
            ConvChar = 15
            Exit Function
        Case Else
            ConvChar = Int(strInput)
        Exit Function
    End Select
End Function


0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

850 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