Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I decrypt an encrypted field in Access

Status
Not open for further replies.

trulyblessed

Programmer
Feb 10, 2003
15
0
0
US
I have a field that has been encrypted and it's in a table that I have in Access. I have no idea what method was used to encrypt the data. There are no special characters used, it's just a simple key. For example, In the encrypted text, a "3" needs to become a "1" when decrypted. The field I'm trying to change is a 7 byte field and is all numbers. I just need to somehow convert these numbers to what they should be based on the following key:

Value: 0 1 2 3 4 5 6 7 8 9
Encrypted Value: 0 3 4 9 6 1 5 2 7 8
 
You could create a function like:
Function Decrypt(pstrNum As String) As String
Dim strOut As String
Dim intChar As Integer
For intChar = 1 To Len(pstrNum)
strOut = strOut & InStr("349615278", Mid(pstrNum, intChar, 1))
Next
Decrypt = strOut
End Function
Decrypt("0349615278")=0123456789

Duane
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top