Solved

Encryption

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

820 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