Solved

Encryption

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

762 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

24 Experts available now in Live!

Get 1:1 Help Now