That looks really useful, I'll give it a go later.
The front-end database is a .MDE file, so the users can't access the code.
I use a function written by Arvin Meyer. I've posted it to our files>Encrypt_Decrypt_usesKey.txt. You send the string you want encrypted/decrypted along with the key string. I usually hide the key as a database property under some innocuous property name like "Department" or "Document number" and set that property to the value of the key string. Then I call the function like this:
strMyPassword = Encrypt("myPassword", GetSummaryInfo("Document number", False, "Custom")
Public Function GetSummaryInfo(strPropName As String, _
Optional IsAddin As Boolean = False, _
Optional strType As String = "Summary") As String
'Purpose : Get Summary or Custom info such as Title for current project
'DateTime : 8/09/2010 11:41
'Author : Bill Mosca
Dim dbs As DAO.Database, cnt As DAO.Container
Dim doc As DAO.Document, prp As DAO.Property
Const conPropertyNotFound = 3270
On Error GoTo err_PROC
'If information belongs to an add-in, use the add-in's database.
If IsAddin = True Then
Set dbs = CodeDb
Else: Set dbs = CurrentDb
Set cnt = dbs.Containers!Databases
Select Case strType
Set doc = cnt.Documents!SummaryInfo
Set doc = cnt.Documents!UserDefined
GetSummaryInfo = doc.Properties(strPropName)
GetSummaryInfo = ""
When you look at the encrypt function you will see it works both ways. Making the front end an ACCDE file will strip out the code so your users won't be able to see the function and crack the stored password. The encrypted password in the table will be completely unreadable.
Bill Mosca, Founder - MS_Access_Professionals
Microsoft Office Access MVP
My nothing-to-do-with-Access blog
Does anyone have any pointers on how best to generate encrypted passwords that are stored in a table? They need to be able to be unencrypted as well, so a one-way hashing algorithm wouldn't be much use. Using MS Capicom seems to have been the favoured way in the past, but it's been deprecated and is no longer supported by MS.
Posted by: Andrew Wilson <firstname.lastname@example.org>
|Reply via web post||•||Reply to sender||•||Reply to group||•||Start a New Topic||•||Messages in this topic (3)|