Solved

Encryption

Posted on 1998-07-30
2
200 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 50 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

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

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

786 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