Senin, 06 Juni 2016

[MS_AccessPros] Re: Encrypted passwords in table

 

Andrew


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")

GetSummaryInfo function:

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
    End If

    Set cnt = dbs.Containers!Databases
    Select Case strType
        Case "Summary"
            Set doc = cnt.Documents!SummaryInfo
        Case "Custom"
            Set doc = cnt.Documents!UserDefined
    End Select

    doc.Properties.Refresh
    GetSummaryInfo = doc.Properties(strPropName)

exit_PROC:
    Exit Function

err_PROC:
    GetSummaryInfo = ""
    Resume exit_PROC

End Function


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.

Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
Microsoft Office Access MVP
https://mvp.microsoft.com/en-us/PublicProfile/35852?fullName=Bill%20%20Mosca
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com



---In MS_Access_Professionals@yahoogroups.com, <andrew@adwsystems.co.uk> wrote :

Hi All,
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.

Thanks,
Andrew

 

__._,_.___

Posted by: wrmosca@comcast.net
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Poskan Komentar